summaryrefslogtreecommitdiff
path: root/ext/io
diff options
context:
space:
mode:
Diffstat (limited to 'ext/io')
-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