trilogy_aurora 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b68247e00782c8fd79fe8aacb267418d8615ec7cf355870df6c7a01669c44f13
4
- data.tar.gz: d7387204da336b760389f2c2baa65a64332f399ff4940e0e6a27221cc3c31cb4
3
+ metadata.gz: 30793dcf14f37f6c04d69ff701c85b709279ce88fa81301b33e749f05c5b05ba
4
+ data.tar.gz: b243bfe9899bb88ecc1b0e91472567d870161b0af6074b1db0e70584d4ccdd27
5
5
  SHA512:
6
- metadata.gz: 31cf25f9b38fc5f275d1c0fe0d61c47788fef802adb4359180b7c680f063a85aaf7c71f0b685005e522ac4a086fa424c4e631b853d994ee6d7b0f9dc68be45d5
7
- data.tar.gz: 575264af4b39956126cba399667eb958359687d0a286427092e25f2dd74b54b228313e8d48dd94cec0f80e0ec5ba6cf59a754410600a1ef29d9c84e797893d85
6
+ metadata.gz: 458345a870ba34e36d5fecc6bbaa5cb432925bf04e5e09d4bba81f62d47343cdf8e717d0c254910e2d94ae3c8a0180c57272c1c347c9f368a75befda00fb6c74
7
+ data.tar.gz: 90d3e86cbe6d04db68d2ae23547f303a2dc7d8883b34bc8af664f9a3f1f6ddd05e3c24d84c783fc146d45356f0a52bcae9230849c37c684a03f445beb5cf0110
data/.rubocop.yml CHANGED
@@ -1,4 +1,4 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-rake
3
3
  - rubocop-rspec
4
4
 
@@ -6,25 +6,11 @@ AllCops:
6
6
  TargetRubyVersion: 3.0
7
7
  NewCops: enable
8
8
 
9
- Style/StringLiterals:
10
- Enabled: true
11
- EnforcedStyle: double_quotes
12
-
13
- Style/StringLiteralsInInterpolation:
14
- Enabled: true
15
- EnforcedStyle: double_quotes
16
-
17
- Layout/LineLength:
18
- Max: 120
19
-
20
9
  Metrics/MethodLength:
21
- Max: 20
22
-
23
- RSpec/MultipleExpectations:
24
- Max: 2
25
-
26
- RSpec/NestedGroups:
27
- Max: 5
10
+ Max: 25
28
11
 
29
12
  RSpec/MessageSpies:
30
13
  Enabled: false
14
+
15
+ RSpec/NestedGroups:
16
+ Max: 4
data/Dockerfile CHANGED
@@ -1,7 +1,11 @@
1
- ARG RUBY_VERSION=3.2
1
+ ARG RUBY_VERSION=3.4
2
2
 
3
3
  FROM ruby:${RUBY_VERSION}-alpine
4
4
 
5
+ ARG TRILOGY_VERSION
6
+
7
+ ENV TRILOGY_VERSION=$TRILOGY_VERSION
8
+
5
9
  # Create application directory.
6
10
  RUN mkdir /app
7
11
  WORKDIR /app
data/Rakefile CHANGED
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
5
 
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
8
- require "rubocop/rake_task"
8
+ require 'rubocop/rake_task'
9
9
 
10
10
  RuboCop::RakeTask.new
11
11
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module TrilogyAurora
4
4
  # The version of this gem.
5
- VERSION = "0.1.0"
5
+ VERSION = '0.2.0'
6
6
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "trilogy_aurora/version"
4
- require "trilogy"
3
+ require_relative 'trilogy_aurora/version'
4
+ require 'trilogy'
5
5
 
6
6
  # This module contains Trilogy, a wrapper around ::Trilogy that handles read-only errors from Aurora.
7
7
  #
@@ -37,13 +37,13 @@ module TrilogyAurora
37
37
  begin
38
38
  trilogy.query(...)
39
39
  rescue TrilogyAurora::ORIGINAL_TRILOGY_CLASS::Error => e
40
- raise e unless e.message&.include?("--read-only")
40
+ raise e unless e.message&.include?('--read-only')
41
41
 
42
42
  try_count += 1
43
43
 
44
44
  if @disconnect_only
45
45
  warn(
46
- "[trilogy_aurora] Database is readonly, Aurora failover event likely occured, closing database connection"
46
+ '[trilogy_aurora] Database is readonly, Aurora failover event likely occured, closing database connection'
47
47
  )
48
48
  disconnect!
49
49
  elsif try_count <= @max_retry
@@ -97,6 +97,11 @@ module TrilogyAurora
97
97
  def self.const_missing(name)
98
98
  TrilogyAurora::ORIGINAL_TRILOGY_CLASS.const_get(name)
99
99
  end
100
+
101
+ # Delegate `const_defined?` to ::Trilogy.
102
+ def self.const_defined?(name, ...)
103
+ TrilogyAurora::ORIGINAL_TRILOGY_CLASS.const_defined?(name, ...)
104
+ end
100
105
  end
101
106
 
102
107
  # The original ::Trilogy class.
metadata CHANGED
@@ -1,30 +1,48 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trilogy_aurora
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aidan Lavis
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-09-04 00:00:00.000000000 Z
10
+ date: 2025-05-05 00:00:00.000000000 Z
12
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: bigdecimal
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: 3.0.2
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: 3.0.2
13
26
  - !ruby/object:Gem::Dependency
14
27
  name: trilogy
15
28
  requirement: !ruby/object:Gem::Requirement
16
29
  requirements:
17
- - - "~>"
30
+ - - ">="
18
31
  - !ruby/object:Gem::Version
19
- version: '2.5'
32
+ version: '2.3'
33
+ - - "<"
34
+ - !ruby/object:Gem::Version
35
+ version: '3.0'
20
36
  type: :runtime
21
37
  prerelease: false
22
38
  version_requirements: !ruby/object:Gem::Requirement
23
39
  requirements:
24
- - - "~>"
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '2.3'
43
+ - - "<"
25
44
  - !ruby/object:Gem::Version
26
- version: '2.5'
27
- description:
45
+ version: '3.0'
28
46
  email:
29
47
  - aidanlavis@gmail.com
30
48
  executables: []
@@ -35,7 +53,6 @@ files:
35
53
  - ".rdoc_options"
36
54
  - ".rspec"
37
55
  - ".rubocop.yml"
38
- - CHANGELOG.md
39
56
  - Dockerfile
40
57
  - LICENSE.txt
41
58
  - README.md
@@ -50,7 +67,6 @@ metadata:
50
67
  homepage_uri: https://github.com/a-lavis/trilogy_aurora
51
68
  source_code_uri: https://github.com/a-lavis/trilogy_aurora
52
69
  rubygems_mfa_required: 'true'
53
- post_install_message:
54
70
  rdoc_options: []
55
71
  require_paths:
56
72
  - lib
@@ -65,8 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
81
  - !ruby/object:Gem::Version
66
82
  version: '0'
67
83
  requirements: []
68
- rubygems_version: 3.2.33
69
- signing_key:
84
+ rubygems_version: 3.6.5
70
85
  specification_version: 4
71
86
  summary: Adds AWS Aurora failover support to Trilogy.
72
87
  test_files: []
data/CHANGELOG.md DELETED
@@ -1,5 +0,0 @@
1
- ## [Unreleased]
2
-
3
- ## [0.1.0] - 2023-09-03
4
-
5
- - Initial release