Skip to content

Commit 3bf1a7b

Browse files
committed
Delegate to JRuby version
Add `--platform` option tentatively.
1 parent 8c8b0b6 commit 3bf1a7b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

io-console.gemspec

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,20 @@ Gem::Specification.new do |s|
2121
lib/io/console/size.rb
2222
]
2323
s.extensions = %w[ext/io/console/extconf.rb]
24+
25+
if i = ARGV.index("--") and !(argv = ARGV[i+1..-1]).empty?
26+
OptionParser.new(__FILE__) do |opt|
27+
opt.on("--platform=PLATFORM") {|p| s.platform = p}
28+
end.parse!(argv)
29+
end
30+
if Gem::Platform === s.platform and s.platform =~ 'java'
31+
s.files.delete_if {|f| f.start_with?("ext/")}
32+
s.extensions.clear
33+
s.require_paths.unshift("jruby")
34+
s.files.concat(%w[
35+
jruby/io/console.rb
36+
])
37+
end
38+
2439
s.license = "BSD-2-Clause"
2540
end

jruby/io/console.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require 'io/console/jruby'

0 commit comments

Comments
 (0)