[ruby-oci8-commit] [460] trunk/ruby-oci8: use RbConfig::CONFIG instead of obsolete Config:: CONFIG.

nobody at rubyforge.org nobody at rubyforge.org
Sat Oct 29 07:57:00 EDT 2011


Revision: 460
Author:   kubo
Date:     2011-10-29 07:57:00 -0400 (Sat, 29 Oct 2011)

Log Message:
-----------
use RbConfig::CONFIG instead of obsolete Config::CONFIG.

Modified Paths:
--------------
    trunk/ruby-oci8/ChangeLog
    trunk/ruby-oci8/ext/oci8/oraconf.rb

Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog	2011-10-22 13:32:49 UTC (rev 459)
+++ trunk/ruby-oci8/ChangeLog	2011-10-29 11:57:00 UTC (rev 460)
@@ -1,3 +1,7 @@
+2011-10-29  KUBO Takehiro  <kubo at jiubao.org>
+	* ext/oci8/oraconf.rb: use RbConfig::CONFIG instead of obsolete
+	    Config::CONFIG.
+
 2011-10-22  KUBO Takehiro  <kubo at jiubao.org>
 	* ext/oci8/attr.c, ext/oci8/bind.c, ext/oci8/connection_pool.c,
 	  ext/oci8/error.c, ext/oci8/lob.c, ext/oci8/metadata.c,

Modified: trunk/ruby-oci8/ext/oci8/oraconf.rb
===================================================================
--- trunk/ruby-oci8/ext/oci8/oraconf.rb	2011-10-22 13:32:49 UTC (rev 459)
+++ trunk/ruby-oci8/ext/oci8/oraconf.rb	2011-10-29 11:57:00 UTC (rev 460)
@@ -1,36 +1,8 @@
 require 'mkmf'
 
-unless defined? macro_defined?
-  # ruby 1.6 doesn't have 'macro_defined?'.
-  def macro_defined?(macro, src, opt="")
-    try_cpp(src + <<"SRC", opt)
-#ifndef #{macro}
-# error
-#endif
-SRC
-  end
-end
+# compatibility for ruby-1.9
+RbConfig = Config unless defined? RbConfig
 
-module Logging
-  unless Logging.respond_to?(:open)
-    # emulate Logging::open of ruby 1.6.8 or later.
-
-    if $log.nil? # ruby 1.6.2 doesn't have $log.
-      $log = open('mkmf.log', 'w')
-    end
-    def Logging::open
-      begin
-        $stderr.reopen($log)
-        $stdout.reopen($log)
-        yield
-      ensure
-        $stderr.reopen($orgerr)
-        $stdout.reopen($orgout)
-      end
-    end
-  end
-end # module Logging
-
 module MiniRegistry
   class MiniRegistryError < StandardError
     attr_reader :api_name
@@ -635,20 +607,20 @@
   def check_ruby_header
     print "checking for ruby header... "
     STDOUT.flush
-    rubyhdrdir = Config::CONFIG["rubyhdrdir"] || Config::CONFIG['archdir']
+    rubyhdrdir = RbConfig::CONFIG["rubyhdrdir"] || RbConfig::CONFIG['archdir']
     unless File.exist?(rubyhdrdir + '/ruby.h')
       puts "ng"
-      if RUBY_PLATFORM =~ /darwin/ and File.exist?("#{Config::CONFIG['archdir']}/../universal-darwin8.0/ruby.h")
+      if RUBY_PLATFORM =~ /darwin/ and File.exist?("#{RbConfig::CONFIG['archdir']}/../universal-darwin8.0/ruby.h")
         raise <<EOS
-#{Config::CONFIG['archdir']}/ruby.h doesn't exist.
+#{RbConfig::CONFIG['archdir']}/ruby.h doesn't exist.
 Run the following commands to fix the problem.
 
-  cd #{Config::CONFIG['archdir']}
+  cd #{RbConfig::CONFIG['archdir']}
   sudo ln -s ../universal-darwin8.0/* ./
 EOS
       else
         raise <<EOS
-#{Config::CONFIG['archdir']}/ruby.h doesn't exist.
+#{RbConfig::CONFIG['archdir']}/ruby.h doesn't exist.
 Install the ruby development library.
 EOS
       end
@@ -1127,7 +1099,7 @@
     export RC_ARCHS
 
 If it does not fix the problem, delete all '-arch #{missing_arch}'
-in '#{Config::CONFIG['archdir']}/rbconfig.rb'.
+in '#{RbConfig::CONFIG['archdir']}/rbconfig.rb'.
 EOS
           end
         end




More information about the ruby-oci8-commit mailing list