[ruby-oci8-commit] [327] trunk/ruby-oci8: * NEWS: add a new file.

nobody at rubyforge.org nobody at rubyforge.org
Tue Mar 17 11:55:22 EDT 2009


Revision: 327
Author:   kubo
Date:     2009-03-17 11:55:22 -0400 (Tue, 17 Mar 2009)

Log Message:
-----------
* NEWS: add a new file.
* VERSION: change version to 2.0.1.
* Makefile: add targets to make a binary gem for Windows.
* dist-files: add NEWS
* ext/oci8/extconf.rb, lib/oci8.rb.in: rename oci8lib.so
    to oci8lib_18.so and oci8lib_191.so. The renamed name
    depends on the ruby version.
* lib/oci8/datetime.rb: fix the fetched type for date column
    when using Oracle 8.x.
* ruby-oci8.gemspec: fix to make a binary gem which contains
    both oci8lib_18.so and oci8lib_191.so.

Modified Paths:
--------------
    trunk/ruby-oci8/ChangeLog
    trunk/ruby-oci8/Makefile
    trunk/ruby-oci8/VERSION
    trunk/ruby-oci8/dist-files
    trunk/ruby-oci8/ext/oci8/extconf.rb
    trunk/ruby-oci8/lib/oci8/datetime.rb
    trunk/ruby-oci8/lib/oci8.rb.in
    trunk/ruby-oci8/ruby-oci8.gemspec

Added Paths:
-----------
    trunk/ruby-oci8/NEWS

Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog	2009-03-17 15:03:49 UTC (rev 326)
+++ trunk/ruby-oci8/ChangeLog	2009-03-17 15:55:22 UTC (rev 327)
@@ -1,4 +1,17 @@
 2009-03-17  KUBO Takehiro  <kubo at jiubao.org>
+	* NEWS: add a new file.
+	* VERSION: change version to 2.0.1.
+	* Makefile: add targets to make a binary gem for Windows.
+	* dist-files: add NEWS
+	* ext/oci8/extconf.rb, lib/oci8.rb.in: rename oci8lib.so
+	    to oci8lib_18.so and oci8lib_191.so. The renamed name
+	    depends on the ruby version.
+	* lib/oci8/datetime.rb: fix the fetched type for date column
+	    when using Oracle 8.x.
+	* ruby-oci8.gemspec: fix to make a binary gem which contains
+	    both oci8lib_18.so and oci8lib_191.so.
+
+2009-03-17  KUBO Takehiro  <kubo at jiubao.org>
 	* ext/oci8/apiwrap.yml: add prototypes for OCIServerVersion() and
 	    OCIServerRelease().
 	* ext/oci8/oci8.c: (1) add a private method OCI8#oracle_server_vernum,

Modified: trunk/ruby-oci8/Makefile
===================================================================
--- trunk/ruby-oci8/Makefile	2009-03-17 15:03:49 UTC (rev 326)
+++ trunk/ruby-oci8/Makefile	2009-03-17 15:55:22 UTC (rev 327)
@@ -46,3 +46,42 @@
 	cd ruby-oci8-$(VERSION) && $(MAKE) RUBY="$(RUBY)" check
 	cd ruby-oci8-$(VERSION)/src && $(MAKE) RUBY="$(RUBY)" sitearchdir=../work sitelibdir=../work site-install
 	cd ruby-oci8-$(VERSION)/test && $(RUBY) -I../work -I../support test_all.rb
+
+#
+# for Windows
+#
+GEMPKG = ruby-oci8-unstable-2.0.1-x86-mswin32-60.gem
+
+ext\oci8\oci8lib_18.so:
+	c:\ruby\bin\ruby -r fileutils -e "FileUtils.rm_rf('ruby18')"
+	md ruby18
+	cd ruby18
+	c:\ruby\bin\ruby ..\setup.rb config -- --with-runtime-check
+	c:\ruby\bin\ruby ..\setup.rb setup
+	rem c:\ruby\bin\ruby ..\setup.rb test
+	cd ..
+	copy ruby18\ext\oci8\oci8lib_18.so ext\oci8\oci8lib_18.so
+
+ext\oci8\oci8lib_191.so:
+	c:\ruby\bin\ruby -r fileutils -e "FileUtils.rm_rf('ruby191')"
+	md ruby191
+	cd ruby191
+	c:\ruby-1.9.1\bin\ruby ..\setup.rb config -- --with-runtime-check
+	c:\ruby-1.9.1\bin\ruby ..\setup.rb setup
+	rem c:\ruby-1.9.1\bin\ruby ..\setup.rb test
+	cd ..
+	copy ruby191\ext\oci8\oci8lib_191.so ext\oci8\oci8lib_191.so
+	copy ruby191\lib\oci8.rb lib\oci8.rb
+
+$(GEMPKG): ext\oci8\oci8lib_18.so ext\oci8\oci8lib_191.so ruby-oci8.gemspec
+	c:\ruby-1.9.1\bin\gem build ruby-oci8.gemspec -- current
+
+test-win32-ruby18: $(GEMPKG)
+	c:\ruby\bin\gem install $(GEMPKG) --no-rdoc --no-ri
+	c:\ruby\bin\ruby -rubygems test\test_all.rb
+
+test-win32-ruby191: $(GEMPKG)
+	c:\ruby-1.9.1\bin\gem install $(GEMPKG) --no-rdoc --no-ri
+	c:\ruby-1.9.1\bin\ruby test\test_all.rb
+
+test-win32: test-win32-ruby18 test-win32-ruby191

Added: trunk/ruby-oci8/NEWS
===================================================================
--- trunk/ruby-oci8/NEWS	                        (rev 0)
+++ trunk/ruby-oci8/NEWS	2009-03-17 15:55:22 UTC (rev 327)
@@ -0,0 +1,6 @@
+2.0.1:
+
+* release a binary gem for Windows, which contains libraries for both
+  ruby 1.8 and ruby 1.9.1.
+* add OCI8#oracle_server_version.
+* fix bugs when fetching and binding time objects.

Modified: trunk/ruby-oci8/VERSION
===================================================================
--- trunk/ruby-oci8/VERSION	2009-03-17 15:03:49 UTC (rev 326)
+++ trunk/ruby-oci8/VERSION	2009-03-17 15:55:22 UTC (rev 327)
@@ -1 +1 @@
-2.0.0
+2.0.1

Modified: trunk/ruby-oci8/dist-files
===================================================================
--- trunk/ruby-oci8/dist-files	2009-03-17 15:03:49 UTC (rev 326)
+++ trunk/ruby-oci8/dist-files	2009-03-17 15:55:22 UTC (rev 327)
@@ -1,5 +1,6 @@
 ChangeLog
 Makefile
+NEWS
 README
 VERSION
 dist-files

Modified: trunk/ruby-oci8/ext/oci8/extconf.rb
===================================================================
--- trunk/ruby-oci8/ext/oci8/extconf.rb	2009-03-17 15:03:49 UTC (rev 326)
+++ trunk/ruby-oci8/ext/oci8/extconf.rb	2009-03-17 15:55:22 UTC (rev 327)
@@ -113,6 +113,16 @@
 # make ruby script before running create_makefile.
 replace_keyword(File.dirname(__FILE__) + '/../../lib/oci8.rb.in', '../../lib/oci8.rb', replace)
 
+case RUBY_VERSION
+when /^1\.9\.1/
+  so_basename = "oci8lib_191"
+when /^1\.8/
+  so_basename = "oci8lib_18"
+else
+  raise 'unsupported ruby version: ' + RUBY_VERSION
+end
+$defs << "-DInit_oci8lib=Init_#{so_basename}"
+
 create_header()
 
 # make dependency file
@@ -140,6 +150,6 @@
 
 create_apiwrap()
 
-create_makefile("oci8lib")
+create_makefile(so_basename)
 
 exit 0

Modified: trunk/ruby-oci8/lib/oci8/datetime.rb
===================================================================
--- trunk/ruby-oci8/lib/oci8/datetime.rb	2009-03-17 15:03:49 UTC (rev 326)
+++ trunk/ruby-oci8/lib/oci8/datetime.rb	2009-03-17 15:55:22 UTC (rev 327)
@@ -113,7 +113,7 @@
         year, month, day, hour, minute, sec = ary
         if year >= 139
           begin
-            ::Time.send(@@default_timezone, year, month, day, hour, minute, sec)
+            return ::Time.send(@@default_timezone, year, month, day, hour, minute, sec)
           rescue StandardError
           end
         end

Modified: trunk/ruby-oci8/lib/oci8.rb.in
===================================================================
--- trunk/ruby-oci8/lib/oci8.rb.in	2009-03-17 15:03:49 UTC (rev 326)
+++ trunk/ruby-oci8/lib/oci8.rb.in	2009-03-17 15:55:22 UTC (rev 327)
@@ -18,7 +18,14 @@
   end
 end
 
-require 'oci8lib'
+case RUBY_VERSION
+when /^1\.9\.1/
+  require 'oci8lib_191'
+when /^1\.8/
+  require 'oci8lib_18'
+else
+  raise 'unsupported ruby version: ' + RUBY_VERSION
+end
 
 if OCI8.respond_to? :encoding
   if defined? DEFAULT_OCI8_ENCODING

Modified: trunk/ruby-oci8/ruby-oci8.gemspec
===================================================================
--- trunk/ruby-oci8/ruby-oci8.gemspec	2009-03-17 15:03:49 UTC (rev 326)
+++ trunk/ruby-oci8/ruby-oci8.gemspec	2009-03-17 15:55:22 UTC (rev 327)
@@ -6,6 +6,7 @@
 # To make a binary gems package:
 #   gem build ruby-oci8.gemspec -- current
 #
+require 'fileutils'
 
 if ARGV.size > 3
    gem_platform = ARGV[3]
@@ -28,27 +29,35 @@
   s.platform = gem_platform
   files = File.read('dist-files').split("\n")
   if gem_platform == Gem::Platform::RUBY
-    s.require_paths = ['lib']
     s.extensions << 'ext/oci8/extconf.rb'
     s.required_ruby_version = '>= 1.8.0'
   else
-    s.require_paths = ['lib', 'ext/oci8']
-    if RUBY_VERSION =~ /^1\.9\./
+    so_files = Dir.glob('ext/oci8/oci8lib_*.so')
+    has_1_8 = so_files.include? 'ext/oci8/oci8lib_18.so'
+    has_1_9_1 = so_files.include? 'ext/oci8/oci8lib_191.so'
+    if has_1_8 and has_1_9_1
+      puts 'Binary gem for ruby 1.8 and 1.9.1'
+      s.required_ruby_version = '>= 1.8.0'
+    elsif has_1_8 and !has_1_9_1
+      puts 'Binary gem for ruby 1.8'
+      s.required_ruby_version = '~> 1.8.0'
+    elsif !has_1_8 and has_1_9_1
+      puts 'Binary gem for ruby 1.9.1'
       s.required_ruby_version = '~> 1.9.1'
     else
-      s.required_ruby_version = '~> 1.8.0'
+      raise "No compiled binary are found. Run make in advance."
     end
-    # check files created by a make command.
-    ['ext/oci8/oci8lib.so', 'lib/oci8.rb'].each do |file|
-      raise <<EOS unless File.exist?(file)
-#{file} doesn't exist. Run make in advance.
-EOS
-      #'
-      files << file
+    FileUtils.copy so_files, 'lib', :preserve => true
+    files.reject! do |fname|
+      fname =~ /^ext/
     end
+    so_files.each do |fname|
+      files << 'lib/' + File.basename(fname)
+    end
+    files << 'lib/oci8.rb'
   end
   s.files = files
   s.test_files = 'test/test_all.rb'
-  s.rdoc_options = ['--main', 'README', '--exclude', 'ext/*']
+  s.rdoc_options = ['--main', 'README']
   s.extra_rdoc_files = ['README']
 end




More information about the ruby-oci8-commit mailing list