distribute_reads 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: db257dfd9b8679aad4cc3d4ee162234ee7375fda
4
- data.tar.gz: 87daf348a55b8b11e17aa6fcdb181f0233b59569
2
+ SHA256:
3
+ metadata.gz: 6ff4bc7184278bc6c6669e532f036c74e117657510a701705b8850141f3a59ed
4
+ data.tar.gz: de8307fbf47c7660b3a7c2563f5b399cd55d4b524c23550d383073fb49df68f2
5
5
  SHA512:
6
- metadata.gz: 86bd0d6b2be128b6bc20b0b6ff0eb455b7eba40f33db2d12437326f13bc60c1400ed6d3f871c84a1dd9fe97ffc5122aa4b3a93291e9c1dde8d3e4dd3814a86cc
7
- data.tar.gz: 937a288f831c21fa91546ad6ad89d4a84ea239edf6739a6936540a19cc3a0ec1d9fe19aeefea3e57ffce77d32c50bb536f9309b038c749d17fa9497976eae551
6
+ metadata.gz: b9c651428a0fccf0a02f16a8d3ab587cf54f6f3f53156e89d5eea3800ca69a2228e3fdce72215526178fab80ecad3b3b8621cc381060c784ead4259910ad3f6f
7
+ data.tar.gz: 2ba6dd00743e9819a1bf5edfc35b7fdfa5d8c34a11cc4f4c563b55275fe45d4d7d0b706aa9f3b3b2516b60c98b811f81e647c318b668e67b43297f04bbdfe3fc
data/.gitignore CHANGED
@@ -1,9 +1,9 @@
1
1
  /.bundle/
2
2
  /.yardoc
3
- /Gemfile.lock
4
3
  /_yardoc/
5
4
  /coverage/
6
5
  /doc/
7
6
  /pkg/
8
7
  /spec/reports/
9
8
  /tmp/
9
+ *.lock
data/.travis.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  sudo: false
2
2
  language: ruby
3
- rvm: 2.4.1
3
+ rvm: 2.5.1
4
4
  script: bundle exec rake test
5
5
  before_script:
6
6
  - psql -c 'create database distribute_reads_test_primary;' -U postgres
@@ -11,3 +11,4 @@ notifications:
11
11
  on_failure: change
12
12
  gemfile:
13
13
  - Gemfile
14
+ - test/gemfiles/makara3.gemfile
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.2.3
2
+
3
+ - Added support for Makara 0.4
4
+
1
5
  ## 0.2.2
2
6
 
3
7
  - Added support for MySQL replication lag
@@ -69,6 +69,14 @@ module DistributeReads
69
69
  end
70
70
  end
71
71
 
72
+ # private
73
+ def self.makara3?
74
+ unless defined?(@makara3)
75
+ @makara3 = Gem::Version.new(Makara::VERSION.to_s) < Gem::Version.new("0.4.0")
76
+ end
77
+ @makara3
78
+ end
79
+
72
80
  # legacy
73
81
  def self.default_to_primary
74
82
  !by_default
@@ -6,7 +6,13 @@ module DistributeReads
6
6
 
7
7
  included do
8
8
  before_perform do
9
- Makara::Context.set_current(Makara::Context.generate) if DistributeReads.by_default
9
+ if DistributeReads.by_default
10
+ if DistributeReads.makara3?
11
+ Makara::Context.set_current(Makara::Context.generate)
12
+ else
13
+ Makara::Context.release_all
14
+ end
15
+ end
10
16
  end
11
17
  end
12
18
 
@@ -1,3 +1,3 @@
1
1
  module DistributeReads
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: distribute_reads
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-29 00:00:00.000000000 Z
11
+ date: 2018-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: makara
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  version: '0'
150
150
  requirements: []
151
151
  rubyforge_project:
152
- rubygems_version: 2.6.13
152
+ rubygems_version: 2.7.6
153
153
  signing_key:
154
154
  specification_version: 4
155
155
  summary: Scale database reads with replicas in Rails