seamless_database_pool 1.0.7 → 1.0.8
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.
data/Rakefile
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'rake'
|
3
|
-
require 'rake/rdoctask'
|
4
3
|
require 'yaml'
|
5
4
|
|
6
5
|
desc 'Default: run unit tests.'
|
@@ -61,14 +60,6 @@ rescue LoadError
|
|
61
60
|
end
|
62
61
|
end
|
63
62
|
|
64
|
-
desc 'Generate documentation for seamless_database_pool.'
|
65
|
-
Rake::RDocTask.new(:rdoc) do |rdoc|
|
66
|
-
rdoc.rdoc_dir = 'rdoc'
|
67
|
-
rdoc.options << '--title' << 'Seamless Database Pool' << '--line-numbers' << '--inline-source' << '--main' << 'README.rdoc'
|
68
|
-
rdoc.rdoc_files.include('README.rdoc')
|
69
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
70
|
-
end
|
71
|
-
|
72
63
|
begin
|
73
64
|
require 'jeweler'
|
74
65
|
Jeweler::Tasks.new do |gem|
|
@@ -77,7 +68,7 @@ begin
|
|
77
68
|
gem.email = "brian@embellishedvisions.com"
|
78
69
|
gem.homepage = "http://github.com/bdurand/seamless_database_pool"
|
79
70
|
gem.authors = ["Brian Durand"]
|
80
|
-
gem.files = FileList["lib/**/*", "spec/**/*", "README.rdoc", "Rakefile"].to_a
|
71
|
+
gem.files = FileList["lib/**/*", "spec/**/*", "README.rdoc", "Rakefile", "MIT-LICENSE"].to_a
|
81
72
|
gem.has_rdoc = true
|
82
73
|
gem.extra_rdoc_files = ["README.rdoc", "MIT-LICENSE"]
|
83
74
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require 'spec_helper'
|
2
2
|
|
3
3
|
describe "Test connection adapters" do
|
4
4
|
if SeamlessDatabasePool::TestModel.database_configs.empty?
|
@@ -6,12 +6,13 @@ describe "Test connection adapters" do
|
|
6
6
|
else
|
7
7
|
SeamlessDatabasePool::TestModel.database_configs.keys.each do |adapter|
|
8
8
|
context adapter do
|
9
|
-
let(:model){ SeamlessDatabasePool::TestModel.db_model(adapter)}
|
9
|
+
let(:model){ SeamlessDatabasePool::TestModel.db_model(adapter) }
|
10
10
|
let(:connection){ model.connection }
|
11
11
|
let(:read_connection){ connection.available_read_connections.first }
|
12
12
|
let(:master_connection){ connection.master_connection }
|
13
13
|
|
14
14
|
before(:all) do
|
15
|
+
ActiveRecord::Base.establish_connection('adapter' => "sqlite3", 'database' => ":memory:")
|
15
16
|
model.use_database_connection(adapter)
|
16
17
|
model.create_tables
|
17
18
|
end
|
@@ -77,7 +78,6 @@ describe "Test connection adapters" do
|
|
77
78
|
end
|
78
79
|
|
79
80
|
context "read connection" do
|
80
|
-
|
81
81
|
let(:sample_sql){"SELECT #{connection.quote_column_name('name')} FROM #{connection.quote_table_name(model.table_name)}"}
|
82
82
|
|
83
83
|
it "should not include the master connection in the read pool for these tests" do
|
@@ -157,7 +157,6 @@ describe "Test connection adapters" do
|
|
157
157
|
end
|
158
158
|
|
159
159
|
context "master connection" do
|
160
|
-
|
161
160
|
let(:insert_sql){ "INSERT INTO #{connection.quote_table_name(model.table_name)} (#{connection.quote_column_name('name')}) VALUES ('new')" }
|
162
161
|
let(:update_sql){ "UPDATE #{connection.quote_table_name(model.table_name)} SET #{connection.quote_column_name('value')} = 2" }
|
163
162
|
let(:delete_sql){ "DELETE FROM #{connection.quote_table_name(model.table_name)}" }
|
@@ -194,17 +193,17 @@ describe "Test connection adapters" do
|
|
194
193
|
|
195
194
|
it "should send schema altering statements to the master connection" do
|
196
195
|
SeamlessDatabasePool.use_master_connection do
|
197
|
-
|
198
|
-
|
199
|
-
|
196
|
+
begin
|
197
|
+
connection.create_table(:foo) do |t|
|
198
|
+
t.string :name
|
199
|
+
end
|
200
|
+
connection.add_index(:foo, :name)
|
201
|
+
ensure
|
202
|
+
connection.remove_index(:foo, :name)
|
203
|
+
connection.drop_table(:foo)
|
200
204
|
end
|
201
|
-
connection.add_index(:foo, :name)
|
202
|
-
ensure
|
203
|
-
connection.remove_index(:foo, :name)
|
204
|
-
connection.drop_table(:foo)
|
205
205
|
end
|
206
206
|
end
|
207
|
-
end
|
208
207
|
end
|
209
208
|
end
|
210
209
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seamless_database_pool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 8
|
10
|
+
version: 1.0.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Brian Durand
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-06
|
18
|
+
date: 2011-07-06 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -73,6 +73,7 @@ extra_rdoc_files:
|
|
73
73
|
- MIT-LICENSE
|
74
74
|
- README.rdoc
|
75
75
|
files:
|
76
|
+
- MIT-LICENSE
|
76
77
|
- README.rdoc
|
77
78
|
- Rakefile
|
78
79
|
- lib/active_record/connection_adapters/seamless_database_pool_adapter.rb
|
@@ -90,7 +91,6 @@ files:
|
|
90
91
|
- spec/spec_helper.rb
|
91
92
|
- spec/test_adapter/active_record/connection_adapters/read_only_adapter.rb
|
92
93
|
- spec/test_model.rb
|
93
|
-
- MIT-LICENSE
|
94
94
|
has_rdoc: true
|
95
95
|
homepage: http://github.com/bdurand/seamless_database_pool
|
96
96
|
licenses: []
|