summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-01-10 17:19:42 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-16 19:42:52 +0900
commit92da224d228be6a38b5e86ea43290e6e5a33df45 (patch)
treec70690932c6ead6a03b16f0c3a22d4eb688448c3
parentc143a2f9476073e3ced746009b10c81e68ec22bb (diff)
[ruby/io-console] Delegate to JRuby version
Add `--platform` option tentatively. https://github.com/ruby/io-console/commit/3bf1a7b753
-rw-r--r--ext/io/console/io-console.gemspec15
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/io/console/io-console.gemspec b/ext/io/console/io-console.gemspec
index 8a0df83..49c9b3a 100644
--- a/ext/io/console/io-console.gemspec
+++ b/ext/io/console/io-console.gemspec
@@ -21,5 +21,20 @@ Gem::Specification.new do |s|
lib/io/console/size.rb
]
s.extensions = %w[ext/io/console/extconf.rb]
+
+ if i = ARGV.index("--") and !(argv = ARGV[i+1..-1]).empty?
+ OptionParser.new(__FILE__) do |opt|
+ opt.on("--platform=PLATFORM") {|p| s.platform = p}
+ end.parse!(argv)
+ end
+ if Gem::Platform === s.platform and s.platform =~ 'java'
+ s.files.delete_if {|f| f.start_with?("ext/")}
+ s.extensions.clear
+ s.require_paths.unshift("jruby")
+ s.files.concat(%w[
+ jruby/io/console.rb
+ ])
+ end
+
s.licenses = ["Ruby", "BSD-2-Clause"]
end