rails_failover 0.6.5 → 0.7.2

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
2
  SHA256:
3
- metadata.gz: 45afa97c24a3c8f4fac5c74a52eabbf0d06b9f7ad037a76b18bee05875b4f374
4
- data.tar.gz: e57ffc9182a9b2f4145c04d4f921bcd79aee3edfec5dedacac2fb6f23d39dc9d
3
+ metadata.gz: d891800bc3c474ab5d6bb2f9c9de5143b282e0d8bca7abaaf7e961ecc0de5d2b
4
+ data.tar.gz: 6ae3d0e02913ab900e6cc4428a6c07e7ccea9e5d61325ae51d807d3ddeae0106
5
5
  SHA512:
6
- metadata.gz: 0ee4ae4e79e17881a49f77711b5f13f301977d67cd177f8d16296cff93c0aea63b9151f235acfde87afaae14f6215840fbb3efb6024a98b59c14454b88705356
7
- data.tar.gz: 48d815e482d5b6b92316431bda654709f3049647292c4a4d9b8a6a075086be2e23b12cceed898d07e10f729bc85217aa395521a49ffd1c4baad63927ed938963
6
+ metadata.gz: 56267ae5f7529d55fd1612f5e6af3e922f0930bc06416783df658aa94edafc0a6e79053097668f22fe715964fc54c9636c785bb9b6476bbcdd36cd5e8bd0994a
7
+ data.tar.gz: 05203aaec3c90fbc314bf91ed8b60a9269b88597e74e665ebdad4a9341f2cc109be81dfb3adaec2bcc356fc34180235cb8d7d0e3e39a3db3cd088d6601f17907
@@ -76,6 +76,6 @@ jobs:
76
76
  - uses: actions/checkout@v2
77
77
 
78
78
  - name: Release Gem
79
- uses: CvX/publish-rubygems-action@master
79
+ uses: CvX/publish-rubygems-action@main
80
80
  env:
81
81
  RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
data/.gitignore CHANGED
@@ -16,3 +16,4 @@
16
16
  *.rdb
17
17
 
18
18
  *.gem
19
+ Gemfile.lock
@@ -4,7 +4,15 @@ module RailsFailover
4
4
  module ActiveRecord
5
5
  class Railtie < ::Rails::Railtie
6
6
  initializer "rails_failover.init", after: "active_record.initialize_database" do |app|
7
- config = ::ActiveRecord::Base.connection_config
7
+
8
+ # AR 6.0 / 6.1 compat
9
+ config =
10
+ if ::ActiveRecord::Base.respond_to? :connection_db_config
11
+ ::ActiveRecord::Base.connection_db_config.configuration_hash
12
+ else
13
+ ::ActiveRecord::Base.connection_config
14
+ end
15
+
8
16
  app.config.active_record_rails_failover = false
9
17
 
10
18
  if !!(config[:replica_host] && config[:replica_port])
@@ -29,7 +37,7 @@ module RailsFailover
29
37
  ::ActiveRecord::Base.connection
30
38
  rescue ::ActiveRecord::NoDatabaseError
31
39
  # Do nothing since database hasn't been created
32
- rescue ::PG::Error => e
40
+ rescue ::PG::Error
33
41
  Handler.instance.verify_primary(::ActiveRecord::Base.writing_role)
34
42
  ::ActiveRecord::Base.connection_handler = ::ActiveRecord::Base.lookup_connection_handler(:reading)
35
43
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsFailover
4
- VERSION = "0.6.5"
4
+ VERSION = "0.7.2"
5
5
  end
@@ -9,8 +9,9 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ["tgx@discourse.org"]
10
10
 
11
11
  spec.summary = %q{Failover for ActiveRecord and Redis}
12
+ spec.homepage = "https://github.com/discourse/rails_failover"
12
13
  spec.license = "MIT"
13
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
14
15
 
15
16
  # Specify which files should be added to the gem when it is released.
16
17
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -21,8 +22,8 @@ Gem::Specification.new do |spec|
21
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
23
  spec.require_paths = ["lib"]
23
24
 
24
- ["activerecord", "railties"].each do |gem_name|
25
- spec.add_dependency gem_name, "~> 6.0"
26
- end
25
+ spec.add_dependency "activerecord", "~> 6.0"
26
+ spec.add_dependency "railties", "~> 6.0"
27
+
27
28
  spec.add_dependency "concurrent-ruby"
28
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_failover
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan Tan
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-16 00:00:00.000000000 Z
11
+ date: 2021-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description:
55
+ description:
56
56
  email:
57
57
  - tgx@discourse.org
58
58
  executables: []
@@ -66,7 +66,6 @@ files:
66
66
  - CHANGELOG.md
67
67
  - CODE_OF_CONDUCT.md
68
68
  - Gemfile
69
- - Gemfile.lock
70
69
  - LICENSE.txt
71
70
  - README.md
72
71
  - Rakefile
@@ -87,11 +86,11 @@ files:
87
86
  - postgresql.mk
88
87
  - rails_failover.gemspec
89
88
  - redis.mk
90
- homepage:
89
+ homepage: https://github.com/discourse/rails_failover
91
90
  licenses:
92
91
  - MIT
93
92
  metadata: {}
94
- post_install_message:
93
+ post_install_message:
95
94
  rdoc_options: []
96
95
  require_paths:
97
96
  - lib
@@ -99,15 +98,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
98
  requirements:
100
99
  - - ">="
101
100
  - !ruby/object:Gem::Version
102
- version: 2.3.0
101
+ version: 2.5.0
103
102
  required_rubygems_version: !ruby/object:Gem::Requirement
104
103
  requirements:
105
104
  - - ">="
106
105
  - !ruby/object:Gem::Version
107
106
  version: '0'
108
107
  requirements: []
109
- rubygems_version: 3.1.4
110
- signing_key:
108
+ rubygems_version: 3.0.3
109
+ signing_key:
111
110
  specification_version: 4
112
111
  summary: Failover for ActiveRecord and Redis
113
112
  test_files: []
data/Gemfile.lock DELETED
@@ -1,123 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- rails_failover (0.6.5)
5
- activerecord (~> 6.0)
6
- concurrent-ruby
7
- railties (~> 6.0)
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- actionpack (6.0.3.1)
13
- actionview (= 6.0.3.1)
14
- activesupport (= 6.0.3.1)
15
- rack (~> 2.0, >= 2.0.8)
16
- rack-test (>= 0.6.3)
17
- rails-dom-testing (~> 2.0)
18
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
19
- actionview (6.0.3.1)
20
- activesupport (= 6.0.3.1)
21
- builder (~> 3.1)
22
- erubi (~> 1.4)
23
- rails-dom-testing (~> 2.0)
24
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
25
- activemodel (6.0.3.1)
26
- activesupport (= 6.0.3.1)
27
- activerecord (6.0.3.1)
28
- activemodel (= 6.0.3.1)
29
- activesupport (= 6.0.3.1)
30
- activesupport (6.0.3.1)
31
- concurrent-ruby (~> 1.0, >= 1.0.2)
32
- i18n (>= 0.7, < 2)
33
- minitest (~> 5.1)
34
- tzinfo (~> 1.1)
35
- zeitwerk (~> 2.2, >= 2.2.2)
36
- ast (2.4.0)
37
- builder (3.2.4)
38
- byebug (11.1.3)
39
- concurrent-ruby (1.1.6)
40
- crass (1.0.6)
41
- diff-lcs (1.3)
42
- erubi (1.10.0)
43
- i18n (1.8.2)
44
- concurrent-ruby (~> 1.0)
45
- loofah (2.7.0)
46
- crass (~> 1.0.2)
47
- nokogiri (>= 1.5.9)
48
- method_source (1.0.0)
49
- mini_portile2 (2.4.0)
50
- minitest (5.14.1)
51
- nokogiri (1.10.10)
52
- mini_portile2 (~> 2.4.0)
53
- parallel (1.19.1)
54
- parser (2.7.1.2)
55
- ast (~> 2.4.0)
56
- pg (1.2.3)
57
- rack (2.2.3)
58
- rack-test (1.1.0)
59
- rack (>= 1.0, < 3)
60
- rails-dom-testing (2.0.3)
61
- activesupport (>= 4.2.0)
62
- nokogiri (>= 1.6)
63
- rails-html-sanitizer (1.3.0)
64
- loofah (~> 2.3)
65
- railties (6.0.3.1)
66
- actionpack (= 6.0.3.1)
67
- activesupport (= 6.0.3.1)
68
- method_source
69
- rake (>= 0.8.7)
70
- thor (>= 0.20.3, < 2.0)
71
- rainbow (3.0.0)
72
- rake (12.3.3)
73
- redis (4.1.4)
74
- rexml (3.2.4)
75
- rspec (3.9.0)
76
- rspec-core (~> 3.9.0)
77
- rspec-expectations (~> 3.9.0)
78
- rspec-mocks (~> 3.9.0)
79
- rspec-core (3.9.2)
80
- rspec-support (~> 3.9.3)
81
- rspec-expectations (3.9.2)
82
- diff-lcs (>= 1.2.0, < 2.0)
83
- rspec-support (~> 3.9.0)
84
- rspec-mocks (3.9.1)
85
- diff-lcs (>= 1.2.0, < 2.0)
86
- rspec-support (~> 3.9.0)
87
- rspec-support (3.9.3)
88
- rubocop (0.83.0)
89
- parallel (~> 1.10)
90
- parser (>= 2.7.0.1)
91
- rainbow (>= 2.2.2, < 4.0)
92
- rexml
93
- ruby-progressbar (~> 1.7)
94
- unicode-display_width (>= 1.4.0, < 2.0)
95
- rubocop-discourse (2.1.2)
96
- rubocop (>= 0.69.0)
97
- rubocop-rspec (>= 1.39.0)
98
- rubocop-rspec (1.39.0)
99
- rubocop (>= 0.68.1)
100
- ruby-progressbar (1.10.1)
101
- thor (1.0.1)
102
- thread_safe (0.3.6)
103
- tzinfo (1.2.7)
104
- thread_safe (~> 0.1)
105
- unicode-display_width (1.7.0)
106
- zeitwerk (2.3.0)
107
-
108
- PLATFORMS
109
- ruby
110
-
111
- DEPENDENCIES
112
- activerecord (~> 6.0)
113
- byebug
114
- pg (~> 1.2)
115
- rack
116
- rails_failover!
117
- rake (~> 12.0)
118
- redis (~> 4.1)
119
- rspec (~> 3.0)
120
- rubocop-discourse
121
-
122
- BUNDLED WITH
123
- 2.1.4