ar-octopus 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +9 -9
- data/.rspec +1 -1
- data/.rubocop.yml +46 -0
- data/.rubocop_todo.yml +52 -0
- data/.ruby-version +1 -1
- data/.travis.yml +3 -9
- data/Appraisals +4 -0
- data/Rakefile +17 -16
- data/ar-octopus.gemspec +22 -16
- data/gemfiles/rails41.gemfile +7 -0
- data/init.rb +1 -1
- data/lib/ar-octopus.rb +1 -1
- data/lib/octopus.rb +38 -37
- data/lib/octopus/abstract_adapter.rb +0 -2
- data/lib/octopus/association.rb +8 -6
- data/lib/octopus/association_shard_tracking.rb +80 -81
- data/lib/octopus/collection_association.rb +7 -5
- data/lib/octopus/collection_proxy.rb +11 -9
- data/lib/octopus/has_and_belongs_to_many_association.rb +5 -3
- data/lib/octopus/load_balancing.rb +3 -2
- data/lib/octopus/load_balancing/round_robin.rb +12 -8
- data/lib/octopus/migration.rb +117 -108
- data/lib/octopus/model.rb +130 -134
- data/lib/octopus/persistence.rb +1 -1
- data/lib/octopus/proxy.rb +345 -339
- data/lib/octopus/railtie.rb +2 -2
- data/lib/octopus/relation_proxy.rb +6 -1
- data/lib/octopus/scope_proxy.rb +38 -36
- data/lib/octopus/shard_tracking.rb +36 -35
- data/lib/octopus/shard_tracking/attribute.rb +12 -14
- data/lib/octopus/shard_tracking/dynamic.rb +7 -3
- data/lib/octopus/singular_association.rb +5 -3
- data/lib/octopus/slave_group.rb +10 -8
- data/lib/octopus/version.rb +1 -1
- data/rails/init.rb +1 -1
- data/sample_app/autotest/discover.rb +2 -2
- data/sample_app/config/application.rb +1 -1
- data/sample_app/config/boot.rb +1 -1
- data/sample_app/config/environments/test.rb +1 -1
- data/sample_app/config/initializers/session_store.rb +1 -1
- data/sample_app/config/initializers/wrap_parameters.rb +1 -1
- data/sample_app/config/routes.rb +1 -1
- data/sample_app/db/migrate/20100720210335_create_sample_users.rb +2 -2
- data/sample_app/db/schema.rb +10 -10
- data/sample_app/db/seeds.rb +3 -3
- data/sample_app/features/step_definitions/seeds_steps.rb +4 -4
- data/sample_app/features/step_definitions/web_steps.rb +3 -4
- data/sample_app/features/support/env.rb +3 -4
- data/sample_app/features/support/paths.rb +4 -4
- data/sample_app/spec/spec_helper.rb +3 -3
- data/spec/migrations/10_create_users_using_replication.rb +3 -3
- data/spec/migrations/11_add_field_in_all_slaves.rb +3 -3
- data/spec/migrations/12_create_users_using_block.rb +7 -7
- data/spec/migrations/13_create_users_using_block_and_using.rb +4 -4
- data/spec/migrations/14_create_users_on_shards_of_a_group_with_versions.rb +2 -2
- data/spec/migrations/15_create_user_on_shards_of_default_group_with_versions.rb +2 -2
- data/spec/migrations/1_create_users_on_master.rb +3 -3
- data/spec/migrations/2_create_users_on_canada.rb +3 -3
- data/spec/migrations/3_create_users_on_both_shards.rb +3 -3
- data/spec/migrations/4_create_users_on_shards_of_a_group.rb +3 -3
- data/spec/migrations/5_create_users_on_multiples_groups.rb +2 -2
- data/spec/migrations/6_raise_exception_with_invalid_shard_name.rb +3 -3
- data/spec/migrations/7_raise_exception_with_invalid_multiple_shard_names.rb +3 -3
- data/spec/migrations/8_raise_exception_with_invalid_group_name.rb +3 -3
- data/spec/migrations/9_raise_exception_with_multiple_invalid_group_names.rb +4 -4
- data/spec/octopus/association_shard_tracking_spec.rb +413 -417
- data/spec/octopus/collection_proxy_spec.rb +6 -5
- data/spec/octopus/log_subscriber_spec.rb +4 -4
- data/spec/octopus/migration_spec.rb +48 -48
- data/spec/octopus/model_spec.rb +267 -292
- data/spec/octopus/octopus_spec.rb +40 -41
- data/spec/octopus/proxy_spec.rb +124 -124
- data/spec/octopus/relation_proxy_spec.rb +32 -32
- data/spec/octopus/replicated_slave_grouped_spec.rb +23 -23
- data/spec/octopus/replication_spec.rb +61 -66
- data/spec/octopus/scope_proxy_spec.rb +56 -10
- data/spec/octopus/sharded_replicated_slave_grouped_spec.rb +29 -29
- data/spec/octopus/sharded_spec.rb +10 -10
- data/spec/spec_helper.rb +6 -6
- data/spec/support/active_record/connection_adapters/modify_config_adapter.rb +1 -3
- data/spec/support/database_connection.rb +2 -2
- data/spec/support/database_models.rb +16 -17
- data/spec/support/octopus_helper.rb +19 -21
- data/spec/support/query_count.rb +1 -3
- data/spec/support/shared_contexts.rb +3 -3
- data/spec/tasks/octopus.rake_spec.rb +10 -10
- metadata +43 -26
@@ -1,54 +1,54 @@
|
|
1
|
-
require
|
1
|
+
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe 'when the database is both sharded and replicated' do
|
4
4
|
|
5
|
-
it
|
5
|
+
it 'should pick the shard based on current_shard when you have a sharded model' do
|
6
6
|
|
7
7
|
OctopusHelper.using_environment :sharded_replicated_slave_grouped do
|
8
8
|
Octopus.using(:russia) do
|
9
|
-
Cat.create!(:name =>
|
10
|
-
Cat.create!(:name =>
|
9
|
+
Cat.create!(:name => 'Thiago1')
|
10
|
+
Cat.create!(:name => 'Thiago2')
|
11
11
|
end
|
12
12
|
|
13
13
|
# We must stub here to make it effective (not in the `before(:each)` block)
|
14
|
-
Octopus.
|
14
|
+
allow(Octopus).to receive(:env).and_return('sharded_replicated_slave_grouped')
|
15
15
|
|
16
|
-
Cat.using(:russia).count.
|
16
|
+
expect(Cat.using(:russia).count).to eq(2)
|
17
17
|
# It distributes queries between two slaves in the slave group
|
18
|
-
Cat.using(shard
|
19
|
-
Cat.using(shard
|
20
|
-
Cat.using(shard
|
18
|
+
expect(Cat.using(:shard => :russia, :slave_group => :slaves1).count).to eq(0)
|
19
|
+
expect(Cat.using(:shard => :russia, :slave_group => :slaves1).count).to eq(2)
|
20
|
+
expect(Cat.using(:shard => :russia, :slave_group => :slaves1).count).to eq(0)
|
21
21
|
# It distributes queries between two slaves in the slave group
|
22
|
-
Cat.using(shard
|
23
|
-
Cat.using(shard
|
24
|
-
Cat.using(shard
|
25
|
-
|
26
|
-
Cat.using(:europe).count.
|
27
|
-
Cat.using(shard
|
28
|
-
.count.
|
29
|
-
Cat.using(shard
|
30
|
-
.count.
|
22
|
+
expect(Cat.using(:shard => :russia, :slave_group => :slaves2).count).to eq(2)
|
23
|
+
expect(Cat.using(:shard => :russia, :slave_group => :slaves2).count).to eq(0)
|
24
|
+
expect(Cat.using(:shard => :russia, :slave_group => :slaves2).count).to eq(2)
|
25
|
+
|
26
|
+
expect(Cat.using(:europe).count).to eq(0)
|
27
|
+
expect(Cat.using(:shard => :europe, :slave_group => :slaves1)
|
28
|
+
.count).to eq(0)
|
29
|
+
expect(Cat.using(:shard => :europe, :slave_group => :slaves2)
|
30
|
+
.count).to eq(2)
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
it
|
34
|
+
it 'should make queries to master when slave groups are configured for the shard but not selected' do
|
35
35
|
OctopusHelper.using_environment :sharded_replicated_slave_grouped do
|
36
36
|
Octopus.using(:europe) do
|
37
37
|
# All the queries go to :master(`octopus_shard_1`)
|
38
38
|
|
39
|
-
Cat.create!(:name =>
|
40
|
-
Cat.create!(:name =>
|
39
|
+
Cat.create!(:name => 'Thiago1')
|
40
|
+
Cat.create!(:name => 'Thiago2')
|
41
41
|
|
42
42
|
# In `database.yml` and `shards.yml`, we have configured 1 master and 6 slaves for `sharded_replicated_slave_grouped`
|
43
43
|
# So we can ensure Octopus is not distributing queries between them
|
44
44
|
# by asserting 1 + 6 = 7 queries go to :master(`octopus_shard_1`)
|
45
|
-
Cat.count.
|
46
|
-
Cat.count.
|
47
|
-
Cat.count.
|
48
|
-
Cat.count.
|
49
|
-
Cat.count.
|
50
|
-
Cat.count.
|
51
|
-
Cat.count.
|
45
|
+
expect(Cat.count).to eq(2)
|
46
|
+
expect(Cat.count).to eq(2)
|
47
|
+
expect(Cat.count).to eq(2)
|
48
|
+
expect(Cat.count).to eq(2)
|
49
|
+
expect(Cat.count).to eq(2)
|
50
|
+
expect(Cat.count).to eq(2)
|
51
|
+
expect(Cat.count).to eq(2)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
@@ -1,13 +1,13 @@
|
|
1
|
-
require
|
1
|
+
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe 'when the database is not entire sharded' do
|
4
4
|
before(:each) do
|
5
|
-
Octopus.
|
6
|
-
OctopusHelper.clean_connection_proxy
|
5
|
+
allow(Octopus).to receive(:env).and_return('not_entire_sharded')
|
6
|
+
OctopusHelper.clean_connection_proxy
|
7
7
|
end
|
8
8
|
|
9
|
-
it
|
10
|
-
|
9
|
+
it 'should not send all queries to the specified slave' do
|
10
|
+
skip
|
11
11
|
# User.create!(:name => "Thiago")
|
12
12
|
#
|
13
13
|
# using_environment :not_entire_sharded do
|
@@ -19,15 +19,15 @@ describe "when the database is not entire sharded" do
|
|
19
19
|
# User.count.should == 2
|
20
20
|
end
|
21
21
|
|
22
|
-
it
|
23
|
-
Cat.create!(:name =>
|
22
|
+
it 'should pick the shard based on current_shard when you have a sharded model' do
|
23
|
+
Cat.create!(:name => 'Thiago')
|
24
24
|
|
25
25
|
OctopusHelper.using_environment :not_entire_sharded do
|
26
26
|
Octopus.using(:russia) do
|
27
|
-
Cat.create!(:name =>
|
27
|
+
Cat.create!(:name => 'Thiago')
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
Cat.count.
|
31
|
+
expect(Cat.count).to eq(1)
|
32
32
|
end
|
33
33
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
1
|
+
require 'rubygems'
|
2
|
+
require 'pry'
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'octopus'
|
5
5
|
|
6
6
|
Octopus.instance_variable_set(:@directory, File.dirname(__FILE__))
|
7
7
|
|
8
8
|
# Requires supporting files with custom matchers and macros, etc,
|
9
9
|
# in ./support/ and its subdirectories.
|
10
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
10
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
11
11
|
|
12
12
|
RSpec.configure do |config|
|
13
|
-
config.before(:each) do
|
13
|
+
config.before(:each) do |example|
|
14
14
|
OctopusHelper.clean_all_shards(example.metadata[:shards])
|
15
15
|
end
|
16
16
|
end
|
@@ -4,14 +4,12 @@ module ActiveRecord
|
|
4
4
|
ConnectionAdapters::ModifyConfigAdapter.new(config)
|
5
5
|
end
|
6
6
|
end
|
7
|
-
|
7
|
+
|
8
8
|
module ConnectionAdapters
|
9
9
|
class ModifyConfigAdapter < AbstractAdapter
|
10
|
-
|
11
10
|
def initialize(config)
|
12
11
|
config.replace(config.symbolize_keys)
|
13
12
|
end
|
14
|
-
|
15
13
|
end
|
16
14
|
end
|
17
15
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require 'logger'
|
2
2
|
|
3
|
-
ActiveRecord::Base.establish_connection(:adapter =>
|
3
|
+
ActiveRecord::Base.establish_connection(:adapter => 'mysql2', :database => 'octopus_shard_1', :username => 'root', :password => '')
|
4
4
|
ActiveRecord::Base.logger = Logger.new(File.open('database.log', 'a'))
|
@@ -1,36 +1,36 @@
|
|
1
1
|
# Rails 3.1 needs to do some introspection around the base class, which requires
|
2
2
|
# the model be a descendent of ActiveRecord::Base.
|
3
|
-
class BlankModel < ActiveRecord::Base; end
|
3
|
+
class BlankModel < ActiveRecord::Base; end
|
4
4
|
|
5
|
-
#The user class is just sharded, not replicated
|
5
|
+
# The user class is just sharded, not replicated
|
6
6
|
class User < ActiveRecord::Base
|
7
|
-
scope :thiago,
|
7
|
+
scope :thiago, -> { where(:name => 'Thiago') }
|
8
8
|
|
9
9
|
def awesome_queries
|
10
10
|
Octopus.using(:canada) do
|
11
|
-
User.create(:name =>
|
11
|
+
User.create(:name => 'teste')
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
#The client class isn't replicated
|
16
|
+
# The client class isn't replicated
|
17
17
|
class Client < ActiveRecord::Base
|
18
18
|
has_many :items
|
19
19
|
has_many :comments, :as => :commentable
|
20
20
|
end
|
21
21
|
|
22
|
-
#This class is replicated
|
22
|
+
# This class is replicated
|
23
23
|
class Cat < ActiveRecord::Base
|
24
|
-
replicated_model
|
25
|
-
#sharded_model()
|
24
|
+
replicated_model
|
25
|
+
# sharded_model()
|
26
26
|
end
|
27
27
|
|
28
|
-
#This class sets its own connection
|
28
|
+
# This class sets its own connection
|
29
29
|
class CustomConnection < ActiveRecord::Base
|
30
|
-
octopus_establish_connection(:adapter =>
|
30
|
+
octopus_establish_connection(:adapter => 'mysql2', :database => 'octopus_shard_2', :username => 'root', :password => '')
|
31
31
|
end
|
32
32
|
|
33
|
-
#This items belongs to a client
|
33
|
+
# This items belongs to a client
|
34
34
|
class Item < ActiveRecord::Base
|
35
35
|
belongs_to :client
|
36
36
|
has_many :parts
|
@@ -77,22 +77,21 @@ class Comment < ActiveRecord::Base
|
|
77
77
|
belongs_to :commentable, :polymorphic => true
|
78
78
|
end
|
79
79
|
|
80
|
-
|
81
80
|
class Bacon < ActiveRecord::Base
|
82
81
|
self.table_name = 'yummy'
|
83
82
|
end
|
84
83
|
|
85
84
|
class Cheese < ActiveRecord::Base
|
86
|
-
self.table_name = 'yummy'
|
85
|
+
self.table_name = 'yummy'
|
87
86
|
end
|
88
87
|
|
89
88
|
class Ham < ActiveRecord::Base
|
90
89
|
self.table_name = 'yummy'
|
91
90
|
end
|
92
91
|
|
93
|
-
#This class sets its own connection
|
92
|
+
# This class sets its own connection
|
94
93
|
class Advert < ActiveRecord::Base
|
95
|
-
establish_connection(:adapter =>
|
94
|
+
establish_connection(:adapter => 'postgresql', :database => 'octopus_shard_1', :username => ENV['POSTGRES_USER'] || 'postgres', :password => '')
|
96
95
|
end
|
97
96
|
|
98
97
|
class MmorpgPlayer < ActiveRecord::Base
|
@@ -102,9 +101,9 @@ end
|
|
102
101
|
|
103
102
|
class Weapon < ActiveRecord::Base
|
104
103
|
belongs_to :mmorpg_player, :inverse_of => :weapons
|
105
|
-
validates
|
104
|
+
validates :hand, :uniqueness => { :scope => :mmorpg_player_id }
|
106
105
|
validates_presence_of :mmorpg_player
|
107
|
-
has_many
|
106
|
+
has_many :skills
|
108
107
|
end
|
109
108
|
|
110
109
|
class Skill < ActiveRecord::Base
|
@@ -5,30 +5,30 @@ module OctopusHelper
|
|
5
5
|
end
|
6
6
|
|
7
7
|
shards.each do |shard_symbol|
|
8
|
-
|
8
|
+
%w(schema_migrations users clients cats items keyboards computers permissions_roles roles permissions assignments projects programmers yummy adverts).each do |tables|
|
9
9
|
BlankModel.using(shard_symbol).connection.execute("DELETE FROM #{tables}")
|
10
10
|
end
|
11
11
|
|
12
12
|
if shard_symbol == 'alone_shard'
|
13
|
-
|
13
|
+
%w(mmorpg_players weapons skills).each do |table|
|
14
14
|
BlankModel.using(shard_symbol).connection.execute("DELETE FROM #{table}")
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
def self.clean_connection_proxy
|
21
|
-
Thread.current[
|
22
|
-
Thread.current[
|
23
|
-
Thread.current[
|
24
|
-
Thread.current[
|
25
|
-
Thread.current[
|
26
|
-
Thread.current[
|
20
|
+
def self.clean_connection_proxy
|
21
|
+
Thread.current['octopus.current_model'] = nil
|
22
|
+
Thread.current['octopus.current_shard'] = nil
|
23
|
+
Thread.current['octopus.current_group'] = nil
|
24
|
+
Thread.current['octopus.current_slave_group'] = nil
|
25
|
+
Thread.current['octopus.block'] = nil
|
26
|
+
Thread.current['octopus.last_current_shard'] = nil
|
27
27
|
|
28
|
-
ActiveRecord::Base.
|
28
|
+
ActiveRecord::Base.class_variable_set(:@@connection_proxy, nil)
|
29
29
|
end
|
30
30
|
|
31
|
-
def self.migrating_to_version(version, &
|
31
|
+
def self.migrating_to_version(version, &_block)
|
32
32
|
migrations_root = File.expand_path(File.join(File.dirname(__FILE__), '..', 'migrations'))
|
33
33
|
|
34
34
|
begin
|
@@ -39,18 +39,16 @@ module OctopusHelper
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
def self.using_environment(environment, &
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
clean_connection_proxy()
|
50
|
-
end
|
42
|
+
def self.using_environment(environment, &_block)
|
43
|
+
self.octopus_env = environment.to_s
|
44
|
+
clean_connection_proxy
|
45
|
+
yield
|
46
|
+
ensure
|
47
|
+
self.octopus_env = 'octopus'
|
48
|
+
clean_connection_proxy
|
51
49
|
end
|
52
50
|
|
53
|
-
def self.
|
51
|
+
def self.octopus_env=(env)
|
54
52
|
Octopus.instance_variable_set(:@config, nil)
|
55
53
|
Octopus.stub(:env).and_return(env)
|
56
54
|
end
|
data/spec/support/query_count.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
module ActiveRecord
|
2
2
|
class QueryCounter
|
3
|
-
|
4
3
|
attr_accessor :query_count
|
5
4
|
|
6
5
|
def initialize
|
@@ -11,9 +10,8 @@ module ActiveRecord
|
|
11
10
|
lambda(&method(:callback))
|
12
11
|
end
|
13
12
|
|
14
|
-
def callback(
|
13
|
+
def callback(_name, _start, _finish, _message_id, values)
|
15
14
|
@query_count += 1 unless %w(CACHE SCHEMA).include?(values[:name])
|
16
15
|
end
|
17
|
-
|
18
16
|
end
|
19
17
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
shared_context
|
1
|
+
shared_context 'with query cache enabled' do
|
2
2
|
let!(:counter) { ActiveRecord::QueryCounter.new }
|
3
3
|
|
4
4
|
before(:each) do
|
@@ -6,12 +6,12 @@ shared_context "with query cache enabled" do
|
|
6
6
|
counter.query_count = 0
|
7
7
|
end
|
8
8
|
|
9
|
-
after(:each) do
|
9
|
+
after(:each) do
|
10
10
|
ActiveRecord::Base.connection.disable_query_cache!
|
11
11
|
end
|
12
12
|
|
13
13
|
around(:each) do |example|
|
14
|
-
active_support_subscribed(counter.to_proc, 'sql.active_record') do
|
14
|
+
active_support_subscribed(counter.to_proc, 'sql.active_record') do
|
15
15
|
example.run
|
16
16
|
end
|
17
17
|
end
|
@@ -1,31 +1,31 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'rake'
|
3
3
|
|
4
|
-
describe
|
4
|
+
describe 'octopus.rake' do
|
5
5
|
before do
|
6
|
-
load File.expand_path(
|
6
|
+
load File.expand_path('../../../lib/tasks/octopus.rake', __FILE__)
|
7
7
|
Rake::Task.define_task(:environment)
|
8
8
|
end
|
9
9
|
|
10
|
-
describe
|
10
|
+
describe 'octopus:copy_schema_versions' do
|
11
11
|
class SchemaMigration < ActiveRecord::Base; end
|
12
12
|
|
13
13
|
before do
|
14
|
-
Rake::Task[
|
14
|
+
Rake::Task['octopus:copy_schema_versions'].reenable
|
15
15
|
|
16
|
-
path = File.expand_path(
|
16
|
+
path = File.expand_path('../../migrations', __FILE__)
|
17
17
|
ActiveRecord::Migrator.migrations_paths = [path]
|
18
18
|
end
|
19
19
|
|
20
|
-
it
|
20
|
+
it 'assumes each shard migrated to the current master version' do
|
21
21
|
SchemaMigration.create(:version => 1)
|
22
22
|
SchemaMigration.create(:version => 2)
|
23
23
|
SchemaMigration.create(:version => 3)
|
24
24
|
|
25
|
-
Rake::Task[
|
25
|
+
Rake::Task['octopus:copy_schema_versions'].invoke
|
26
26
|
|
27
27
|
ActiveRecord::Base.connection.shard_names.each do |shard_name|
|
28
|
-
Octopus.using(shard_name) { ActiveRecord::Migrator.get_all_versions }.
|
28
|
+
expect(Octopus.using(shard_name) { ActiveRecord::Migrator.get_all_versions }).to eq([1, 2, 3])
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ar-octopus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thiago Pradi
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-08-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
@@ -41,77 +41,77 @@ dependencies:
|
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: 3.2.0
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
|
-
name:
|
44
|
+
name: appraisal
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - ! '>='
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.8
|
49
|
+
version: 0.3.8
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - ! '>='
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 0.8
|
56
|
+
version: 0.3.8
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
|
-
name:
|
58
|
+
name: mysql2
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- - ! '
|
61
|
+
- - ! '>'
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
63
|
+
version: '0.3'
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- - ! '
|
68
|
+
- - ! '>'
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version:
|
70
|
+
version: '0.3'
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
|
-
name:
|
72
|
+
name: pg
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- - ! '
|
75
|
+
- - ! '>='
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
77
|
+
version: 0.11.0
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
|
-
- - ! '
|
82
|
+
- - ! '>='
|
83
83
|
- !ruby/object:Gem::Version
|
84
|
-
version:
|
84
|
+
version: 0.11.0
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
|
-
name:
|
86
|
+
name: rake
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
89
|
- - ! '>='
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version: 0.
|
91
|
+
version: 0.8.7
|
92
92
|
type: :development
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
version: 0.
|
98
|
+
version: 0.8.7
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
|
-
name:
|
100
|
+
name: rspec
|
101
101
|
requirement: !ruby/object:Gem::Requirement
|
102
102
|
requirements:
|
103
103
|
- - ! '>='
|
104
104
|
- !ruby/object:Gem::Version
|
105
|
-
version:
|
105
|
+
version: '3'
|
106
106
|
type: :development
|
107
107
|
prerelease: false
|
108
108
|
version_requirements: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
110
|
- - ! '>='
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
version:
|
112
|
+
version: '3'
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
|
-
name:
|
114
|
+
name: rubocop
|
115
115
|
requirement: !ruby/object:Gem::Requirement
|
116
116
|
requirements:
|
117
117
|
- - ! '>='
|
@@ -125,19 +125,33 @@ dependencies:
|
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '0'
|
127
127
|
- !ruby/object:Gem::Dependency
|
128
|
-
name:
|
128
|
+
name: sqlite3
|
129
129
|
requirement: !ruby/object:Gem::Requirement
|
130
130
|
requirements:
|
131
131
|
- - ! '>='
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version:
|
133
|
+
version: 1.3.4
|
134
134
|
type: :development
|
135
135
|
prerelease: false
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
137
|
requirements:
|
138
138
|
- - ! '>='
|
139
139
|
- !ruby/object:Gem::Version
|
140
|
-
version:
|
140
|
+
version: 1.3.4
|
141
|
+
- !ruby/object:Gem::Dependency
|
142
|
+
name: pry-debugger
|
143
|
+
requirement: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - ! '>='
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '0'
|
148
|
+
type: :development
|
149
|
+
prerelease: false
|
150
|
+
version_requirements: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ! '>='
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
141
155
|
description: This gem allows you to use sharded databases with ActiveRecord. This
|
142
156
|
also provides a interface for replication and for running migrations with multiples
|
143
157
|
shards.
|
@@ -151,6 +165,8 @@ extra_rdoc_files: []
|
|
151
165
|
files:
|
152
166
|
- .gitignore
|
153
167
|
- .rspec
|
168
|
+
- .rubocop.yml
|
169
|
+
- .rubocop_todo.yml
|
154
170
|
- .ruby-version
|
155
171
|
- .travis.yml
|
156
172
|
- Appraisals
|
@@ -161,6 +177,7 @@ files:
|
|
161
177
|
- ar-octopus.gemspec
|
162
178
|
- gemfiles/rails32.gemfile
|
163
179
|
- gemfiles/rails4.gemfile
|
180
|
+
- gemfiles/rails41.gemfile
|
164
181
|
- init.rb
|
165
182
|
- lib/ar-octopus.rb
|
166
183
|
- lib/octopus.rb
|
@@ -327,7 +344,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
327
344
|
version: '0'
|
328
345
|
requirements: []
|
329
346
|
rubyforge_project:
|
330
|
-
rubygems_version: 2.
|
347
|
+
rubygems_version: 2.2.2
|
331
348
|
signing_key:
|
332
349
|
specification_version: 4
|
333
350
|
summary: Easy Database Sharding for ActiveRecord
|