rails-sharding 1.1.2 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.env.example +4 -0
- data/.gitignore +1 -0
- data/README.md +45 -28
- data/lib/rails/sharding.rb +0 -2
- data/lib/rails/sharding/active_record_extensions.rb +1 -1
- data/lib/rails/sharding/core.rb +7 -6
- data/lib/rails/sharding/shard_thread_registry.rb +1 -0
- data/lib/rails/sharding/shardable_model.rb +10 -1
- data/lib/rails/sharding/version.rb +1 -1
- data/lib/tasks/rails-sharding.rake +44 -37
- data/rails-sharding.gemspec +21 -22
- metadata +22 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b542040ae9301ac69b9ce91bd32321c41b25638257a76499171a8e2cc0f56c3
|
4
|
+
data.tar.gz: 01a21bafcf195bb8e63943f99a8044a905b10999d1800a98d2260b7e126e1d4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 634c7ab62a151f7b07cb5f3faae84eec62b3a488dd7bd29c406effc8ac42085ef1470bc38c2fbeceec1cad8d42d50eb20269b0bbfa28d03c35855de5263286c6
|
7
|
+
data.tar.gz: ec85fb6f79150cfd31dea3a6767be50046c447bb908e9366fa6ba7484acd0004d50f40bac839449e2f6d72b5f2b5596fa3bb7b2b6c9752b2d20b1c7fbfbd7df5
|
data/.env.example
ADDED
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -8,22 +8,24 @@
|
|
8
8
|
|
9
9
|
Simple and robust sharding gem for Rails, including Migrations and ActiveRecord extensions
|
10
10
|
|
11
|
-
This gems allows you to easily create extra databases to your rails application, and freely allocate ActiveRecord instances to any of the databases.
|
11
|
+
This gems allows you to easily create extra databases to your rails application, and freely allocate ActiveRecord instances to any of the databases.
|
12
12
|
|
13
13
|
Accessing shards is as simple as:
|
14
|
+
|
14
15
|
```ruby
|
15
16
|
# creating a user to a specific shard
|
16
17
|
new_user = User.using_shard(:shard_group1, :shard1).create(username: 'x')
|
17
|
-
|
18
|
+
|
18
19
|
# retrieving a user from a specific shard
|
19
20
|
loaded_user = User.using_shard(:shard_group1, :shard1).where(username: 'x').first
|
20
21
|
```
|
21
22
|
|
22
23
|
You can also use the block syntax:
|
24
|
+
|
23
25
|
```ruby
|
24
26
|
Rails::Sharding.using_shard(:shard_group1, :shard1) do
|
25
27
|
# All statements inside this block will go to the selected shard
|
26
|
-
|
28
|
+
|
27
29
|
# Do some queries
|
28
30
|
new_user = User.create(username: 'x')
|
29
31
|
loaded_user = User.where(username: 'x').first
|
@@ -34,14 +36,16 @@ You can also use the block syntax:
|
|
34
36
|
You can also pick and choose which models will be shardable. Non shardable models will be retrieved from the master database, even if inside a `using_shard` block.
|
35
37
|
|
36
38
|
## Compatibility
|
39
|
+
|
37
40
|
Gem version 1.x.x:
|
38
|
-
|
39
|
-
|
41
|
+
|
42
|
+
- Rails 5.0, 5.1 and 5.2
|
43
|
+
- Databases: MySQL, MariaDB, Postgres
|
40
44
|
|
41
45
|
Gem version 0.x.x:
|
42
|
-
* Rails 4.2
|
43
|
-
* Databases: MySQL, MariaDB
|
44
46
|
|
47
|
+
- Rails 4.2
|
48
|
+
- Databases: MySQL, MariaDB
|
45
49
|
|
46
50
|
## Installation
|
47
51
|
|
@@ -52,6 +56,7 @@ gem 'rails-sharding'
|
|
52
56
|
```
|
53
57
|
|
54
58
|
And then execute:
|
59
|
+
|
55
60
|
```
|
56
61
|
bundle
|
57
62
|
```
|
@@ -59,19 +64,21 @@ bundle
|
|
59
64
|
## Creating Shards
|
60
65
|
|
61
66
|
To start with the rails-sharding gem, run the command
|
67
|
+
|
62
68
|
```
|
63
69
|
rails g rails_sharding:scaffold
|
64
70
|
```
|
65
71
|
|
66
72
|
This will generate a `config/shards.yml.example` like this:
|
73
|
+
|
67
74
|
```ruby
|
68
75
|
default: &default
|
69
76
|
adapter: mysql2
|
70
77
|
encoding: utf8
|
71
78
|
reconnect: false
|
72
79
|
pool: 5
|
73
|
-
username:
|
74
|
-
password:
|
80
|
+
username: <%= ENV["MYSQL_USERNAME"] %>
|
81
|
+
password: <%= ENV["MYSQL_PASSWORD"] %>
|
75
82
|
socket: /var/run/mysqld/mysqld.sock
|
76
83
|
|
77
84
|
development:
|
@@ -85,23 +92,24 @@ development:
|
|
85
92
|
...
|
86
93
|
```
|
87
94
|
|
88
|
-
Rename it to `config/shards.yml` and change it to your database configuration. This example file defines a single shard group (named `shard_group1`) containing two shards (`shard1` and `shard2`).
|
95
|
+
Rename it to `config/shards.yml` and change it to your database configuration. This example file defines a single shard group (named `shard_group1`) containing two shards (`shard1` and `shard2`).
|
89
96
|
|
90
97
|
**A shard group is a set of shards that should have the same schema.**
|
91
98
|
|
92
99
|
When you're ready to create the shards run
|
100
|
+
|
93
101
|
```
|
94
102
|
rake shards:create
|
95
103
|
```
|
96
104
|
|
97
105
|
## Migrating Shards
|
98
|
-
Go to the directory `db/shards_migrations/shard_group1` and add all migrations that you want to run on the shards of `shard_group1`. By design, all shards in a same group should always have the same schema.
|
99
106
|
|
107
|
+
Go to the directory `db/shards_migrations/shard_group1` and add all migrations that you want to run on the shards of `shard_group1`. By design, all shards in a same group should always have the same schema.
|
100
108
|
|
101
109
|
As of now, there is no generator for migrations. You can use the regular rails generator and move the migrations to the `shards_migration` folder.
|
102
110
|
|
103
|
-
|
104
111
|
For example, add the following migration to your `db/shards_migrations/shard_group1`:
|
112
|
+
|
105
113
|
```ruby
|
106
114
|
# 20160808000000_create_users.rb
|
107
115
|
class CreateClients < ActiveRecord::Migration[5.0]
|
@@ -119,11 +127,13 @@ end
|
|
119
127
|
```
|
120
128
|
|
121
129
|
Then run:
|
130
|
+
|
122
131
|
```
|
123
132
|
rake shards:migrate
|
124
133
|
```
|
125
134
|
|
126
135
|
All the shards will be migrated, and one schema file will be dumped for each of the shards (just like rails would do for your master database). You can see the schema of the shards in `db/shards_schemas/shard_group1/`, and it will be something like:
|
136
|
+
|
127
137
|
```ruby
|
128
138
|
ActiveRecord::Schema.define(version: 20160808000000) do
|
129
139
|
|
@@ -137,32 +147,37 @@ end
|
|
137
147
|
```
|
138
148
|
|
139
149
|
## Other rake tasks
|
150
|
+
|
140
151
|
The rails-sharding gem offers several rake tasks analogous to the ones offered by ActiveRecord:
|
152
|
+
|
141
153
|
```
|
142
|
-
rake shards:create
|
143
|
-
rake shards:drop
|
144
|
-
rake shards:migrate
|
145
|
-
rake shards:migrate:down
|
146
|
-
rake shards:migrate:redo
|
147
|
-
rake shards:migrate:reset
|
148
|
-
rake shards:migrate:up
|
149
|
-
rake shards:rollback
|
150
|
-
rake shards:schema:dump
|
151
|
-
rake shards:schema:load
|
152
|
-
rake shards:test:load_schema
|
153
|
-
rake shards:test:prepare
|
154
|
-
rake shards:test:purge
|
154
|
+
rake shards:create
|
155
|
+
rake shards:drop
|
156
|
+
rake shards:migrate
|
157
|
+
rake shards:migrate:down
|
158
|
+
rake shards:migrate:redo
|
159
|
+
rake shards:migrate:reset
|
160
|
+
rake shards:migrate:up
|
161
|
+
rake shards:rollback
|
162
|
+
rake shards:schema:dump
|
163
|
+
rake shards:schema:load
|
164
|
+
rake shards:test:load_schema
|
165
|
+
rake shards:test:prepare
|
166
|
+
rake shards:test:purge
|
155
167
|
rake shards:version
|
156
168
|
```
|
157
169
|
|
158
170
|
They work just the same as the tasks `rake:db:...` but they operate on all shards of all shard groups. If you want to run a rake task just to a specific shard group or shard you can use the `SHARD_GROUP` and `SHARD` options:
|
171
|
+
|
159
172
|
```
|
160
173
|
rake shards:migrate SHARD_GROUP=shard_group_1
|
161
174
|
rake shards:migrate SHARD_GROUP=shard_group_1 SHARD=shard1
|
162
175
|
```
|
163
176
|
|
164
177
|
## Gem Options
|
178
|
+
|
165
179
|
Running the `rails g rails_sharding:scaffold` will create an initializer at `config/initializers/rails-sharding.rb`. You can pass additional configurations on this initializer to control the gem behavior. You can see below all available options and their default values:
|
180
|
+
|
166
181
|
```ruby
|
167
182
|
# config/initializers/rails-sharding.rb
|
168
183
|
|
@@ -189,23 +204,25 @@ end
|
|
189
204
|
```
|
190
205
|
|
191
206
|
## Wiki
|
207
|
+
|
192
208
|
Want to know more? How to integrate with RSpec, Capistrano, etc? Take a look at our [wiki](https://github.com/hsgubert/rails-sharding/wiki).
|
193
209
|
|
194
210
|
## Development and Contributing
|
195
211
|
|
196
212
|
After checking out the repo:
|
197
213
|
|
198
|
-
1. Run `bundle` to install gems
|
214
|
+
1. Run `bundle` to install gems
|
199
215
|
|
200
216
|
1. Create your `spec/fixtures/shards.yml` based on the example on this same folder (you need MySQL and Postgres)
|
201
217
|
|
202
|
-
1.
|
218
|
+
1. Create your `.env` based on the example on this same folder.
|
219
|
+
|
220
|
+
1. Run `rake db:test:prepare` to create the test shards.
|
203
221
|
|
204
222
|
1. Run `rspec` to run the tests.
|
205
223
|
|
206
224
|
Bug reports and pull requests are welcome on GitHub at https://github.com/hsgubert/rails-sharding.
|
207
225
|
|
208
|
-
|
209
226
|
## License
|
210
227
|
|
211
228
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/lib/rails/sharding.rb
CHANGED
@@ -8,11 +8,9 @@ require 'rails/sharding/railtie' if defined?(Rails::Railtie)
|
|
8
8
|
|
9
9
|
module Rails
|
10
10
|
module Sharding
|
11
|
-
|
12
11
|
# delegates all methods to Core, to shorten method calls
|
13
12
|
def self.method_missing(method_sym, *arguments, &block)
|
14
13
|
Core.send(method_sym, *arguments, &block)
|
15
14
|
end
|
16
|
-
|
17
15
|
end
|
18
16
|
end
|
@@ -78,7 +78,7 @@ module Rails::Sharding
|
|
78
78
|
alias_method :eql?, :==
|
79
79
|
end
|
80
80
|
|
81
|
-
# Fixes case
|
81
|
+
# Fixes case-when behavior when ScopeProxy is passed to case
|
82
82
|
# (otherwise classes don't match)
|
83
83
|
module CaseFixer
|
84
84
|
def ===(other)
|
data/lib/rails/sharding/core.rb
CHANGED
@@ -13,10 +13,11 @@ module Rails::Sharding
|
|
13
13
|
ShardThreadRegistry.push_current_shard(shard_group, shard_name)
|
14
14
|
yield
|
15
15
|
ensure
|
16
|
+
was_connected_to_master = ShardThreadRegistry.connecting_to_master?
|
16
17
|
shard_group, shard_name, connection_used = ShardThreadRegistry.pop_current_shard
|
17
18
|
|
18
|
-
# shows warning to user
|
19
|
-
if Config.no_connection_retrieved_warning && !connection_used
|
19
|
+
# shows warning to user (except when connected to master database)
|
20
|
+
if Config.no_connection_retrieved_warning && !connection_used && !was_connected_to_master
|
20
21
|
puts "Warning: no connection to shard '#{shard_group}:#{shard_name}' was retrieved inside the using_shard block. Make sure you don't forget to include Rails::Sharding::ShardableModel to the models you want to be sharded. Disable this warning with Rails::Sharding::Config.no_connection_retrieved_warning = false."
|
21
22
|
end
|
22
23
|
|
@@ -28,11 +29,11 @@ module Rails::Sharding
|
|
28
29
|
end
|
29
30
|
|
30
31
|
def self.configurations(environment=Rails.env)
|
31
|
-
@@db_configs ||= YAML.
|
32
|
+
@@db_configs ||= YAML.load(ERB.new(File.read(Config.shards_config_file)).result)
|
32
33
|
environment_config = @@db_configs[environment]
|
33
34
|
return environment_config if environment_config
|
34
35
|
|
35
|
-
raise Errors::ConfigNotFoundError, 'Found no shard configurations for
|
36
|
+
raise Errors::ConfigNotFoundError, 'Found no shard configurations for environment "' + environment + '" in ' + Config.shards_config_file.to_s + ' file was not found'
|
36
37
|
rescue Errno::ENOENT
|
37
38
|
raise Errors::ConfigNotFoundError, Config.shards_config_file.to_s + ' file was not found'
|
38
39
|
end
|
@@ -56,11 +57,11 @@ module Rails::Sharding
|
|
56
57
|
# yields a block for each shard in each shard group, with its configurations
|
57
58
|
# shard_group_filter: if passed yields only shards of this group
|
58
59
|
# shard_name_filter: if passed yields only shards with this name
|
59
|
-
def self.for_each_shard(shard_group_filter
|
60
|
+
def self.for_each_shard(environment:Rails.env, shard_group_filter:nil, shard_name_filter:nil)
|
60
61
|
shard_group_filter.to_s if shard_group_filter
|
61
62
|
shard_name_filter.to_s if shard_name_filter
|
62
63
|
|
63
|
-
configurations.each do |shard_group, shards_configurations|
|
64
|
+
configurations(environment).each do |shard_group, shards_configurations|
|
64
65
|
next if shard_group_filter && shard_group_filter != shard_group.to_s
|
65
66
|
|
66
67
|
shards_configurations.each do |shard, configuration|
|
@@ -52,7 +52,7 @@ module Rails::Sharding
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
# @overrides ActiveRecord::ConnectionHandling#
|
55
|
+
# @overrides ActiveRecord::ConnectionHandling#connected?
|
56
56
|
def sharded_connected?
|
57
57
|
if ShardThreadRegistry.connecting_to_master?
|
58
58
|
return original_connected?
|
@@ -107,6 +107,15 @@ module Rails::Sharding
|
|
107
107
|
return ConnectionHandler.connection_handler.clear_all_connections!
|
108
108
|
end
|
109
109
|
end
|
110
|
+
|
111
|
+
# @overrides ActiveRecord::ConnectionHandling#flush_idle_connections!
|
112
|
+
def sharded_flush_idle_connections!
|
113
|
+
if ShardThreadRegistry.connecting_to_master?
|
114
|
+
return original_flush_idle_connections!
|
115
|
+
else
|
116
|
+
return ConnectionHandler.connection_handler.flush_idle_connections!
|
117
|
+
end
|
118
|
+
end
|
110
119
|
end
|
111
120
|
|
112
121
|
end
|
@@ -27,25 +27,32 @@ shards_namespace = namespace :shards do
|
|
27
27
|
|
28
28
|
desc "Creates database shards (options: RAILS_ENV=x SHARD_GROUP=x SHARD=x)"
|
29
29
|
task create: [:environment] do
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
# creates DB for both development and test envs, when in development
|
31
|
+
each_current_environment do |environment|
|
32
|
+
Rails::Sharding.for_each_shard(environment: environment, shard_group_filter: ENV["SHARD_GROUP"], shard_name_filter: ENV["SHARD"]) do |shard_group, shard, configuration|
|
33
|
+
puts "== Creating shard #{shard_group}:#{shard}"
|
34
|
+
|
35
|
+
ActiveRecord::Tasks::DatabaseTasks.create(configuration)
|
36
|
+
end
|
33
37
|
end
|
34
38
|
end
|
35
39
|
|
36
40
|
desc "Drops database shards (options: RAILS_ENV=x SHARD_GROUP=x SHARD=x)"
|
37
41
|
task drop: [:environment, :check_protected_environments] do
|
38
|
-
|
39
|
-
|
42
|
+
# drops DB for both development and test envs, when in development
|
43
|
+
each_current_environment do |environment|
|
44
|
+
Rails::Sharding.for_each_shard(shard_group_filter: ENV["SHARD_GROUP"], shard_name_filter: ENV["SHARD"]) do |shard_group, shard, configuration|
|
45
|
+
puts "== Dropping shard #{shard_group}:#{shard}"
|
40
46
|
|
41
|
-
|
42
|
-
|
47
|
+
# closes connections with shard before dropping (postgres requires this, mysql does not but there is no harm)
|
48
|
+
Rails::Sharding::ConnectionHandler.remove_connection(shard_group, shard)
|
43
49
|
|
44
|
-
|
50
|
+
ActiveRecord::Tasks::DatabaseTasks.drop(configuration)
|
45
51
|
|
46
|
-
|
47
|
-
|
48
|
-
|
52
|
+
# reestablishes connection (because we removed before). You can do this even if the database does not exist yet,
|
53
|
+
# you just cannot retrieve the connection yet.
|
54
|
+
Rails::Sharding::ConnectionHandler.establish_connection(shard_group, shard)
|
55
|
+
end
|
49
56
|
end
|
50
57
|
end
|
51
58
|
|
@@ -91,7 +98,7 @@ shards_namespace = namespace :shards do
|
|
91
98
|
task dump: [:_make_activerecord_base_shardable] do
|
92
99
|
require "active_record/schema_dumper"
|
93
100
|
|
94
|
-
Rails::Sharding.for_each_shard(ENV["SHARD_GROUP"], ENV["SHARD"]) do |shard_group, shard, _configuration|
|
101
|
+
Rails::Sharding.for_each_shard(shard_group_filter: ENV["SHARD_GROUP"], shard_name_filter: ENV["SHARD"]) do |shard_group, shard, _configuration|
|
95
102
|
puts "== Dumping schema of #{shard_group}:#{shard}"
|
96
103
|
|
97
104
|
schema_filename = shard_schema_path(shard_group, shard)
|
@@ -216,7 +223,7 @@ shards_namespace = namespace :shards do
|
|
216
223
|
|
217
224
|
desc "Retrieves the current schema version number"
|
218
225
|
task version: [:_make_activerecord_base_shardable] do
|
219
|
-
Rails::Sharding.for_each_shard(ENV["SHARD_GROUP"], ENV["SHARD"]) do |shard_group, shard, _configuration|
|
226
|
+
Rails::Sharding.for_each_shard(shard_group_filter: ENV["SHARD_GROUP"], shard_name_filter: ENV["SHARD"]) do |shard_group, shard, _configuration|
|
220
227
|
Rails::Sharding.using_shard(shard_group, shard) do
|
221
228
|
puts "Shard #{shard_group}:#{shard} version: #{ActiveRecord::Migrator.current_version}"
|
222
229
|
end
|
@@ -273,32 +280,23 @@ shards_namespace = namespace :shards do
|
|
273
280
|
end
|
274
281
|
|
275
282
|
desc "Empty the test shards (drops all tables) (options: SHARD_GROUP=x, SHARD=x)"
|
276
|
-
task :
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
end
|
292
|
-
ensure
|
293
|
-
if should_reconnect
|
294
|
-
# reestablishes connection for RAILS_ENV environment (whatever that is)
|
295
|
-
Rails::Sharding::ConnectionHandler.establish_connection(shard_group, shard)
|
296
|
-
end
|
283
|
+
task purge: [:_make_activerecord_base_shardable] do
|
284
|
+
Rails::Sharding.for_each_shard(environment: 'test', shard_group_filter: ENV["SHARD_GROUP"], shard_name_filter: ENV["SHARD"]) do |shard_group, shard, configuration|
|
285
|
+
puts "== Purging test shard #{shard_group}:#{shard}"
|
286
|
+
begin
|
287
|
+
# establishes connection with test shard, saving if it was connected before (rails 4.2 doesn't do this, but should)
|
288
|
+
should_reconnect = Rails::Sharding::ConnectionHandler.connection_pool(shard_group, shard).active_connection?
|
289
|
+
Rails::Sharding::ConnectionHandler.establish_connection(shard_group, shard, 'test')
|
290
|
+
|
291
|
+
Rails::Sharding.using_shard(shard_group, shard) do
|
292
|
+
ActiveRecord::Tasks::DatabaseTasks.purge(configuration)
|
293
|
+
end
|
294
|
+
ensure
|
295
|
+
if should_reconnect
|
296
|
+
# reestablishes connection for RAILS_ENV environment (whatever that is)
|
297
|
+
Rails::Sharding::ConnectionHandler.establish_connection(shard_group, shard)
|
297
298
|
end
|
298
299
|
end
|
299
|
-
ensure
|
300
|
-
# restores rails env
|
301
|
-
Rails.env = initial_rails_env
|
302
300
|
end
|
303
301
|
end
|
304
302
|
end
|
@@ -325,4 +323,13 @@ shards_namespace = namespace :shards do
|
|
325
323
|
raise error_message unless version
|
326
324
|
version
|
327
325
|
end
|
326
|
+
|
327
|
+
def each_current_environment
|
328
|
+
environments = [Rails.env]
|
329
|
+
environments << "test" if environments == ["development"]
|
330
|
+
|
331
|
+
environments.each do |env|
|
332
|
+
yield env
|
333
|
+
end
|
334
|
+
end
|
328
335
|
end
|
data/rails-sharding.gemspec
CHANGED
@@ -1,36 +1,35 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require 'rails/sharding/version'
|
5
4
|
|
6
5
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
6
|
+
spec.name = 'rails-sharding'
|
8
7
|
spec.version = Rails::Sharding::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
8
|
+
spec.authors = ['Henrique Gubert']
|
9
|
+
spec.email = ['guberthenrique@hotmail.com']
|
11
10
|
|
12
|
-
spec.summary =
|
13
|
-
Migrations and ActiveRecord extensions
|
14
|
-
spec.description =
|
11
|
+
spec.summary = 'Simple and robust sharding for Rails, including
|
12
|
+
Migrations and ActiveRecord extensions'
|
13
|
+
spec.description = 'This gems allows you to easily create extra databases
|
15
14
|
to your rails application, and freely allocate ActiveRecord instances to
|
16
15
|
any of the databases. It also provides rake tasks and migrations to help
|
17
|
-
you manage the schema by shard groups.
|
18
|
-
spec.homepage =
|
19
|
-
spec.license =
|
16
|
+
you manage the schema by shard groups.'
|
17
|
+
spec.homepage = 'https://github.com/hsgubert/rails-sharding'
|
18
|
+
spec.license = 'MIT'
|
20
19
|
|
21
20
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
|
-
spec.bindir =
|
21
|
+
spec.bindir = 'exe'
|
23
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
-
spec.require_paths = [
|
23
|
+
spec.require_paths = ['lib']
|
25
24
|
|
26
|
-
spec.add_runtime_dependency 'rails', '~> 5.
|
25
|
+
spec.add_runtime_dependency 'rails', '~> 5.2.0'
|
27
26
|
|
28
|
-
spec.add_development_dependency
|
29
|
-
spec.add_development_dependency
|
30
|
-
spec.add_development_dependency
|
31
|
-
spec.add_development_dependency
|
32
|
-
spec.add_development_dependency
|
33
|
-
spec.add_development_dependency
|
34
|
-
spec.add_development_dependency
|
35
|
-
spec.add_development_dependency
|
27
|
+
spec.add_development_dependency 'bundler', '~> 1.17'
|
28
|
+
spec.add_development_dependency 'byebug', '~> 11'
|
29
|
+
spec.add_development_dependency 'codeclimate-test-reporter', '~> 1'
|
30
|
+
spec.add_development_dependency 'mysql2', '~> 0'
|
31
|
+
spec.add_development_dependency 'pg', '~> 0' # postgres driver
|
32
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
33
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
34
|
+
spec.add_development_dependency 'simplecov', '~> 0'
|
36
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-sharding
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henrique Gubert
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 5.
|
19
|
+
version: 5.2.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 5.
|
26
|
+
version: 5.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,49 +39,49 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.17'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: byebug
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '11'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '11'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: codeclimate-test-reporter
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '1'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '1'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: mysql2
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: pg
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
@@ -95,33 +95,33 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: rake
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
103
|
+
version: '13.0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
110
|
+
version: '13.0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: rspec
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
117
|
+
version: '3.0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
124
|
+
version: '3.0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: simplecov
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,6 +148,7 @@ extensions: []
|
|
148
148
|
extra_rdoc_files: []
|
149
149
|
files:
|
150
150
|
- ".codeclimate.yml"
|
151
|
+
- ".env.example"
|
151
152
|
- ".gitignore"
|
152
153
|
- ".rspec"
|
153
154
|
- ".ruby-gemset"
|
@@ -193,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
194
|
- !ruby/object:Gem::Version
|
194
195
|
version: '0'
|
195
196
|
requirements: []
|
196
|
-
rubygems_version: 3.0.
|
197
|
+
rubygems_version: 3.0.3
|
197
198
|
signing_key:
|
198
199
|
specification_version: 4
|
199
200
|
summary: Simple and robust sharding for Rails, including Migrations and ActiveRecord
|