ar-octopus-master 0.9.2.master → 0.9.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +12 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +46 -0
  5. data/.rubocop_todo.yml +56 -0
  6. data/.travis.yml +25 -0
  7. data/Appraisals +20 -0
  8. data/Gemfile +4 -0
  9. data/README.mkdn +242 -0
  10. data/Rakefile +172 -0
  11. data/TODO.txt +7 -0
  12. data/ar-octopus.gemspec +39 -0
  13. data/gemfiles/rails4.gemfile +7 -0
  14. data/gemfiles/rails41.gemfile +7 -0
  15. data/gemfiles/rails42.gemfile +7 -0
  16. data/gemfiles/rails5.gemfile +7 -0
  17. data/gemfiles/rails51.gemfile +7 -0
  18. data/lib/ar-octopus.rb +1 -0
  19. data/lib/octopus.rb +205 -0
  20. data/lib/octopus/abstract_adapter.rb +33 -0
  21. data/lib/octopus/association.rb +14 -0
  22. data/lib/octopus/association_shard_tracking.rb +74 -0
  23. data/lib/octopus/collection_association.rb +17 -0
  24. data/lib/octopus/collection_proxy.rb +16 -0
  25. data/lib/octopus/exception.rb +4 -0
  26. data/lib/octopus/finder_methods.rb +8 -0
  27. data/lib/octopus/has_and_belongs_to_many_association.rb +9 -0
  28. data/lib/octopus/load_balancing.rb +4 -0
  29. data/lib/octopus/load_balancing/round_robin.rb +20 -0
  30. data/lib/octopus/log_subscriber.rb +26 -0
  31. data/lib/octopus/migration.rb +195 -0
  32. data/lib/octopus/model.rb +223 -0
  33. data/lib/octopus/persistence.rb +45 -0
  34. data/lib/octopus/proxy.rb +346 -0
  35. data/lib/octopus/proxy_config.rb +252 -0
  36. data/lib/octopus/query_cache_for_shards.rb +25 -0
  37. data/lib/octopus/railtie.rb +11 -0
  38. data/lib/octopus/relation_proxy.rb +58 -0
  39. data/lib/octopus/result_patch.rb +19 -0
  40. data/lib/octopus/scope_proxy.rb +68 -0
  41. data/lib/octopus/shard_tracking.rb +46 -0
  42. data/lib/octopus/shard_tracking/attribute.rb +22 -0
  43. data/lib/octopus/shard_tracking/dynamic.rb +11 -0
  44. data/lib/octopus/singular_association.rb +9 -0
  45. data/lib/octopus/slave_group.rb +13 -0
  46. data/lib/octopus/version.rb +3 -0
  47. data/lib/tasks/octopus.rake +16 -0
  48. data/sample_app/.gitignore +4 -0
  49. data/sample_app/.rspec +1 -0
  50. data/sample_app/Gemfile +20 -0
  51. data/sample_app/README +3 -0
  52. data/sample_app/README.rdoc +261 -0
  53. data/sample_app/Rakefile +7 -0
  54. data/sample_app/app/assets/images/rails.png +0 -0
  55. data/sample_app/app/assets/javascripts/application.js +15 -0
  56. data/sample_app/app/assets/stylesheets/application.css +13 -0
  57. data/sample_app/app/controllers/application_controller.rb +4 -0
  58. data/sample_app/app/helpers/application_helper.rb +2 -0
  59. data/sample_app/app/mailers/.gitkeep +0 -0
  60. data/sample_app/app/models/.gitkeep +0 -0
  61. data/sample_app/app/models/item.rb +3 -0
  62. data/sample_app/app/models/user.rb +3 -0
  63. data/sample_app/app/views/layouts/application.html.erb +14 -0
  64. data/sample_app/autotest/discover.rb +2 -0
  65. data/sample_app/config.ru +4 -0
  66. data/sample_app/config/application.rb +62 -0
  67. data/sample_app/config/boot.rb +6 -0
  68. data/sample_app/config/cucumber.yml +8 -0
  69. data/sample_app/config/database.yml +28 -0
  70. data/sample_app/config/environment.rb +5 -0
  71. data/sample_app/config/environments/development.rb +37 -0
  72. data/sample_app/config/environments/production.rb +67 -0
  73. data/sample_app/config/environments/test.rb +37 -0
  74. data/sample_app/config/initializers/backtrace_silencers.rb +7 -0
  75. data/sample_app/config/initializers/inflections.rb +15 -0
  76. data/sample_app/config/initializers/mime_types.rb +5 -0
  77. data/sample_app/config/initializers/secret_token.rb +7 -0
  78. data/sample_app/config/initializers/session_store.rb +8 -0
  79. data/sample_app/config/initializers/wrap_parameters.rb +14 -0
  80. data/sample_app/config/locales/en.yml +5 -0
  81. data/sample_app/config/routes.rb +58 -0
  82. data/sample_app/config/shards.yml +28 -0
  83. data/sample_app/db/migrate/20100720172715_create_users.rb +15 -0
  84. data/sample_app/db/migrate/20100720172730_create_items.rb +16 -0
  85. data/sample_app/db/migrate/20100720210335_create_sample_users.rb +11 -0
  86. data/sample_app/db/schema.rb +29 -0
  87. data/sample_app/db/seeds.rb +16 -0
  88. data/sample_app/doc/README_FOR_APP +2 -0
  89. data/sample_app/features/migrate.feature +45 -0
  90. data/sample_app/features/seed.feature +15 -0
  91. data/sample_app/features/step_definitions/seeds_steps.rb +13 -0
  92. data/sample_app/features/step_definitions/web_steps.rb +218 -0
  93. data/sample_app/features/support/database.rb +13 -0
  94. data/sample_app/features/support/env.rb +57 -0
  95. data/sample_app/features/support/paths.rb +33 -0
  96. data/sample_app/lib/assets/.gitkeep +0 -0
  97. data/sample_app/lib/tasks/.gitkeep +0 -0
  98. data/sample_app/lib/tasks/cucumber.rake +64 -0
  99. data/sample_app/log/.gitkeep +0 -0
  100. data/sample_app/public/404.html +26 -0
  101. data/sample_app/public/422.html +26 -0
  102. data/sample_app/public/500.html +26 -0
  103. data/sample_app/public/favicon.ico +0 -0
  104. data/sample_app/public/images/rails.png +0 -0
  105. data/sample_app/public/index.html +279 -0
  106. data/sample_app/public/javascripts/application.js +2 -0
  107. data/sample_app/public/javascripts/controls.js +965 -0
  108. data/sample_app/public/javascripts/dragdrop.js +974 -0
  109. data/sample_app/public/javascripts/effects.js +1123 -0
  110. data/sample_app/public/javascripts/prototype.js +4874 -0
  111. data/sample_app/public/javascripts/rails.js +118 -0
  112. data/sample_app/public/robots.txt +5 -0
  113. data/sample_app/public/stylesheets/.gitkeep +0 -0
  114. data/sample_app/script/cucumber +10 -0
  115. data/sample_app/script/rails +6 -0
  116. data/sample_app/spec/models/item_spec.rb +5 -0
  117. data/sample_app/spec/models/user_spec.rb +5 -0
  118. data/sample_app/spec/spec_helper.rb +27 -0
  119. data/sample_app/vendor/assets/javascripts/.gitkeep +0 -0
  120. data/sample_app/vendor/assets/stylesheets/.gitkeep +0 -0
  121. data/sample_app/vendor/plugins/.gitkeep +0 -0
  122. data/spec/config/shards.yml +229 -0
  123. data/spec/migrations/10_create_users_using_replication.rb +9 -0
  124. data/spec/migrations/11_add_field_in_all_slaves.rb +11 -0
  125. data/spec/migrations/12_create_users_using_block.rb +23 -0
  126. data/spec/migrations/13_create_users_using_block_and_using.rb +15 -0
  127. data/spec/migrations/14_create_users_on_shards_of_a_group_with_versions.rb +11 -0
  128. data/spec/migrations/15_create_user_on_shards_of_default_group_with_versions.rb +9 -0
  129. data/spec/migrations/1_create_users_on_master.rb +9 -0
  130. data/spec/migrations/2_create_users_on_canada.rb +11 -0
  131. data/spec/migrations/3_create_users_on_both_shards.rb +11 -0
  132. data/spec/migrations/4_create_users_on_shards_of_a_group.rb +11 -0
  133. data/spec/migrations/5_create_users_on_multiples_groups.rb +11 -0
  134. data/spec/migrations/6_raise_exception_with_invalid_shard_name.rb +11 -0
  135. data/spec/migrations/7_raise_exception_with_invalid_multiple_shard_names.rb +11 -0
  136. data/spec/migrations/8_raise_exception_with_invalid_group_name.rb +11 -0
  137. data/spec/migrations/9_raise_exception_with_multiple_invalid_group_names.rb +11 -0
  138. data/spec/octopus/association_shard_tracking_spec.rb +1036 -0
  139. data/spec/octopus/collection_proxy_spec.rb +16 -0
  140. data/spec/octopus/load_balancing/round_robin_spec.rb +15 -0
  141. data/spec/octopus/log_subscriber_spec.rb +19 -0
  142. data/spec/octopus/migration_spec.rb +134 -0
  143. data/spec/octopus/model_spec.rb +754 -0
  144. data/spec/octopus/octopus_spec.rb +123 -0
  145. data/spec/octopus/proxy_spec.rb +303 -0
  146. data/spec/octopus/query_cache_for_shards_spec.rb +17 -0
  147. data/spec/octopus/relation_proxy_spec.rb +124 -0
  148. data/spec/octopus/replicated_slave_grouped_spec.rb +91 -0
  149. data/spec/octopus/replication_spec.rb +196 -0
  150. data/spec/octopus/scope_proxy_spec.rb +97 -0
  151. data/spec/octopus/sharded_replicated_slave_grouped_spec.rb +55 -0
  152. data/spec/octopus/sharded_spec.rb +33 -0
  153. data/spec/spec_helper.rb +18 -0
  154. data/spec/support/active_record/connection_adapters/modify_config_adapter.rb +15 -0
  155. data/spec/support/database_connection.rb +4 -0
  156. data/spec/support/database_models.rb +118 -0
  157. data/spec/support/octopus_helper.rb +54 -0
  158. data/spec/support/query_count.rb +17 -0
  159. data/spec/support/shared_contexts.rb +18 -0
  160. data/spec/tasks/octopus.rake_spec.rb +32 -0
  161. metadata +203 -5
@@ -0,0 +1,18 @@
1
+ require 'rubygems'
2
+ require 'pry'
3
+ require 'bundler/setup'
4
+ require 'octopus'
5
+
6
+ Octopus.instance_variable_set(:@directory, File.dirname(__FILE__))
7
+
8
+ BaseOctopusMigrationClass = (Octopus.rails4? ? ActiveRecord::Migration : ActiveRecord::Migration[ActiveRecord::VERSION::STRING[0..2]])
9
+
10
+ # Requires supporting files with custom matchers and macros, etc,
11
+ # in ./support/ and its subdirectories.
12
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
13
+
14
+ RSpec.configure do |config|
15
+ config.before(:each) do |example|
16
+ OctopusHelper.clean_all_shards(example.metadata[:shards])
17
+ end
18
+ end
@@ -0,0 +1,15 @@
1
+ module ActiveRecord
2
+ class Base
3
+ def self.modify_config_connection(config)
4
+ ConnectionAdapters::ModifyConfigAdapter.new(config)
5
+ end
6
+ end
7
+
8
+ module ConnectionAdapters
9
+ class ModifyConfigAdapter < AbstractAdapter
10
+ def initialize(config)
11
+ config.replace(config.symbolize_keys)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,4 @@
1
+ require 'logger'
2
+
3
+ ActiveRecord::Base.establish_connection(:adapter => 'mysql2', :database => 'octopus_shard_1', :username => "#{ENV['MYSQL_USER'] || 'root'}", :password => '')
4
+ ActiveRecord::Base.logger = Logger.new(File.open('database.log', 'a'))
@@ -0,0 +1,118 @@
1
+ # Rails 3.1 needs to do some introspection around the base class, which requires
2
+ # the model be a descendent of ActiveRecord::Base.
3
+ class BlankModel < ActiveRecord::Base; end
4
+
5
+ # The user class is just sharded, not replicated
6
+ class User < ActiveRecord::Base
7
+ scope :thiago, -> { where(:name => 'Thiago') }
8
+
9
+ def awesome_queries
10
+ Octopus.using(:canada) do
11
+ User.create(:name => 'teste')
12
+ end
13
+ end
14
+ end
15
+
16
+ # The client class isn't replicated
17
+ class Client < ActiveRecord::Base
18
+ has_many :items
19
+ has_many :comments, :as => :commentable
20
+ end
21
+
22
+ # This class is replicated
23
+ class Cat < ActiveRecord::Base
24
+ replicated_model
25
+ # sharded_model()
26
+ end
27
+
28
+ # This class sets its own connection
29
+ class CustomConnection < ActiveRecord::Base
30
+ self.table_name = 'custom'
31
+ octopus_establish_connection(:adapter => 'mysql2', :database => 'octopus_shard_2', :username => "#{ENV['MYSQL_USER'] || 'root'}", :password => '')
32
+ end
33
+
34
+ # This items belongs to a client
35
+ class Item < ActiveRecord::Base
36
+ belongs_to :client
37
+ has_many :parts
38
+ end
39
+
40
+ class Part < ActiveRecord::Base
41
+ belongs_to :item
42
+ end
43
+
44
+ class Keyboard < ActiveRecord::Base
45
+ replicated_model
46
+ validates_uniqueness_of :name
47
+ belongs_to :computer
48
+ end
49
+
50
+ class Computer < ActiveRecord::Base
51
+ has_one :keyboard
52
+ end
53
+
54
+ class Role < ActiveRecord::Base
55
+ has_and_belongs_to_many :permissions
56
+ end
57
+
58
+ class Permission < ActiveRecord::Base
59
+ has_and_belongs_to_many :roles
60
+ end
61
+
62
+ class Assignment < ActiveRecord::Base
63
+ belongs_to :programmer
64
+ belongs_to :project
65
+ end
66
+
67
+ class Programmer < ActiveRecord::Base
68
+ has_many :assignments
69
+ has_many :projects, :through => :assignments
70
+ end
71
+
72
+ class Project < ActiveRecord::Base
73
+ has_many :assignments
74
+ has_many :programmers, :through => :assignments
75
+ end
76
+
77
+ class Comment < ActiveRecord::Base
78
+ belongs_to :commentable, :polymorphic => true
79
+ scope :open, -> { where(open: true) }
80
+ end
81
+
82
+ class Bacon < ActiveRecord::Base
83
+ self.table_name = 'yummy'
84
+ end
85
+
86
+ class Cheese < ActiveRecord::Base
87
+ self.table_name = 'yummy'
88
+ end
89
+
90
+ class Ham < ActiveRecord::Base
91
+ self.table_name = 'yummy'
92
+ end
93
+
94
+ # This class sets its own connection
95
+ class Advert < ActiveRecord::Base
96
+ establish_connection(:adapter => 'postgresql', :database => 'octopus_shard_1', :username => ENV['POSTGRES_USER'] || 'postgres', :password => '')
97
+ end
98
+
99
+ class MmorpgPlayer < ActiveRecord::Base
100
+ has_many :weapons
101
+ has_many :skills
102
+ end
103
+
104
+ class Weapon < ActiveRecord::Base
105
+ belongs_to :mmorpg_player, :inverse_of => :weapons
106
+ validates :hand, :uniqueness => { :scope => :mmorpg_player_id }
107
+ validates_presence_of :mmorpg_player
108
+ has_many :skills
109
+ end
110
+
111
+ class Skill < ActiveRecord::Base
112
+ belongs_to :weapon, :inverse_of => :skills
113
+ belongs_to :mmorpg_player, :inverse_of => :skills
114
+
115
+ validates_presence_of :weapon
116
+ validates_presence_of :mmorpg_player
117
+ validates :name, :uniqueness => { :scope => :mmorpg_player_id }
118
+ end
@@ -0,0 +1,54 @@
1
+ module OctopusHelper
2
+ def self.clean_all_shards(shards)
3
+ if shards.nil?
4
+ shards = BlankModel.using(:master).connection.shards.keys
5
+ end
6
+
7
+ shards.each do |shard_symbol|
8
+ %w(schema_migrations users clients cats items keyboards computers permissions_roles roles permissions assignments projects programmers yummy adverts).each do |tables|
9
+ BlankModel.using(shard_symbol).connection.execute("DELETE FROM #{tables}")
10
+ end
11
+
12
+ if shard_symbol == 'alone_shard'
13
+ %w(mmorpg_players weapons skills).each do |table|
14
+ BlankModel.using(shard_symbol).connection.execute("DELETE FROM #{table}")
15
+ end
16
+ end
17
+ end
18
+ end
19
+
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
+
27
+ ActiveRecord::Base.class_variable_set(:@@connection_proxy, nil)
28
+ end
29
+
30
+ def self.migrating_to_version(version, &_block)
31
+ migrations_root = File.expand_path(File.join(File.dirname(__FILE__), '..', 'migrations'))
32
+
33
+ begin
34
+ ActiveRecord::Migrator.run(:up, migrations_root, version)
35
+ yield
36
+ ensure
37
+ ActiveRecord::Migrator.run(:down, migrations_root, version)
38
+ end
39
+ end
40
+
41
+ def self.using_environment(environment, &_block)
42
+ self.octopus_env = environment.to_s
43
+ clean_connection_proxy
44
+ yield
45
+ ensure
46
+ self.octopus_env = 'octopus'
47
+ clean_connection_proxy
48
+ end
49
+
50
+ def self.octopus_env=(env)
51
+ Octopus.instance_variable_set(:@config, nil)
52
+ Octopus.stub(:env).and_return(env)
53
+ end
54
+ end
@@ -0,0 +1,17 @@
1
+ module ActiveRecord
2
+ class QueryCounter
3
+ attr_accessor :query_count
4
+
5
+ def initialize
6
+ @query_count = 0
7
+ end
8
+
9
+ def to_proc
10
+ lambda(&method(:callback))
11
+ end
12
+
13
+ def callback(_name, _start, _finish, _message_id, values)
14
+ @query_count += 1 unless %w(CACHE SCHEMA).include?(values[:name])
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,18 @@
1
+ shared_context 'with query cache enabled' do
2
+ let!(:counter) { ActiveRecord::QueryCounter.new }
3
+
4
+ before(:each) do
5
+ ActiveRecord::Base.connection.enable_query_cache!
6
+ counter.query_count = 0
7
+ end
8
+
9
+ after(:each) do
10
+ ActiveRecord::Base.connection.disable_query_cache!
11
+ end
12
+
13
+ around(:each) do |example|
14
+ active_support_subscribed(counter.to_proc, 'sql.active_record') do
15
+ example.run
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,32 @@
1
+ require 'spec_helper'
2
+ require 'rake'
3
+
4
+ describe 'octopus.rake' do
5
+ before do
6
+ load File.expand_path('../../../lib/tasks/octopus.rake', __FILE__)
7
+ Rake::Task.define_task(:environment)
8
+ end
9
+
10
+ describe 'octopus:copy_schema_versions' do
11
+ class SchemaMigration < ActiveRecord::Base; end
12
+
13
+ before do
14
+ Rake::Task['octopus:copy_schema_versions'].reenable
15
+
16
+ path = File.expand_path('../../migrations', __FILE__)
17
+ ActiveRecord::Migrator.migrations_paths = [path]
18
+ end
19
+
20
+ it 'assumes each shard migrated to the current master version' do
21
+ SchemaMigration.create(:version => 1)
22
+ SchemaMigration.create(:version => 2)
23
+ SchemaMigration.create(:version => 3)
24
+
25
+ Rake::Task['octopus:copy_schema_versions'].invoke
26
+
27
+ ActiveRecord::Base.connection.shard_names.each do |shard_name|
28
+ expect(Octopus.using(shard_name) { ActiveRecord::SchemaMigration.all.pluck(:version).map(&:to_i).sort }).to eq([1, 2, 3])
29
+ end
30
+ end
31
+ end
32
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ar-octopus-master
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2.master
4
+ version: 0.9.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thiago Pradi
@@ -180,7 +180,166 @@ email:
180
180
  executables: []
181
181
  extensions: []
182
182
  extra_rdoc_files: []
183
- files: []
183
+ files:
184
+ - ".gitignore"
185
+ - ".rspec"
186
+ - ".rubocop.yml"
187
+ - ".rubocop_todo.yml"
188
+ - ".travis.yml"
189
+ - Appraisals
190
+ - Gemfile
191
+ - README.mkdn
192
+ - Rakefile
193
+ - TODO.txt
194
+ - ar-octopus.gemspec
195
+ - gemfiles/rails4.gemfile
196
+ - gemfiles/rails41.gemfile
197
+ - gemfiles/rails42.gemfile
198
+ - gemfiles/rails5.gemfile
199
+ - gemfiles/rails51.gemfile
200
+ - lib/ar-octopus.rb
201
+ - lib/octopus.rb
202
+ - lib/octopus/abstract_adapter.rb
203
+ - lib/octopus/association.rb
204
+ - lib/octopus/association_shard_tracking.rb
205
+ - lib/octopus/collection_association.rb
206
+ - lib/octopus/collection_proxy.rb
207
+ - lib/octopus/exception.rb
208
+ - lib/octopus/finder_methods.rb
209
+ - lib/octopus/has_and_belongs_to_many_association.rb
210
+ - lib/octopus/load_balancing.rb
211
+ - lib/octopus/load_balancing/round_robin.rb
212
+ - lib/octopus/log_subscriber.rb
213
+ - lib/octopus/migration.rb
214
+ - lib/octopus/model.rb
215
+ - lib/octopus/persistence.rb
216
+ - lib/octopus/proxy.rb
217
+ - lib/octopus/proxy_config.rb
218
+ - lib/octopus/query_cache_for_shards.rb
219
+ - lib/octopus/railtie.rb
220
+ - lib/octopus/relation_proxy.rb
221
+ - lib/octopus/result_patch.rb
222
+ - lib/octopus/scope_proxy.rb
223
+ - lib/octopus/shard_tracking.rb
224
+ - lib/octopus/shard_tracking/attribute.rb
225
+ - lib/octopus/shard_tracking/dynamic.rb
226
+ - lib/octopus/singular_association.rb
227
+ - lib/octopus/slave_group.rb
228
+ - lib/octopus/version.rb
229
+ - lib/tasks/octopus.rake
230
+ - sample_app/.gitignore
231
+ - sample_app/.rspec
232
+ - sample_app/Gemfile
233
+ - sample_app/README
234
+ - sample_app/README.rdoc
235
+ - sample_app/Rakefile
236
+ - sample_app/app/assets/images/rails.png
237
+ - sample_app/app/assets/javascripts/application.js
238
+ - sample_app/app/assets/stylesheets/application.css
239
+ - sample_app/app/controllers/application_controller.rb
240
+ - sample_app/app/helpers/application_helper.rb
241
+ - sample_app/app/mailers/.gitkeep
242
+ - sample_app/app/models/.gitkeep
243
+ - sample_app/app/models/item.rb
244
+ - sample_app/app/models/user.rb
245
+ - sample_app/app/views/layouts/application.html.erb
246
+ - sample_app/autotest/discover.rb
247
+ - sample_app/config.ru
248
+ - sample_app/config/application.rb
249
+ - sample_app/config/boot.rb
250
+ - sample_app/config/cucumber.yml
251
+ - sample_app/config/database.yml
252
+ - sample_app/config/environment.rb
253
+ - sample_app/config/environments/development.rb
254
+ - sample_app/config/environments/production.rb
255
+ - sample_app/config/environments/test.rb
256
+ - sample_app/config/initializers/backtrace_silencers.rb
257
+ - sample_app/config/initializers/inflections.rb
258
+ - sample_app/config/initializers/mime_types.rb
259
+ - sample_app/config/initializers/secret_token.rb
260
+ - sample_app/config/initializers/session_store.rb
261
+ - sample_app/config/initializers/wrap_parameters.rb
262
+ - sample_app/config/locales/en.yml
263
+ - sample_app/config/routes.rb
264
+ - sample_app/config/shards.yml
265
+ - sample_app/db/migrate/20100720172715_create_users.rb
266
+ - sample_app/db/migrate/20100720172730_create_items.rb
267
+ - sample_app/db/migrate/20100720210335_create_sample_users.rb
268
+ - sample_app/db/schema.rb
269
+ - sample_app/db/seeds.rb
270
+ - sample_app/doc/README_FOR_APP
271
+ - sample_app/features/migrate.feature
272
+ - sample_app/features/seed.feature
273
+ - sample_app/features/step_definitions/seeds_steps.rb
274
+ - sample_app/features/step_definitions/web_steps.rb
275
+ - sample_app/features/support/database.rb
276
+ - sample_app/features/support/env.rb
277
+ - sample_app/features/support/paths.rb
278
+ - sample_app/lib/assets/.gitkeep
279
+ - sample_app/lib/tasks/.gitkeep
280
+ - sample_app/lib/tasks/cucumber.rake
281
+ - sample_app/log/.gitkeep
282
+ - sample_app/public/404.html
283
+ - sample_app/public/422.html
284
+ - sample_app/public/500.html
285
+ - sample_app/public/favicon.ico
286
+ - sample_app/public/images/rails.png
287
+ - sample_app/public/index.html
288
+ - sample_app/public/javascripts/application.js
289
+ - sample_app/public/javascripts/controls.js
290
+ - sample_app/public/javascripts/dragdrop.js
291
+ - sample_app/public/javascripts/effects.js
292
+ - sample_app/public/javascripts/prototype.js
293
+ - sample_app/public/javascripts/rails.js
294
+ - sample_app/public/robots.txt
295
+ - sample_app/public/stylesheets/.gitkeep
296
+ - sample_app/script/cucumber
297
+ - sample_app/script/rails
298
+ - sample_app/spec/models/item_spec.rb
299
+ - sample_app/spec/models/user_spec.rb
300
+ - sample_app/spec/spec_helper.rb
301
+ - sample_app/vendor/assets/javascripts/.gitkeep
302
+ - sample_app/vendor/assets/stylesheets/.gitkeep
303
+ - sample_app/vendor/plugins/.gitkeep
304
+ - spec/config/shards.yml
305
+ - spec/migrations/10_create_users_using_replication.rb
306
+ - spec/migrations/11_add_field_in_all_slaves.rb
307
+ - spec/migrations/12_create_users_using_block.rb
308
+ - spec/migrations/13_create_users_using_block_and_using.rb
309
+ - spec/migrations/14_create_users_on_shards_of_a_group_with_versions.rb
310
+ - spec/migrations/15_create_user_on_shards_of_default_group_with_versions.rb
311
+ - spec/migrations/1_create_users_on_master.rb
312
+ - spec/migrations/2_create_users_on_canada.rb
313
+ - spec/migrations/3_create_users_on_both_shards.rb
314
+ - spec/migrations/4_create_users_on_shards_of_a_group.rb
315
+ - spec/migrations/5_create_users_on_multiples_groups.rb
316
+ - spec/migrations/6_raise_exception_with_invalid_shard_name.rb
317
+ - spec/migrations/7_raise_exception_with_invalid_multiple_shard_names.rb
318
+ - spec/migrations/8_raise_exception_with_invalid_group_name.rb
319
+ - spec/migrations/9_raise_exception_with_multiple_invalid_group_names.rb
320
+ - spec/octopus/association_shard_tracking_spec.rb
321
+ - spec/octopus/collection_proxy_spec.rb
322
+ - spec/octopus/load_balancing/round_robin_spec.rb
323
+ - spec/octopus/log_subscriber_spec.rb
324
+ - spec/octopus/migration_spec.rb
325
+ - spec/octopus/model_spec.rb
326
+ - spec/octopus/octopus_spec.rb
327
+ - spec/octopus/proxy_spec.rb
328
+ - spec/octopus/query_cache_for_shards_spec.rb
329
+ - spec/octopus/relation_proxy_spec.rb
330
+ - spec/octopus/replicated_slave_grouped_spec.rb
331
+ - spec/octopus/replication_spec.rb
332
+ - spec/octopus/scope_proxy_spec.rb
333
+ - spec/octopus/sharded_replicated_slave_grouped_spec.rb
334
+ - spec/octopus/sharded_spec.rb
335
+ - spec/spec_helper.rb
336
+ - spec/support/active_record/connection_adapters/modify_config_adapter.rb
337
+ - spec/support/database_connection.rb
338
+ - spec/support/database_models.rb
339
+ - spec/support/octopus_helper.rb
340
+ - spec/support/query_count.rb
341
+ - spec/support/shared_contexts.rb
342
+ - spec/tasks/octopus.rake_spec.rb
184
343
  homepage: https://github.com/tchandy/octopus
185
344
  licenses:
186
345
  - MIT
@@ -200,13 +359,52 @@ required_ruby_version: !ruby/object:Gem::Requirement
200
359
  version: 2.1.0
201
360
  required_rubygems_version: !ruby/object:Gem::Requirement
202
361
  requirements:
203
- - - ">"
362
+ - - ">="
204
363
  - !ruby/object:Gem::Version
205
- version: 1.3.1
364
+ version: '0'
206
365
  requirements: []
207
366
  rubyforge_project:
208
367
  rubygems_version: 2.7.6
209
368
  signing_key:
210
369
  specification_version: 4
211
370
  summary: Easy Database Sharding for ActiveRecord
212
- test_files: []
371
+ test_files:
372
+ - spec/config/shards.yml
373
+ - spec/migrations/10_create_users_using_replication.rb
374
+ - spec/migrations/11_add_field_in_all_slaves.rb
375
+ - spec/migrations/12_create_users_using_block.rb
376
+ - spec/migrations/13_create_users_using_block_and_using.rb
377
+ - spec/migrations/14_create_users_on_shards_of_a_group_with_versions.rb
378
+ - spec/migrations/15_create_user_on_shards_of_default_group_with_versions.rb
379
+ - spec/migrations/1_create_users_on_master.rb
380
+ - spec/migrations/2_create_users_on_canada.rb
381
+ - spec/migrations/3_create_users_on_both_shards.rb
382
+ - spec/migrations/4_create_users_on_shards_of_a_group.rb
383
+ - spec/migrations/5_create_users_on_multiples_groups.rb
384
+ - spec/migrations/6_raise_exception_with_invalid_shard_name.rb
385
+ - spec/migrations/7_raise_exception_with_invalid_multiple_shard_names.rb
386
+ - spec/migrations/8_raise_exception_with_invalid_group_name.rb
387
+ - spec/migrations/9_raise_exception_with_multiple_invalid_group_names.rb
388
+ - spec/octopus/association_shard_tracking_spec.rb
389
+ - spec/octopus/collection_proxy_spec.rb
390
+ - spec/octopus/load_balancing/round_robin_spec.rb
391
+ - spec/octopus/log_subscriber_spec.rb
392
+ - spec/octopus/migration_spec.rb
393
+ - spec/octopus/model_spec.rb
394
+ - spec/octopus/octopus_spec.rb
395
+ - spec/octopus/proxy_spec.rb
396
+ - spec/octopus/query_cache_for_shards_spec.rb
397
+ - spec/octopus/relation_proxy_spec.rb
398
+ - spec/octopus/replicated_slave_grouped_spec.rb
399
+ - spec/octopus/replication_spec.rb
400
+ - spec/octopus/scope_proxy_spec.rb
401
+ - spec/octopus/sharded_replicated_slave_grouped_spec.rb
402
+ - spec/octopus/sharded_spec.rb
403
+ - spec/spec_helper.rb
404
+ - spec/support/active_record/connection_adapters/modify_config_adapter.rb
405
+ - spec/support/database_connection.rb
406
+ - spec/support/database_models.rb
407
+ - spec/support/octopus_helper.rb
408
+ - spec/support/query_count.rb
409
+ - spec/support/shared_contexts.rb
410
+ - spec/tasks/octopus.rake_spec.rb