standby 4.0.0 → 5.1.0
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.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +24 -0
- data/.gitignore +1 -4
- data/README.md +4 -7
- data/Rakefile +1 -1
- data/gemfiles/rails4.2.gemfile +5 -1
- data/gemfiles/rails5.2.gemfile +5 -0
- data/gemfiles/rails6.1.gemfile +13 -0
- data/gemfiles/rails7.0.gemfile +5 -0
- data/lib/standby/active_record/base.rb +10 -0
- data/lib/standby/active_record/log_subscriber.rb +10 -1
- data/lib/standby/active_record/relation.rb +13 -12
- data/lib/standby/connection_holder.rb +17 -8
- data/lib/standby/version.rb +7 -1
- data/lib/standby.rb +9 -1
- data/spec/configuration_spec.rb +52 -4
- data/spec/spec_helper.rb +9 -4
- data/spec/{slavery_spec.rb → standby_spec.rb} +6 -0
- data/standby.gemspec +3 -1
- metadata +30 -14
- data/.travis.yml +0 -13
- data/gemfiles/rails3.2.gemfile +0 -9
- data/gemfiles/rails4.gemfile +0 -5
- data/slavery.gemspec +0 -27
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ed313fd2c207aef137a574816b7574d6614d5c2446f2d733aa7d08d2a40b6382
|
|
4
|
+
data.tar.gz: cda7f21a3cf9aa71c84da0cf8e985e965bd78fde3a21b5e57a8902a0e4b581a4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3e9d7d67ea19465e263e36a7c6318e9f4de15b6c9f53dd1a0e51e6782b1118c2c0e3352b213c687b44ffc2da5d87cc5aa9a270b7e3cea2b3f64b86be4d9d74e5
|
|
7
|
+
data.tar.gz: 4d07f9692a78f4777814282ee120d9ac6df6ad0e723555758f1bb29062082158460728579c2666e3def498a8eaead6b29b4bc344beab76c9d50f6f41a62c5856
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
on: [pull_request, push]
|
|
3
|
+
|
|
4
|
+
jobs:
|
|
5
|
+
test:
|
|
6
|
+
strategy:
|
|
7
|
+
fail-fast: false
|
|
8
|
+
matrix:
|
|
9
|
+
ruby:
|
|
10
|
+
- "2.7"
|
|
11
|
+
rails_version:
|
|
12
|
+
- "7.0"
|
|
13
|
+
- "6.1"
|
|
14
|
+
- "5.2"
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
env:
|
|
17
|
+
BUNDLE_GEMFILE: gemfiles/rails${{ matrix.rails_version }}.gemfile
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v3
|
|
20
|
+
- uses: ruby/setup-ruby@v1
|
|
21
|
+
with:
|
|
22
|
+
ruby-version: ${{ matrix.ruby }}
|
|
23
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
|
24
|
+
- run: bundle exec rake
|
data/.gitignore
CHANGED
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Standby - Read from standby databases for ActiveRecord (formerly Slavery)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
4
|
|
|
5
5
|
Standby is a simple, easy to use gem for ActiveRecord that enables conservative reading from standby databases, which means it won't automatically redirect all SELECTs to standbys.
|
|
6
6
|
|
|
@@ -155,13 +155,10 @@ Update your Gemfile
|
|
|
155
155
|
gem 'standby'
|
|
156
156
|
```
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
Then
|
|
159
159
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
grep -e on_slave **/*.rake **/*.rb -s -l | xargs sed -i "" "s|on_slave|on_standby|g"
|
|
163
|
-
grep -e on_master **/*.rake **/*.rb -s -l | xargs sed -i "" "s|on_master|on_primary|g"
|
|
164
|
-
```
|
|
160
|
+
* Replace `Slavery` with `Standby`, `on_slave` with `on_standby`, and `on_master` with `on_primary`
|
|
161
|
+
* Update keys in `database.yml` (e.g. `development_slave` to `development_standby`)
|
|
165
162
|
|
|
166
163
|
## Upgrading from version 2 to version 3
|
|
167
164
|
|
data/Rakefile
CHANGED
data/gemfiles/rails4.2.gemfile
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
gem 'activerecord', '~> 6.1'
|
|
4
|
+
gem 'sqlite3', '~> 1.4'
|
|
5
|
+
|
|
6
|
+
# Rails 6.1 compat with Ruby 3.4+ (these were removed from default gems)
|
|
7
|
+
gem 'logger'
|
|
8
|
+
gem 'mutex_m'
|
|
9
|
+
gem 'bigdecimal'
|
|
10
|
+
gem 'base64'
|
|
11
|
+
gem 'drb'
|
|
12
|
+
|
|
13
|
+
gemspec name: 'standby', path: '../'
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
module ActiveRecord
|
|
2
2
|
class Base
|
|
3
3
|
class << self
|
|
4
|
+
alias_method :connection_pool_without_standby, :connection_pool
|
|
4
5
|
alias_method :connection_without_standby, :connection
|
|
5
6
|
|
|
7
|
+
def connection_pool
|
|
8
|
+
case Thread.current[:_standby]
|
|
9
|
+
when :primary, NilClass
|
|
10
|
+
connection_pool_without_standby
|
|
11
|
+
else
|
|
12
|
+
Standby.connection_holder(Thread.current[:_standby]).connection_pool_without_standby
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
6
16
|
def connection
|
|
7
17
|
case Thread.current[:_standby]
|
|
8
18
|
when :primary, NilClass
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
+
require 'standby/version'
|
|
2
|
+
|
|
1
3
|
module ActiveRecord
|
|
2
4
|
class LogSubscriber
|
|
3
5
|
|
|
4
6
|
alias_method :debug_without_standby, :debug
|
|
5
7
|
|
|
6
8
|
def debug(msg)
|
|
7
|
-
db = Standby.disabled ?
|
|
9
|
+
db = Standby.disabled ? '' : log_header
|
|
8
10
|
debug_without_standby(db + msg)
|
|
9
11
|
end
|
|
10
12
|
|
|
13
|
+
def log_header
|
|
14
|
+
if Standby.version_gte?('7.1')
|
|
15
|
+
color("[#{Thread.current[:_standby] || "primary"}]", ActiveSupport::LogSubscriber::GREEN, bold: true)
|
|
16
|
+
else
|
|
17
|
+
color("[#{Thread.current[:_standby] || "primary"}]", ActiveSupport::LogSubscriber::GREEN, true)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
11
20
|
end
|
|
12
21
|
end
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
+
module ExecQueriesWithStandbyTarget
|
|
2
|
+
# Supports queries like User.on_standby.to_a
|
|
3
|
+
def exec_queries
|
|
4
|
+
if standby_target
|
|
5
|
+
Standby.on_standby(standby_target) { super }
|
|
6
|
+
else
|
|
7
|
+
super
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
1
12
|
module ActiveRecord
|
|
2
13
|
class Relation
|
|
3
14
|
attr_accessor :standby_target
|
|
4
15
|
|
|
5
|
-
# Supports queries like User.on_standby.to_a
|
|
6
|
-
alias_method :exec_queries_without_standby, :exec_queries
|
|
7
|
-
|
|
8
|
-
def exec_queries
|
|
9
|
-
if standby_target
|
|
10
|
-
Standby.on_standby(standby_target) { exec_queries_without_standby }
|
|
11
|
-
else
|
|
12
|
-
exec_queries_without_standby
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
|
|
17
16
|
# Supports queries like User.on_standby.count
|
|
18
17
|
alias_method :calculate_without_standby, :calculate
|
|
19
18
|
|
|
@@ -26,3 +25,5 @@ module ActiveRecord
|
|
|
26
25
|
end
|
|
27
26
|
end
|
|
28
27
|
end
|
|
28
|
+
|
|
29
|
+
ActiveRecord::Relation.prepend(ExecQueriesWithStandbyTarget)
|
|
@@ -5,8 +5,15 @@ module Standby
|
|
|
5
5
|
class << self
|
|
6
6
|
# for delayed activation
|
|
7
7
|
def activate(target)
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
env_name = "#{ActiveRecord::ConnectionHandling::RAILS_ENV.call}_#{target}"
|
|
9
|
+
# Rails 6.1+ exposes DatabaseConfigurations helpers; older versions still use hash access.
|
|
10
|
+
if ActiveRecord::Base.configurations.respond_to?(:find_db_config)
|
|
11
|
+
spec = ActiveRecord::Base.configurations.find_db_config(env_name)&.configuration_hash
|
|
12
|
+
else
|
|
13
|
+
spec = ActiveRecord::Base.configurations[env_name]
|
|
14
|
+
end
|
|
15
|
+
raise Error, "Standby target '#{target}' is invalid!" if spec.nil?
|
|
16
|
+
|
|
10
17
|
establish_connection spec
|
|
11
18
|
end
|
|
12
19
|
end
|
|
@@ -15,13 +22,15 @@ module Standby
|
|
|
15
22
|
class << self
|
|
16
23
|
def connection_holder(target)
|
|
17
24
|
klass_name = "Standby#{target.to_s.camelize}ConnectionHolder"
|
|
18
|
-
standby_connections[klass_name]
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
standby_connections[klass_name] || standby_connections_mutex.synchronize do
|
|
26
|
+
standby_connections[klass_name] ||= begin
|
|
27
|
+
klass = Class.new(Standby::ConnectionHolder) do
|
|
28
|
+
self.abstract_class = true
|
|
29
|
+
end
|
|
30
|
+
Object.const_set(klass_name, klass)
|
|
31
|
+
klass.activate(target)
|
|
32
|
+
klass
|
|
21
33
|
end
|
|
22
|
-
Object.const_set(klass_name, klass)
|
|
23
|
-
klass.activate(target)
|
|
24
|
-
klass
|
|
25
34
|
end
|
|
26
35
|
end
|
|
27
36
|
end
|
data/lib/standby/version.rb
CHANGED
data/lib/standby.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
require 'logger'
|
|
1
2
|
require 'active_record'
|
|
2
3
|
require 'standby/version'
|
|
3
4
|
require 'standby/base'
|
|
@@ -10,11 +11,18 @@ require 'standby/active_record/relation'
|
|
|
10
11
|
require 'standby/active_record/log_subscriber'
|
|
11
12
|
|
|
12
13
|
module Standby
|
|
14
|
+
@standby_connections = {}
|
|
15
|
+
@standby_connections_mutex = Mutex.new
|
|
16
|
+
|
|
13
17
|
class << self
|
|
14
18
|
attr_accessor :disabled
|
|
15
19
|
|
|
16
20
|
def standby_connections
|
|
17
|
-
@standby_connections
|
|
21
|
+
@standby_connections
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def standby_connections_mutex
|
|
25
|
+
@standby_connections_mutex
|
|
18
26
|
end
|
|
19
27
|
|
|
20
28
|
def on_standby(name = :null_state, &block)
|
data/spec/configuration_spec.rb
CHANGED
|
@@ -3,8 +3,15 @@ require 'spec_helper'
|
|
|
3
3
|
describe 'configuration' do
|
|
4
4
|
before do
|
|
5
5
|
# Backup connection and configs
|
|
6
|
-
@backup_conn = Standby.instance_variable_get
|
|
7
|
-
|
|
6
|
+
@backup_conn = (Standby.instance_variable_get(:@standby_connections) || {}).dup
|
|
7
|
+
# Rails 6.1+ wraps configurations in ActiveRecord::DatabaseConfigurations.
|
|
8
|
+
if ActiveRecord::Base.configurations.respond_to?(:configs_for)
|
|
9
|
+
@backup_config = ActiveRecord::Base.configurations.configs_for.map do |config|
|
|
10
|
+
[config.env_name, config.configuration_hash]
|
|
11
|
+
end.to_h
|
|
12
|
+
else
|
|
13
|
+
@backup_config = ActiveRecord::Base.configurations.dup
|
|
14
|
+
end
|
|
8
15
|
@backup_disabled = Standby.disabled
|
|
9
16
|
@backup_conn.each_key do |klass_name|
|
|
10
17
|
Object.send(:remove_const, klass_name) if Object.const_defined?(klass_name)
|
|
@@ -20,15 +27,56 @@ describe 'configuration' do
|
|
|
20
27
|
end
|
|
21
28
|
|
|
22
29
|
it 'raises error if standby configuration not specified' do
|
|
23
|
-
|
|
30
|
+
# Rails 6.1+ no longer supports mutating configurations via hash-style access.
|
|
31
|
+
if ActiveRecord::Base.configurations.respond_to?(:configs_for)
|
|
32
|
+
ActiveRecord::Base.configurations = @backup_config.merge({ 'test_standby' => {} })
|
|
33
|
+
else
|
|
34
|
+
ActiveRecord::Base.configurations['test_standby'] = nil
|
|
35
|
+
end
|
|
24
36
|
|
|
25
37
|
expect { Standby.on_standby { User.count } }.to raise_error(Standby::Error)
|
|
26
38
|
end
|
|
27
39
|
|
|
28
40
|
it 'connects to primary if standby configuration is disabled' do
|
|
29
|
-
|
|
41
|
+
# Rails 6.1+ no longer supports mutating configurations via hash-style access.
|
|
42
|
+
if ActiveRecord::Base.configurations.respond_to?(:configs_for)
|
|
43
|
+
ActiveRecord::Base.configurations = @backup_config.merge({ 'test_standby' => {} })
|
|
44
|
+
else
|
|
45
|
+
ActiveRecord::Base.configurations['test_standby'] = nil
|
|
46
|
+
end
|
|
30
47
|
Standby.disabled = true
|
|
31
48
|
|
|
32
49
|
expect(Standby.on_standby { User.count }).to be 2
|
|
33
50
|
end
|
|
51
|
+
|
|
52
|
+
it 'initializes a standby connection holder once under contention' do
|
|
53
|
+
entered_activate = Queue.new
|
|
54
|
+
release_activate = Queue.new
|
|
55
|
+
call_count = 0
|
|
56
|
+
|
|
57
|
+
allow(Standby::ConnectionHolder).to receive(:activate).and_wrap_original do |original, target|
|
|
58
|
+
call_count += 1
|
|
59
|
+
if call_count == 1
|
|
60
|
+
entered_activate << true
|
|
61
|
+
release_activate.pop
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
original.call(target)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
t1 = Thread.new { Standby.connection_holder(:standby) }
|
|
68
|
+
entered_activate.pop
|
|
69
|
+
|
|
70
|
+
t2 = Thread.new { Standby.connection_holder(:standby) }
|
|
71
|
+
|
|
72
|
+
expect(t2.join(0.1)).to be_nil
|
|
73
|
+
expect(call_count).to eq(1)
|
|
74
|
+
|
|
75
|
+
release_activate << true
|
|
76
|
+
|
|
77
|
+
[t1, t2].each(&:join)
|
|
78
|
+
|
|
79
|
+
expect(Standby.connection_holder(:standby).name).to eq('StandbyStandbyConnectionHolder')
|
|
80
|
+
expect(call_count).to eq(1)
|
|
81
|
+
end
|
|
34
82
|
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -6,19 +6,20 @@ ENV['RACK_ENV'] = 'test'
|
|
|
6
6
|
require 'standby'
|
|
7
7
|
|
|
8
8
|
ActiveRecord::Base.configurations = {
|
|
9
|
-
'test' => { 'adapter' => 'sqlite3', 'database' => 'test_db' },
|
|
10
|
-
'test_standby' => { 'adapter' => 'sqlite3', 'database' => 'test_standby_one' },
|
|
11
|
-
'test_standby_two' => { 'adapter' => 'sqlite3', 'database' => 'test_standby_two'},
|
|
9
|
+
'test' => { 'adapter' => 'sqlite3', 'database' => 'spec/db/test_db' },
|
|
10
|
+
'test_standby' => { 'adapter' => 'sqlite3', 'database' => 'spec/db/test_standby_one' },
|
|
11
|
+
'test_standby_two' => { 'adapter' => 'sqlite3', 'database' => 'spec/db/test_standby_two'},
|
|
12
12
|
'test_standby_url' => 'postgres://root:@localhost:5432/test_standby'
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
# Prepare databases
|
|
16
16
|
class User < ActiveRecord::Base
|
|
17
17
|
has_many :items
|
|
18
|
+
attr_accessor :name
|
|
18
19
|
end
|
|
19
20
|
|
|
20
21
|
class Item < ActiveRecord::Base
|
|
21
|
-
belongs_to :user
|
|
22
|
+
belongs_to :user, inverse_of: :items
|
|
22
23
|
end
|
|
23
24
|
|
|
24
25
|
class Seeder
|
|
@@ -51,7 +52,11 @@ class Seeder
|
|
|
51
52
|
end
|
|
52
53
|
|
|
53
54
|
def connect(env)
|
|
55
|
+
ActiveRecord::Base.connection_pool.disconnect! if ActiveRecord::Base.connected?
|
|
54
56
|
ActiveRecord::Base.establish_connection(env)
|
|
57
|
+
return unless ActiveRecord::Base.connection.adapter_name == 'SQLite'
|
|
58
|
+
|
|
59
|
+
ActiveRecord::Base.connection.execute('PRAGMA journal_mode=DELETE')
|
|
55
60
|
end
|
|
56
61
|
end
|
|
57
62
|
|
|
@@ -104,4 +104,10 @@ describe Standby do
|
|
|
104
104
|
expect(User.on_standby(:two).where(nil).to_a.size).to be 0
|
|
105
105
|
expect(User.on_standby.where(nil).to_a.size).to be 1
|
|
106
106
|
end
|
|
107
|
+
|
|
108
|
+
it 'does not interfere with setting inverses' do
|
|
109
|
+
user = User.first
|
|
110
|
+
user.update(name: 'a different name')
|
|
111
|
+
expect(user.items.first.user.name).to eq('a different name')
|
|
112
|
+
end
|
|
107
113
|
end
|
data/standby.gemspec
CHANGED
|
@@ -16,9 +16,11 @@ Gem::Specification.new do |gem|
|
|
|
16
16
|
gem.executables = gem.files.grep(%r{^exe/}).map{ |f| File.basename(f) }
|
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
18
18
|
gem.require_paths = ['lib']
|
|
19
|
+
gem.required_ruby_version = '>= 2.0'
|
|
19
20
|
|
|
20
|
-
gem.add_runtime_dependency 'activerecord', '>= 3.0.0'
|
|
21
|
+
gem.add_runtime_dependency 'activerecord', '>= 3.0.0', '< 8.0'
|
|
21
22
|
|
|
23
|
+
gem.add_development_dependency 'rake'
|
|
22
24
|
gem.add_development_dependency 'rspec'
|
|
23
25
|
gem.add_development_dependency 'sqlite3'
|
|
24
26
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: standby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 5.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kenn Ejima
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: activerecord
|
|
@@ -17,6 +16,9 @@ dependencies:
|
|
|
17
16
|
- - ">="
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
18
|
version: 3.0.0
|
|
19
|
+
- - "<"
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: '8.0'
|
|
20
22
|
type: :runtime
|
|
21
23
|
prerelease: false
|
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -24,6 +26,23 @@ dependencies:
|
|
|
24
26
|
- - ">="
|
|
25
27
|
- !ruby/object:Gem::Version
|
|
26
28
|
version: 3.0.0
|
|
29
|
+
- - "<"
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '8.0'
|
|
32
|
+
- !ruby/object:Gem::Dependency
|
|
33
|
+
name: rake
|
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - ">="
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '0'
|
|
39
|
+
type: :development
|
|
40
|
+
prerelease: false
|
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
42
|
+
requirements:
|
|
43
|
+
- - ">="
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: '0'
|
|
27
46
|
- !ruby/object:Gem::Dependency
|
|
28
47
|
name: rspec
|
|
29
48
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -59,17 +78,18 @@ executables: []
|
|
|
59
78
|
extensions: []
|
|
60
79
|
extra_rdoc_files: []
|
|
61
80
|
files:
|
|
81
|
+
- ".github/workflows/ci.yml"
|
|
62
82
|
- ".gitignore"
|
|
63
83
|
- ".rspec"
|
|
64
|
-
- ".travis.yml"
|
|
65
84
|
- Gemfile
|
|
66
85
|
- LICENSE.txt
|
|
67
86
|
- README.md
|
|
68
87
|
- Rakefile
|
|
69
88
|
- bin/console
|
|
70
|
-
- gemfiles/rails3.2.gemfile
|
|
71
89
|
- gemfiles/rails4.2.gemfile
|
|
72
|
-
- gemfiles/
|
|
90
|
+
- gemfiles/rails5.2.gemfile
|
|
91
|
+
- gemfiles/rails6.1.gemfile
|
|
92
|
+
- gemfiles/rails7.0.gemfile
|
|
73
93
|
- lib/standby.rb
|
|
74
94
|
- lib/standby/active_record/base.rb
|
|
75
95
|
- lib/standby/active_record/connection_handling.rb
|
|
@@ -80,16 +100,14 @@ files:
|
|
|
80
100
|
- lib/standby/error.rb
|
|
81
101
|
- lib/standby/transaction.rb
|
|
82
102
|
- lib/standby/version.rb
|
|
83
|
-
- slavery.gemspec
|
|
84
103
|
- spec/active_record/log_subscriber_spec.rb
|
|
85
104
|
- spec/configuration_spec.rb
|
|
86
|
-
- spec/slavery_spec.rb
|
|
87
105
|
- spec/spec_helper.rb
|
|
106
|
+
- spec/standby_spec.rb
|
|
88
107
|
- standby.gemspec
|
|
89
108
|
homepage: https://github.com/kenn/standby
|
|
90
109
|
licenses: []
|
|
91
110
|
metadata: {}
|
|
92
|
-
post_install_message:
|
|
93
111
|
rdoc_options: []
|
|
94
112
|
require_paths:
|
|
95
113
|
- lib
|
|
@@ -97,20 +115,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
97
115
|
requirements:
|
|
98
116
|
- - ">="
|
|
99
117
|
- !ruby/object:Gem::Version
|
|
100
|
-
version: '0'
|
|
118
|
+
version: '2.0'
|
|
101
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
120
|
requirements:
|
|
103
121
|
- - ">="
|
|
104
122
|
- !ruby/object:Gem::Version
|
|
105
123
|
version: '0'
|
|
106
124
|
requirements: []
|
|
107
|
-
|
|
108
|
-
rubygems_version: 2.7.6
|
|
109
|
-
signing_key:
|
|
125
|
+
rubygems_version: 3.6.9
|
|
110
126
|
specification_version: 4
|
|
111
127
|
summary: Read from stand-by databases for ActiveRecord
|
|
112
128
|
test_files:
|
|
113
129
|
- spec/active_record/log_subscriber_spec.rb
|
|
114
130
|
- spec/configuration_spec.rb
|
|
115
|
-
- spec/slavery_spec.rb
|
|
116
131
|
- spec/spec_helper.rb
|
|
132
|
+
- spec/standby_spec.rb
|
data/.travis.yml
DELETED
data/gemfiles/rails3.2.gemfile
DELETED
data/gemfiles/rails4.gemfile
DELETED
data/slavery.gemspec
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
-
require 'standby/version'
|
|
5
|
-
|
|
6
|
-
Gem::Specification.new do |gem|
|
|
7
|
-
gem.post_install_message = 'The slavery gem has been deprecated and has ' \
|
|
8
|
-
'been replaced by standby. Please switch to ' \
|
|
9
|
-
'standby as soon as possible.'
|
|
10
|
-
gem.name = 'slavery'
|
|
11
|
-
gem.version = Standby::VERSION
|
|
12
|
-
gem.authors = ['Kenn Ejima']
|
|
13
|
-
gem.email = ['kenn.ejima@gmail.com']
|
|
14
|
-
gem.description = %q{Simple, conservative slave reads for ActiveRecord}
|
|
15
|
-
gem.summary = %q{Simple, conservative slave reads for ActiveRecord}
|
|
16
|
-
gem.homepage = 'https://github.com/kenn/slavery'
|
|
17
|
-
|
|
18
|
-
gem.files = `git ls-files`.split($/)
|
|
19
|
-
gem.executables = gem.files.grep(%r{^exe/}).map{ |f| File.basename(f) }
|
|
20
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
21
|
-
gem.require_paths = ['lib']
|
|
22
|
-
|
|
23
|
-
gem.add_runtime_dependency 'activerecord', '>= 3.0.0'
|
|
24
|
-
|
|
25
|
-
gem.add_development_dependency 'rspec'
|
|
26
|
-
gem.add_development_dependency 'sqlite3'
|
|
27
|
-
end
|