shard_handler 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shard_handler/model.rb +9 -4
- data/lib/shard_handler/version.rb +1 -1
- metadata +5 -13
- data/.gitignore +0 -11
- data/.rspec +0 -2
- data/.travis.yml +0 -12
- data/Gemfile +0 -6
- data/Rakefile +0 -6
- data/bin/console +0 -14
- data/bin/setup +0 -7
- data/shard_handler.gemspec +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06f210d21de1ef1056745ae9f2fb5efa0c2ccde9
|
4
|
+
data.tar.gz: dc1ef604949718dd7591fea00ae662e6c4d1b95e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 789b104dbc989d93371d72a557b08d43aad98dca1edf17c824da0e2dfe4479ba15ed7810bbd633fd0a9710e267c7208af13a894962099b584604665f42c79936
|
7
|
+
data.tar.gz: 862bf172acdb194a0da5acd1f30d309385ef60d62ee7e7f4d06d2a7541f080012de7843b5ad78142a3e979efc133bf1a9fdcda9b5365a4effa56e2a546934b2b
|
data/lib/shard_handler/model.rb
CHANGED
@@ -80,10 +80,15 @@ module ShardHandler
|
|
80
80
|
self.current_shard = shard
|
81
81
|
yield
|
82
82
|
ensure
|
83
|
-
# Returns any connections in use
|
84
|
-
#
|
85
|
-
#
|
86
|
-
|
83
|
+
# Returns any connections in use back to the pool. It is executed only
|
84
|
+
# if the shard name is different from the old one because one can call
|
85
|
+
# .using multiple times in a chain, like this:
|
86
|
+
#
|
87
|
+
# using(:shard1) do
|
88
|
+
# using(:shard1) do
|
89
|
+
# end
|
90
|
+
# end
|
91
|
+
self.clear_active_connections! if old_shard != current_shard
|
87
92
|
self.current_shard = old_shard
|
88
93
|
end
|
89
94
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shard_handler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lenon Marcel
|
@@ -9,9 +9,9 @@ authors:
|
|
9
9
|
- Lucas Nogueira
|
10
10
|
- Rodolfo Liviero
|
11
11
|
autorequire:
|
12
|
-
bindir:
|
12
|
+
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-
|
14
|
+
date: 2015-08-03 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activerecord
|
@@ -111,7 +111,7 @@ dependencies:
|
|
111
111
|
- - ">="
|
112
112
|
- !ruby/object:Gem::Version
|
113
113
|
version: '0'
|
114
|
-
description:
|
114
|
+
description: A simple sharding solution for Rails applications
|
115
115
|
email:
|
116
116
|
- lenon.marcel@gmail.com
|
117
117
|
- rafaeltimbosoares@gmail.com
|
@@ -121,22 +121,14 @@ executables: []
|
|
121
121
|
extensions: []
|
122
122
|
extra_rdoc_files: []
|
123
123
|
files:
|
124
|
-
- ".gitignore"
|
125
|
-
- ".rspec"
|
126
|
-
- ".travis.yml"
|
127
|
-
- Gemfile
|
128
124
|
- LICENSE.txt
|
129
125
|
- README.md
|
130
|
-
- Rakefile
|
131
|
-
- bin/console
|
132
|
-
- bin/setup
|
133
126
|
- lib/shard_handler.rb
|
134
127
|
- lib/shard_handler/errors.rb
|
135
128
|
- lib/shard_handler/handler.rb
|
136
129
|
- lib/shard_handler/model.rb
|
137
130
|
- lib/shard_handler/thread_registry.rb
|
138
131
|
- lib/shard_handler/version.rb
|
139
|
-
- shard_handler.gemspec
|
140
132
|
homepage: https://github.com/locaweb/shard_handler
|
141
133
|
licenses:
|
142
134
|
- MIT
|
@@ -160,6 +152,6 @@ rubyforge_project:
|
|
160
152
|
rubygems_version: 2.4.6
|
161
153
|
signing_key:
|
162
154
|
specification_version: 4
|
163
|
-
summary:
|
155
|
+
summary: A simple sharding solution for Rails applications
|
164
156
|
test_files: []
|
165
157
|
has_rdoc:
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 2.1.6
|
4
|
-
- 2.2.2
|
5
|
-
addons:
|
6
|
-
postgresql: "9.3"
|
7
|
-
before_install: gem install bundler -v 1.10.5
|
8
|
-
before_script:
|
9
|
-
- cp spec/database.yml.travis spec/database.yml
|
10
|
-
- cp spec/shards.yml.travis spec/shards.yml
|
11
|
-
script:
|
12
|
-
- bundle exec rake spec
|
data/Gemfile
DELETED
data/Rakefile
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'bundler/setup'
|
4
|
-
require 'shard_handler'
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require 'irb'
|
14
|
-
IRB.start
|
data/bin/setup
DELETED
data/shard_handler.gemspec
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'shard_handler/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = 'shard_handler'
|
8
|
-
spec.version = ShardHandler::VERSION
|
9
|
-
spec.authors = ['Lenon Marcel', 'Rafael Timbó', 'Lucas Nogueira',
|
10
|
-
'Rodolfo Liviero']
|
11
|
-
spec.email = ['lenon.marcel@gmail.com', 'rafaeltimbosoares@gmail.com',
|
12
|
-
'lukspn.27@gmail.com', 'rodolfoliviero@gmail.com']
|
13
|
-
spec.summary = 'This gem is a simple sharding solution for Rails applications'
|
14
|
-
spec.description = 'This gem is a simple sharding solution for Rails applications'
|
15
|
-
spec.homepage = 'https://github.com/locaweb/shard_handler'
|
16
|
-
spec.license = 'MIT'
|
17
|
-
|
18
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
|
-
spec.bindir = 'exe'
|
20
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
|
-
spec.require_paths = ['lib']
|
22
|
-
|
23
|
-
spec.add_dependency 'activerecord', '~> 4.2.0'
|
24
|
-
spec.add_dependency 'activesupport', '~> 4.2.0'
|
25
|
-
|
26
|
-
spec.add_development_dependency 'bundler', '~> 1.10'
|
27
|
-
spec.add_development_dependency 'rake', '~> 10.0'
|
28
|
-
spec.add_development_dependency 'rspec'
|
29
|
-
spec.add_development_dependency 'pg'
|
30
|
-
spec.add_development_dependency 'yard'
|
31
|
-
end
|