do_postgres 0.10.0-java → 0.10.1-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. data/ChangeLog.markdown +22 -0
  2. data/LICENSE +1 -1
  3. data/README.markdown +106 -3
  4. data/Rakefile +56 -9
  5. data/ext/do_postgres/compat.h +55 -0
  6. data/ext/do_postgres/do_postgres.c +1060 -0
  7. data/ext/do_postgres/error.h +483 -0
  8. data/ext/do_postgres/extconf.rb +43 -0
  9. data/ext/do_postgres/pg_config.h +689 -0
  10. data/lib/do_postgres.rb +12 -16
  11. data/lib/do_postgres/do_postgres.jar +0 -0
  12. data/lib/do_postgres/version.rb +1 -1
  13. data/spec/command_spec.rb +2 -2
  14. data/spec/connection_spec.rb +22 -7
  15. data/spec/encoding_spec.rb +2 -1
  16. data/spec/reader_spec.rb +1 -1
  17. data/spec/result_spec.rb +12 -13
  18. data/spec/spec_helper.rb +27 -36
  19. data/spec/typecast/array_spec.rb +1 -1
  20. data/spec/typecast/bigdecimal_spec.rb +2 -2
  21. data/spec/typecast/boolean_spec.rb +2 -2
  22. data/spec/typecast/byte_array_spec.rb +1 -1
  23. data/spec/typecast/class_spec.rb +1 -1
  24. data/spec/typecast/date_spec.rb +2 -2
  25. data/spec/typecast/datetime_spec.rb +2 -2
  26. data/spec/typecast/float_spec.rb +2 -2
  27. data/spec/typecast/integer_spec.rb +1 -1
  28. data/spec/typecast/nil_spec.rb +3 -3
  29. data/spec/typecast/other_spec.rb +8 -0
  30. data/spec/typecast/range_spec.rb +1 -1
  31. data/spec/typecast/string_spec.rb +1 -1
  32. data/spec/typecast/time_spec.rb +1 -1
  33. data/tasks/compile.rake +81 -0
  34. data/tasks/release.rake +12 -71
  35. data/tasks/retrieve.rake +5 -9
  36. data/tasks/spec.rake +19 -15
  37. metadata +120 -107
  38. data/HISTORY.markdown +0 -12
  39. data/Manifest.txt +0 -34
  40. data/lib/do_postgres_ext.jar +0 -0
  41. data/spec/lib/rspec_immediate_feedback_formatter.rb +0 -3
  42. data/tasks/gem.rake +0 -8
  43. data/tasks/install.rake +0 -15
  44. data/tasks/native.rake +0 -35
data/lib/do_postgres.rb CHANGED
@@ -17,21 +17,17 @@ if RUBY_PLATFORM =~ /java/
17
17
 
18
18
  end
19
19
 
20
- require 'do_postgres_ext'
21
- require 'do_postgres/version'
22
- require 'do_postgres/transaction'
23
- require 'do_postgres/encoding'
24
-
25
- if RUBY_PLATFORM =~ /java/
26
-
27
- module DataObjects
28
- module Postgres
29
- class Connection
30
- def self.pool_size
31
- 20
32
- end
33
- end
34
- end
20
+ begin
21
+ require 'do_postgres/do_postgres'
22
+ rescue LoadError
23
+ if RUBY_PLATFORM =~ /mingw|mswin/ then
24
+ RUBY_VERSION =~ /(\d+.\d+)/
25
+ require "do_postgres/#{$1}/do_postgres"
26
+ else
27
+ raise
35
28
  end
36
-
37
29
  end
30
+
31
+ require 'do_postgres/version'
32
+ require 'do_postgres/transaction' if RUBY_PLATFORM !~ /java/
33
+ require 'do_postgres/encoding'
Binary file
@@ -1,5 +1,5 @@
1
1
  module DataObjects
2
2
  module Postgres
3
- VERSION = "0.10.0"
3
+ VERSION = '0.10.1'.freeze
4
4
  end
5
5
  end
data/spec/command_spec.rb CHANGED
@@ -4,6 +4,6 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
4
4
  require 'data_objects/spec/command_spec'
5
5
 
6
6
  describe DataObjects::Postgres::Command do
7
- it_should_behave_like 'a Command'
8
- it_should_behave_like 'a Command with async'
7
+ behaves_like 'a Command'
8
+ behaves_like 'a Command with async'
9
9
  end
@@ -5,15 +5,30 @@ require 'data_objects/spec/connection_spec'
5
5
 
6
6
  describe DataObjects::Postgres::Connection do
7
7
 
8
- before :all do
9
- @driver = CONFIG.scheme
10
- @user = CONFIG.user
8
+ before do
9
+ @driver = CONFIG.scheme
10
+ @user = CONFIG.user
11
11
  @password = CONFIG.pass
12
- @host = CONFIG.host
13
- @port = CONFIG.port
12
+ @host = CONFIG.host
13
+ @port = CONFIG.port
14
14
  @database = CONFIG.database
15
15
  end
16
16
 
17
- it_should_behave_like 'a Connection'
18
- it_should_behave_like 'a Connection with authentication support'
17
+ behaves_like 'a Connection'
18
+ behaves_like 'a Connection with authentication support'
19
+ # FIXME: behaves_like 'a Connection with JDBC URL support' if JRUBY
20
+
21
+ describe 'byte array quoting' do
22
+ it 'should properly escape non-printable ASCII characters' do
23
+ @connection.quote_byte_array("\001").should.match(/'\\?\\001'/)
24
+ end
25
+
26
+ it 'should properly escape bytes with the high bit set' do
27
+ @connection.quote_byte_array("\210").should.match(/'\\?\\210'/)
28
+ end
29
+
30
+ it 'should not escape printable ASCII characters' do
31
+ @connection.quote_byte_array("a").should == "'a'"
32
+ end
33
+ end
19
34
  end
@@ -14,6 +14,7 @@ describe DataObjects::Postgres::Connection do
14
14
  # handles setting the internal client_encoding setting appropriately. It
15
15
  # can be overridden -- but for now, we won't support doing this.
16
16
  #
17
- it_should_behave_like 'a driver supporting encodings'
17
+ behaves_like 'a driver supporting different encodings'
18
+ behaves_like 'returning correctly encoded strings for the default encoding'
18
19
  end
19
20
  end
data/spec/reader_spec.rb CHANGED
@@ -4,5 +4,5 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
4
4
  require 'data_objects/spec/reader_spec'
5
5
 
6
6
  describe DataObjects::Postgres::Reader do
7
- it_should_behave_like 'a Reader'
7
+ behaves_like 'a Reader'
8
8
  end
data/spec/result_spec.rb CHANGED
@@ -4,24 +4,24 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
4
4
  require 'data_objects/spec/result_spec'
5
5
 
6
6
  describe DataObjects::Postgres::Result do
7
- it_should_behave_like 'a Result'
7
+ behaves_like 'a Result'
8
8
 
9
- before :all do
9
+ after do
10
10
  setup_test_environment
11
11
  end
12
12
 
13
13
  describe 'without using RETURNING' do
14
14
 
15
- before :each do
15
+ before do
16
16
  @connection = DataObjects::Connection.new(CONFIG.uri)
17
17
  @result = @connection.create_command("INSERT INTO users (name) VALUES (?)").execute_non_query("monkey")
18
18
  end
19
19
 
20
- after :each do
20
+ after do
21
21
  @connection.close
22
22
  end
23
23
 
24
- it { @result.should respond_to(:affected_rows) }
24
+ it 'should respond to #affected_rows' do @result.should.respond_to(:affected_rows) end
25
25
 
26
26
  describe 'affected_rows' do
27
27
 
@@ -31,19 +31,18 @@ describe DataObjects::Postgres::Result do
31
31
 
32
32
  end
33
33
 
34
- it { @result.should respond_to(:insert_id) }
34
+ it 'should respond to #insert_id' do @result.should.respond_to(:insert_id) end
35
35
 
36
36
  describe 'insert_id' do
37
37
 
38
38
  it 'should return nil' do
39
- @result.insert_id.should be_nil
39
+ @result.insert_id.should.be.nil
40
40
  end
41
41
 
42
42
  it 'should be retrievable through curr_val' do
43
- # This is actually the 4th record inserted
44
43
  reader = @connection.create_command("SELECT currval('users_id_seq')").execute_reader
45
44
  reader.next!
46
- reader.values.first.should == 4
45
+ reader.values.first.should == 2
47
46
  end
48
47
 
49
48
  end
@@ -52,16 +51,16 @@ describe DataObjects::Postgres::Result do
52
51
 
53
52
  describe 'when using RETURNING' do
54
53
 
55
- before :each do
54
+ before do
56
55
  @connection = DataObjects::Connection.new(CONFIG.uri)
57
56
  @result = @connection.create_command("INSERT INTO users (name) VALUES (?) RETURNING id").execute_non_query("monkey")
58
57
  end
59
58
 
60
- after :each do
59
+ after do
61
60
  @connection.close
62
61
  end
63
62
 
64
- it { @result.should respond_to(:affected_rows) }
63
+ it 'should respond to #affected_rows' do @result.should.respond_to(:affected_rows) end
65
64
 
66
65
  describe 'affected_rows' do
67
66
 
@@ -71,7 +70,7 @@ describe DataObjects::Postgres::Result do
71
70
 
72
71
  end
73
72
 
74
- it { @result.should respond_to(:insert_id) }
73
+ it 'should respond to #insert_id' do @result.should.respond_to(:insert_id) end
75
74
 
76
75
  describe 'insert_id' do
77
76
 
data/spec/spec_helper.rb CHANGED
@@ -2,55 +2,44 @@ $TESTING=true
2
2
  JRUBY = RUBY_PLATFORM =~ /java/
3
3
 
4
4
  require 'rubygems'
5
-
6
- gem 'rspec', '>1.1.12'
7
- require 'spec'
8
-
9
5
  require 'date'
10
6
  require 'ostruct'
11
- require 'pathname'
12
7
  require 'fileutils'
8
+ require 'win32console' if RUBY_PLATFORM =~ /mingw|mswin/
9
+
10
+ driver_lib = File.expand_path('../../lib', __FILE__)
11
+ $LOAD_PATH.unshift(driver_lib) unless $LOAD_PATH.include?(driver_lib)
13
12
 
14
- dir = File.dirname(__FILE__)
15
- lib_path = File.expand_path("#{dir}/../lib")
16
- $LOAD_PATH.unshift lib_path unless $LOAD_PATH.include?(lib_path)
17
- # put data_objects from repository in the load path
18
- # DO NOT USE installed gem of data_objects!
19
- do_lib_path = File.expand_path("#{dir}/../../data_objects/lib")
20
- $LOAD_PATH.unshift do_lib_path unless $LOAD_PATH.include?(do_lib_path)
21
-
22
- if JRUBY
23
- jdbc_lib_path = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'do_jdbc', 'lib'))
24
- $LOAD_PATH.unshift jdbc_lib_path unless $LOAD_PATH.include?(jdbc_lib_path)
25
- require 'do_jdbc'
13
+ # Prepend data_objects/do_jdbc in the repository to the load path.
14
+ # DO NOT USE installed gems, except when running the specs from gem.
15
+ repo_root = File.expand_path('../../..', __FILE__)
16
+ (['data_objects'] << ('do_jdbc' if JRUBY)).compact.each do |lib|
17
+ lib_path = "#{repo_root}/#{lib}/lib"
18
+ $LOAD_PATH.unshift(lib_path) if File.directory?(lib_path) && !$LOAD_PATH.include?(lib_path)
26
19
  end
27
20
 
28
21
  require 'data_objects'
29
-
30
- DATAOBJECTS_SPEC_ROOT = Pathname(__FILE__).dirname.parent.parent + 'data_objects' + 'spec'
31
- Pathname.glob((DATAOBJECTS_SPEC_ROOT + 'lib/**/*.rb').to_s).each { |f| require f }
22
+ require 'data_objects/spec/bacon'
32
23
  require 'do_postgres'
33
24
 
34
- log_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'log', 'do.log'))
35
- FileUtils.mkdir_p(File.dirname(log_path))
36
-
37
- DataObjects::Postgres.logger = DataObjects::Logger.new(log_path, :debug)
38
-
25
+ DataObjects::Postgres.logger = DataObjects::Logger.new(STDOUT, :off)
39
26
  at_exit { DataObjects.logger.flush }
40
27
 
41
- Spec::Runner.configure do |config|
42
- config.include(DataObjects::Spec::PendingHelpers)
28
+ CONFIG = OpenStruct.new
29
+ CONFIG.scheme = 'postgres'
30
+ CONFIG.user = ENV['DO_POSTGRES_USER'] || 'postgres'
31
+ CONFIG.pass = ENV['DO_POSTGRES_PASS'] || ''
32
+ CONFIG.user_info = unless CONFIG.pass.empty?
33
+ "#{CONFIG.user}:#{CONFIG.pass}@"
34
+ else
35
+ "#{CONFIG.user}@"
43
36
  end
37
+ CONFIG.host = ENV['DO_POSTGRES_HOST'] || 'localhost'
38
+ CONFIG.port = ENV['DO_POSTGRES_PORT'] || '5432'
39
+ CONFIG.database = ENV['DO_POSTGRES_DATABASE'] || '/do_test'
44
40
 
45
- CONFIG = OpenStruct.new
46
- CONFIG.scheme = 'postgres'
47
- CONFIG.user = ENV['DO_POSTGRES_USER'] || 'postgres'
48
- CONFIG.pass = ENV['DO_POSTGRES_PASS'] || ''
49
- CONFIG.host = ENV['DO_POSTGRES_HOST'] || 'localhost'
50
- CONFIG.port = ENV['DO_POSTGRES_PORT'] || '5432'
51
- CONFIG.database = ENV['DO_POSTGRES_DATABASE'] || '/do_test'
52
-
53
- CONFIG.uri = ENV["DO_POSTGRES_SPEC_URI"] ||"#{CONFIG.scheme}://#{CONFIG.user}:#{CONFIG.pass}@#{CONFIG.host}:#{CONFIG.port}#{CONFIG.database}"
41
+ CONFIG.uri = ENV["DO_POSTGRES_SPEC_URI"] ||"#{CONFIG.scheme}://#{CONFIG.user_info}#{CONFIG.host}:#{CONFIG.port}#{CONFIG.database}"
42
+ CONFIG.jdbc_uri = CONFIG.uri.sub(/postgres/,"jdbc:postgresql")
54
43
  CONFIG.sleep = "SELECT pg_sleep(1)"
55
44
 
56
45
  module DataObjectsSpecHelpers
@@ -156,3 +145,5 @@ module DataObjectsSpecHelpers
156
145
  end
157
146
 
158
147
  end
148
+
149
+ include DataObjectsSpecHelpers
@@ -4,5 +4,5 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
4
  require 'data_objects/spec/typecast/array_spec'
5
5
 
6
6
  describe 'DataObjects::Postgres with Array' do
7
- it_should_behave_like 'supporting Array'
7
+ behaves_like 'supporting Array'
8
8
  end
@@ -4,6 +4,6 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
4
  require 'data_objects/spec/typecast/bigdecimal_spec'
5
5
 
6
6
  describe 'DataObjects::Postgres with BigDecimal' do
7
- it_should_behave_like 'supporting BigDecimal'
8
- it_should_behave_like 'supporting BigDecimal autocasting'
7
+ behaves_like 'supporting BigDecimal'
8
+ behaves_like 'supporting BigDecimal autocasting'
9
9
  end
@@ -4,6 +4,6 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
4
  require 'data_objects/spec/typecast/boolean_spec'
5
5
 
6
6
  describe 'DataObjects::Postgres with Boolean' do
7
- it_should_behave_like 'supporting Boolean'
8
- it_should_behave_like 'supporting Boolean autocasting'
7
+ behaves_like 'supporting Boolean'
8
+ behaves_like 'supporting Boolean autocasting'
9
9
  end
@@ -4,5 +4,5 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
4
  require 'data_objects/spec/typecast/byte_array_spec'
5
5
 
6
6
  describe 'DataObjects::Postgres with ByteArray' do
7
- it_should_behave_like 'supporting ByteArray'
7
+ behaves_like 'supporting ByteArray'
8
8
  end
@@ -4,5 +4,5 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
4
  require 'data_objects/spec/typecast/class_spec'
5
5
 
6
6
  describe 'DataObjects::Postgres with Class' do
7
- it_should_behave_like 'supporting Class'
7
+ behaves_like 'supporting Class'
8
8
  end
@@ -4,6 +4,6 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
4
  require 'data_objects/spec/typecast/date_spec'
5
5
 
6
6
  describe 'DataObjects::Postgres with Date' do
7
- it_should_behave_like 'supporting Date'
8
- it_should_behave_like 'supporting Date autocasting'
7
+ behaves_like 'supporting Date'
8
+ behaves_like 'supporting Date autocasting'
9
9
  end
@@ -4,6 +4,6 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
4
  require 'data_objects/spec/typecast/datetime_spec'
5
5
 
6
6
  describe 'DataObjects::Postgres with DateTime' do
7
- it_should_behave_like 'supporting DateTime'
8
- it_should_behave_like 'supporting DateTime autocasting'
7
+ behaves_like 'supporting DateTime'
8
+ behaves_like 'supporting DateTime autocasting'
9
9
  end
@@ -4,6 +4,6 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
4
  require 'data_objects/spec/typecast/float_spec'
5
5
 
6
6
  describe 'DataObjects::Postgres with Float' do
7
- it_should_behave_like 'supporting Float'
8
- it_should_behave_like 'supporting Float autocasting'
7
+ behaves_like 'supporting Float'
8
+ behaves_like 'supporting Float autocasting'
9
9
  end
@@ -4,5 +4,5 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
4
  require 'data_objects/spec/typecast/integer_spec'
5
5
 
6
6
  describe 'DataObjects::Postgres with Integer' do
7
- it_should_behave_like 'supporting Integer'
7
+ behaves_like 'supporting Integer'
8
8
  end
@@ -4,7 +4,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
4
  require 'data_objects/spec/typecast/nil_spec'
5
5
 
6
6
  describe 'DataObjects::Postgres with Nil' do
7
- it_should_behave_like 'supporting Nil'
8
- # it_should_behave_like 'supporting writing an Nil'
9
- it_should_behave_like 'supporting Nil autocasting'
7
+ behaves_like 'supporting Nil'
8
+ # behaves_like 'supporting writing an Nil'
9
+ behaves_like 'supporting Nil autocasting'
10
10
  end
@@ -0,0 +1,8 @@
1
+ # encoding: utf-8
2
+
3
+ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
+ require 'data_objects/spec/typecast/other_spec'
5
+
6
+ describe 'DataObjects::H2 with other (unknown) type' do
7
+ behaves_like 'supporting other (unknown) type'
8
+ end
@@ -4,5 +4,5 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
4
  require 'data_objects/spec/typecast/range_spec'
5
5
 
6
6
  describe 'DataObjects::Postgres with Range' do
7
- it_should_behave_like 'supporting Range'
7
+ behaves_like 'supporting Range'
8
8
  end
@@ -4,5 +4,5 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
4
  require 'data_objects/spec/typecast/string_spec'
5
5
 
6
6
  describe 'DataObjects::Postgres with String' do
7
- it_should_behave_like 'supporting String'
7
+ behaves_like 'supporting String'
8
8
  end
@@ -4,5 +4,5 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
4
  require 'data_objects/spec/typecast/time_spec'
5
5
 
6
6
  describe 'DataObjects::Postgres with Time' do
7
- it_should_behave_like 'supporting Time'
7
+ behaves_like 'supporting Time'
8
8
  end
@@ -0,0 +1,81 @@
1
+ begin
2
+ gem 'rake-compiler', '~>0.7'
3
+ require 'rake/extensiontask'
4
+ require 'rake/javaextensiontask'
5
+
6
+ # Hack to avoid "allocator undefined for Proc" issue when unpacking Gems:
7
+ # gemspec provided by Jeweler uses Rake::FileList for files, test_files and
8
+ # extra_rdoc_files, and procs cannot be marshalled.
9
+ def gemspec
10
+ @clean_gemspec ||= eval("#{Rake.application.jeweler.gemspec.to_ruby}") # $SAFE = 3\n
11
+ end
12
+
13
+ Rake::ExtensionTask.new('do_postgres', gemspec) do |ext|
14
+
15
+ postgres_lib = File.expand_path(File.join(File.dirname(__FILE__), '..', 'vendor', 'pgsql'))
16
+
17
+ ext.lib_dir = "lib/#{gemspec.name}"
18
+
19
+ # automatically add build options to avoid need of manual input
20
+ if RUBY_PLATFORM =~ /mswin|mingw/ then
21
+ ext.config_options << "--with-pgsql-server-include=#{postgres_lib}/include/server"
22
+ ext.config_options << "--with-pgsql-client-include=#{postgres_lib}/include"
23
+ ext.config_options << "--with-pgsql-win32-include=#{postgres_lib}/include/server/port/win32"
24
+ ext.config_options << "--with-pgsql-client-lib=#{postgres_lib}/lib"
25
+ else
26
+ ext.cross_compile = true
27
+ ext.cross_platform = ['x86-mingw32', 'x86-mswin32-60']
28
+ ext.cross_config_options << "--with-pgsql-server-include=#{postgres_lib}/include/server"
29
+ ext.cross_config_options << "--with-pgsql-client-include=#{postgres_lib}/include"
30
+ ext.cross_config_options << "--with-pgsql-win32-include=#{postgres_lib}/include/server/port/win32"
31
+ ext.cross_config_options << "--with-pgsql-client-lib=#{postgres_lib}/lib"
32
+
33
+ ext.cross_compiling do |gemspec|
34
+ gemspec.post_install_message = <<-POST_INSTALL_MESSAGE
35
+
36
+ ======================================================================================================
37
+
38
+ You've installed the binary version of #{gemspec.name}.
39
+ It was built using PostgreSQL version #{BINARY_VERSION}.
40
+ It's recommended to use the exact same version to avoid potential issues.
41
+
42
+ At the time of building this gem, the necessary DLL files where available
43
+ in the following download:
44
+
45
+ http://wwwmaster.postgresql.org/redir/107/h/binary/v#{BINARY_VERSION}/win32/postgresql-#{BINARY_VERSION}-1-binaries-no-installer.zip
46
+
47
+ You can put the following files available in this package in your Ruby bin
48
+ directory, for example C:\\Ruby\\bin
49
+
50
+ - lib\\libpq.dll
51
+ - bin\\ssleay32.dll
52
+ - bin\\libeay32.dll
53
+ - bin\\libintl-8.dll
54
+ - bin\\libiconv-2.dll
55
+ - bin\\krb5_32.dll
56
+ - bin\\comerr32.dll
57
+ - bin\\k5sprt32.dll
58
+ - bin\\gssapi32.dll
59
+
60
+ ======================================================================================================
61
+
62
+ POST_INSTALL_MESSAGE
63
+ end
64
+
65
+ end
66
+
67
+ end
68
+
69
+ Rake::JavaExtensionTask.new('do_postgres', gemspec) do |ext|
70
+ ext.ext_dir = 'ext-java/src/main/java'
71
+ ext.lib_dir = "lib/#{gemspec.name}"
72
+ ext.debug = ENV.has_key?('DO_JAVA_DEBUG') && ENV['DO_JAVA_DEBUG']
73
+ ext.classpath = '../do_jdbc/lib/do_jdbc_internal.jar'
74
+ ext.java_compiling do |gem|
75
+ gem.add_dependency 'jdbc-postgres', '>=8.2'
76
+ gem.add_dependency 'do_jdbc', '0.10.1'
77
+ end
78
+ end
79
+ rescue LoadError
80
+ warn "To compile, install rake-compiler (gem install rake-compiler)"
81
+ end