[ruby-oci8-commit] [470] trunk/ruby-oci8: Use Gem::Command.build_args to get arguments after ' --'.

nobody at rubyforge.org nobody at rubyforge.org
Fri Dec 2 23:33:33 EST 2011


Revision: 470
Author:   kubo
Date:     2011-12-02 23:33:32 -0500 (Fri, 02 Dec 2011)

Log Message:
-----------
Use Gem::Command.build_args to get arguments after '--'.
This may solve issues #4 at http://github.com/kubo/ruby-oci8.

Modified Paths:
--------------
    trunk/ruby-oci8/ChangeLog
    trunk/ruby-oci8/ruby-oci8.gemspec

Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog	2011-12-03 03:47:59 UTC (rev 469)
+++ trunk/ruby-oci8/ChangeLog	2011-12-03 04:33:32 UTC (rev 470)
@@ -1,4 +1,8 @@
 2011-12-03  KUBO Takehiro  <kubo at jiubao.org>
+	* ruby-oci8.gemspec: Use Gem::Command.build_args to get arguments
+	    after '--'. This may solve issues #4 at http://github.com/kubo/ruby-oci8.
+
+2011-12-03  KUBO Takehiro  <kubo at jiubao.org>
 	* ext/oci8/apiwrap.yml: fix for run-time Oracle function checking.
 	* ext/oci8/oraconf.rb: fix a bug not to compile for full client on
 	    Windows. The bug was caused by the commit at 2011-10-17.

Modified: trunk/ruby-oci8/ruby-oci8.gemspec
===================================================================
--- trunk/ruby-oci8/ruby-oci8.gemspec	2011-12-03 03:47:59 UTC (rev 469)
+++ trunk/ruby-oci8/ruby-oci8.gemspec	2011-12-03 04:33:32 UTC (rev 470)
@@ -8,10 +8,17 @@
 #
 require 'fileutils'
 
-if ARGV.size > 3
-   gem_platform = ARGV[3]
+build_args = if (defined? Gem::Command and Gem::Command.respond_to? :build_args)
+               Gem::Command.build_args
+             else
+               # for old rubygems
+               ARGV.include?("--") ? ARGV[(ARGV.index("--") + 1)...ARGV.size] : []
+             end
+
+if build_args.size > 0
+  gem_platform = build_args[0]
 else
-   gem_platform = Gem::Platform::RUBY
+  gem_platform = Gem::Platform::RUBY
 end
 
 spec = Gem::Specification.new do |s|




More information about the ruby-oci8-commit mailing list