diff --git a/Gemfile b/Gemfile index 77900d1..cc46482 100644 --- a/Gemfile +++ b/Gemfile @@ -14,6 +14,7 @@ group :test do gem "mysql2", "~> 0.3.0" gem "pg", "~> 0.9" gem "sqlite3-ruby", "~> 1.3.1" + gem "seamless_database_pool", "~> 1.0.11" end platforms :jruby do @@ -24,7 +25,7 @@ group :test do # Support libs gem "factory_girl", "~> 1.3.3" gem "delorean", "~> 0.2.0" - + # Debugging platforms :mri_18 do gem "ruby-debug", "= 0.10.4" @@ -36,7 +37,6 @@ group :test do end platforms :mri_19 do - # TODO: Remove the conditional when ruby-debug19 supports Ruby >= 1.9.3 - gem "ruby-debug19" if RUBY_VERSION < "1.9.3" + gem "debugger" end end diff --git a/Gemfile.lock b/Gemfile.lock index c1139c6..b3cf6b4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -16,11 +16,17 @@ GEM activesupport (3.2.7) i18n (~> 0.6) multi_json (~> 1.0) - archive-tar-minitar (0.5.2) arel (3.0.2) builder (3.0.0) chronic (0.7.0) columnize (0.3.6) + debugger (1.2.0) + columnize (>= 0.3.1) + debugger-linecache (~> 1.1.1) + debugger-ruby_core_source (~> 1.1.3) + debugger-linecache (1.1.2) + debugger-ruby_core_source (>= 1.1.1) + debugger-ruby_core_source (1.1.3) delorean (0.2.1) chronic factory_girl (1.3.3) @@ -36,8 +42,6 @@ GEM json (1.7.4-java) linecache (0.46) rbx-require-relative (> 0.0.4) - linecache19 (0.5.12) - ruby_core_source (>= 0.1.4) multi_json (1.3.6) mysql (2.8.1) mysql2 (0.3.11) @@ -52,16 +56,8 @@ GEM ruby-debug-base (0.10.4) linecache (>= 0.3) ruby-debug-base (0.10.4-java) - ruby-debug-base19 (0.11.25) - columnize (>= 0.3.1) - linecache19 (>= 0.5.11) - ruby_core_source (>= 0.1.4) - ruby-debug19 (0.11.6) - columnize (>= 0.3.1) - linecache19 (>= 0.5.11) - ruby-debug-base19 (>= 0.11.19) - ruby_core_source (0.1.5) - archive-tar-minitar (>= 0.5.2) + seamless_database_pool (1.0.11) + activerecord (>= 2.2.2) sqlite3 (1.3.6) sqlite3-ruby (1.3.3) sqlite3 (>= 1.3.3) @@ -74,6 +70,7 @@ PLATFORMS DEPENDENCIES activerecord (~> 3.0) activerecord-jdbcmysql-adapter + debugger delorean (~> 0.2.0) factory_girl (~> 1.3.3) jdbc-mysql @@ -84,5 +81,5 @@ DEPENDENCIES rake ruby-debug (= 0.10.4) ruby-debug-base (= 0.10.4) - ruby-debug19 + seamless_database_pool (~> 1.0.11) sqlite3-ruby (~> 1.3.1) diff --git a/Rakefile b/Rakefile index 38f7d17..ff42901 100644 --- a/Rakefile +++ b/Rakefile @@ -36,7 +36,7 @@ namespace :display do end task :default => ["display:notice"] -ADAPTERS = %w(mysql mysql2 jdbcmysql postgresql sqlite3) +ADAPTERS = %w(mysql mysql2 jdbcmysql postgresql sqlite3 seamless_database_pool) ADAPTERS.each do |adapter| namespace :test do desc "Runs #{adapter} database tests." diff --git a/lib/activerecord-import/active_record/adapters/seamless_database_pool_adapter.rb b/lib/activerecord-import/active_record/adapters/seamless_database_pool_adapter.rb new file mode 100644 index 0000000..388c618 --- /dev/null +++ b/lib/activerecord-import/active_record/adapters/seamless_database_pool_adapter.rb @@ -0,0 +1,7 @@ +require "seamless_database_pool" +require "active_record/connection_adapters/seamless_database_pool_adapter" +require "activerecord-import/adapters/mysql_adapter" + +class ActiveRecord::ConnectionAdapters::SeamlessDatabasePoolAdapter + include ActiveRecord::Import::MysqlAdapter +end diff --git a/test/adapters/mysql2.rb b/test/adapters/mysql2.rb index 0ddab79..e67530f 100644 --- a/test/adapters/mysql2.rb +++ b/test/adapters/mysql2.rb @@ -1 +1 @@ -ENV["ARE_DB"] = "mysql2" \ No newline at end of file +ENV["ARE_DB"] = "mysql2" diff --git a/test/adapters/seamless_database_pool.rb b/test/adapters/seamless_database_pool.rb new file mode 100644 index 0000000..1f4a8b3 --- /dev/null +++ b/test/adapters/seamless_database_pool.rb @@ -0,0 +1 @@ +ENV["ARE_DB"] = "seamless_database_pool" diff --git a/test/database.yml.sample b/test/database.yml.sample index 6e0c4ee..6a9a364 100644 --- a/test/database.yml.sample +++ b/test/database.yml.sample @@ -13,6 +13,13 @@ mysql2: <<: *common adapter: mysql2 +seamless_database_pool: + <<: *common + adapter: seamless_database_pool + pool_adapter: mysql2 + master: + host: localhost + postgresql: <<: *common username: postgres