[前][次][番号順一覧][スレッド一覧]

ruby-changes:64905

From: Nobuyoshi <ko1@a...>
Date: Sat, 16 Jan 2021 19:43:40 +0900 (JST)
Subject: [ruby-changes:64905] 92da224d22 (master): [ruby/io-console] Delegate to JRuby version

https://git.ruby-lang.org/ruby.git/commit/?id=92da224d22

From 92da224d228be6a38b5e86ea43290e6e5a33df45 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 10 Jan 2020 17:19:42 +0900
Subject: [ruby/io-console] Delegate to JRuby version

Add `--platform` option tentatively.

https://github.com/ruby/io-console/commit/3bf1a7b753

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| https://github.com/ruby/ruby/blob/trunk/ext/io/console/io-console.gemspec#L21
     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
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]