ruby-changes:72066
From: Pavel <ko1@a...>
Date: Mon, 6 Jun 2022 18:19:39 +0900 (JST)
Subject: [ruby-changes:72066] 4bc7cef866 (master): [ruby/cgi] jruby support
https://git.ruby-lang.org/ruby.git/commit/?id=4bc7cef866 From 4bc7cef866dc4e4e5c2d94cdd65dd24cc7b7555d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Rosick=C3=BD?= <pavel.rosicky@e...> Date: Fri, 24 Sep 2021 00:33:36 +0200 Subject: [ruby/cgi] jruby support https://github.com/ruby/cgi/commit/93326fb622 --- lib/cgi/cgi.gemspec | 19 +++++++++++++++---- test/cgi/test_cgi_util.rb | 1 + 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/cgi/cgi.gemspec b/lib/cgi/cgi.gemspec index 3ba62b93f6..381c55a5ca 100644 --- a/lib/cgi/cgi.gemspec +++ b/lib/cgi/cgi.gemspec @@ -22,10 +22,21 @@ Gem::Specification.new do |spec| https://github.com/ruby/ruby/blob/trunk/lib/cgi/cgi.gemspec#L22 spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = spec.homepage - spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do - `git ls-files -z 2>/dev/null`.split("\x0").reject { |f| f.match(%r{\A(?:(?:test|spec|features)/|\.git)}) } - end - spec.extensions = ["ext/cgi/escape/extconf.rb"] spec.executables = [] + + spec.files = [ + "LICENSE.txt", + "README.md", + *Dir["lib{.rb,/**/*.rb}", "bin/*"] ] + spec.require_paths = ["lib"] + + if Gem::Platform === spec.platform and spec.platform =~ 'java' or RUBY_ENGINE == 'jruby' + spec.platform = 'java' + spec.require_paths << "ext/java/org/jruby/ext/cgi/escape/lib" + spec.files += Dir["ext/java/**/*.{rb}", "lib/cgi/escape.jar"] + else + spec.files += Dir["ext/cgi/**/*.{rb,c,h,sh}", "ext/cgi/escape/depend", "lib/cgi/escape.so"] + spec.extensions = ["ext/cgi/escape/extconf.rb"] + end end diff --git a/test/cgi/test_cgi_util.rb b/test/cgi/test_cgi_util.rb index 5a2d07b328..5baf87db75 100644 --- a/test/cgi/test_cgi_util.rb +++ b/test/cgi/test_cgi_util.rb @@ -105,6 +105,7 @@ class CGIUtilTest < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/cgi/test_cgi_util.rb#L105 end def test_cgi_escape_html_large + return if RUBY_ENGINE == 'jruby' ulong_max, size_max = RbConfig::LIMITS.values_at("ULONG_MAX", "SIZE_MAX") return unless ulong_max < size_max # Platforms not concerned -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/