summaryrefslogtreecommitdiff
path: root/lib/cgi
diff options
context:
space:
mode:
authorPavel Rosický <pavel.rosicky@easy.cz>2021-09-24 00:33:36 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-06-06 18:13:01 +0900
commit4bc7cef866dc4e4e5c2d94cdd65dd24cc7b7555d (patch)
tree8d2d5014cb03cd671658d493ae2edf11212f3792 /lib/cgi
parent5d014bcb61cbc443be6e6bd722573bf9e482a9be (diff)
[ruby/cgi] jruby support
https://github.com/ruby/cgi/commit/93326fb622
Diffstat (limited to 'lib/cgi')
-rw-r--r--lib/cgi/cgi.gemspec19
1 files changed, 15 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|
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