From a95466dd3b6960d7e3df7ff16a9bb3e7ec350cd4 Mon Sep 17 00:00:00 2001 From: Andrew Haines Date: Mon, 19 Aug 2024 11:51:19 +0100 Subject: [PATCH 1/4] Test against ActiveRecord 7.2 --- Gemfile.lock | 34 +++++++++++++++++----------------- bin/version-matrix | 3 ++- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5d61406..b7f6008 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,22 +8,23 @@ PATH GEM remote: https://rubygems.org/ specs: - activemodel (7.1.2) - activesupport (= 7.1.2) - activerecord (7.1.2) - activemodel (= 7.1.2) - activesupport (= 7.1.2) + activemodel (7.2.0) + activesupport (= 7.2.0) + activerecord (7.2.0) + activemodel (= 7.2.0) + activesupport (= 7.2.0) timeout (>= 0.4.0) - activesupport (7.1.2) + activesupport (7.2.0) base64 bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) ansi (1.5.0) ast (2.4.2) aws-eventstream (1.3.0) @@ -42,27 +43,26 @@ GEM aws-sigv4 (1.9.1) aws-eventstream (~> 1, >= 1.0.2) base64 (0.2.0) - bigdecimal (3.1.5) + bigdecimal (3.1.8) builder (3.3.0) coderay (1.1.3) commonmarker (0.23.10) - concurrent-ruby (1.2.2) + concurrent-ruby (1.3.4) connection_pool (2.4.1) - drb (2.2.0) - ruby2_keywords - i18n (1.14.1) + drb (2.2.1) + i18n (1.14.5) concurrent-ruby (~> 1.0) jmespath (1.6.2) json (2.7.2) language_server-protocol (3.17.0.3) + logger (1.6.0) method_source (1.0.0) - minitest (5.24.1) + minitest (5.25.1) minitest-reporters (1.7.1) ansi builder minitest (>= 5.0) ruby-progressbar - mutex_m (0.2.0) parallel (1.25.1) parser (3.3.4.0) ast (~> 2.4.1) @@ -96,7 +96,7 @@ GEM rubocop-rake (0.6.0) rubocop (~> 1.0) ruby-progressbar (1.13.0) - ruby2_keywords (0.0.5) + securerandom (0.3.1) strscan (3.1.0) timecop (0.9.10) timeout (0.4.1) diff --git a/bin/version-matrix b/bin/version-matrix index 1d81274..66e3099 100755 --- a/bin/version-matrix +++ b/bin/version-matrix @@ -25,7 +25,8 @@ ruby_pg_requirements = { activerecord_pg_requirements = { "6.1" => "~> 1.1", "7.0" => "~> 1.1", - "7.1" => "~> 1.1" + "7.1" => "~> 1.1", + "7.2" => "~> 1.1" } versions = ruby_activerecord_requirements.flat_map do |ruby_version, activerecord_requirement| From b2b6007ecb2270b6a8df89688f6a049cb90ffcae Mon Sep 17 00:00:00 2001 From: Andrew Haines Date: Mon, 19 Aug 2024 11:51:53 +0100 Subject: [PATCH 2/4] Bump bundler from 2.5.14 to 2.5.17 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b7f6008..623bdd9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -126,4 +126,4 @@ DEPENDENCIES yard BUNDLED WITH - 2.5.14 + 2.5.17 From 7bb5a1cf6a85d35d7cd96f9012009389b4656d7f Mon Sep 17 00:00:00 2001 From: Andrew Haines Date: Mon, 19 Aug 2024 11:53:09 +0100 Subject: [PATCH 3/4] Bump ruby from 3.3.3 to 3.3.4 --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index fefb2b7..6d5369b 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-3.3.3 +ruby-3.3.4 From 1988591bcf18f1f7c47e0d00cd4cd0fbede27592 Mon Sep 17 00:00:00 2001 From: Andrew Haines Date: Mon, 19 Aug 2024 11:56:42 +0100 Subject: [PATCH 4/4] Drop support for Ruby 3.0 --- .rubocop.yml | 2 +- CHANGELOG.md | 3 ++- bin/version-matrix | 2 -- lib/pg/aws_rds_iam/auth_token_generator.rb | 2 +- lib/pg/aws_rds_iam/auth_token_generator_registry.rb | 4 ++-- pg-aws_rds_iam.gemspec | 2 +- test/pg/aws_rds_iam/auth_token_generator_test.rb | 2 +- 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index f5e6015..7988df4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,7 +3,7 @@ require: - rubocop-rake AllCops: - TargetRubyVersion: 3.0 + TargetRubyVersion: 3.1 NewCops: enable Exclude: - bin/bundle diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ff8fcb..f47e1ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] -No notable changes. +### Changed +* Require Ruby ≥ 3.1 ([#653](https://github.com/haines/pg-aws_rds_iam/pull/653)) ## [0.5.0] - 2023-05-04 diff --git a/bin/version-matrix b/bin/version-matrix index 66e3099..9b5c5c1 100755 --- a/bin/version-matrix +++ b/bin/version-matrix @@ -9,14 +9,12 @@ def minor_versions(name, requirement) end ruby_activerecord_requirements = { - "3.0" => ">= 6.1", "3.1" => ">= 6.1", "3.2" => ">= 6.1", "3.3" => ">= 6.1" } ruby_pg_requirements = { - "3.0" => "> 0", "3.1" => "> 0", "3.2" => ">= 1.3", "3.3" => ">= 1.3" diff --git a/lib/pg/aws_rds_iam/auth_token_generator.rb b/lib/pg/aws_rds_iam/auth_token_generator.rb index f6c3d16..d379c79 100644 --- a/lib/pg/aws_rds_iam/auth_token_generator.rb +++ b/lib/pg/aws_rds_iam/auth_token_generator.rb @@ -11,7 +11,7 @@ class AuthTokenGenerator # @param credentials [Aws::CredentialProvider] the IAM credentials with which to sign the token # @param region [String] the AWS region in which the RDS instances are running def initialize(credentials:, region:) - @generator = Aws::RDS::AuthTokenGenerator.new(credentials: credentials) + @generator = Aws::RDS::AuthTokenGenerator.new(credentials:) @region = region end diff --git a/lib/pg/aws_rds_iam/auth_token_generator_registry.rb b/lib/pg/aws_rds_iam/auth_token_generator_registry.rb index d1bf486..e8d0971 100644 --- a/lib/pg/aws_rds_iam/auth_token_generator_registry.rb +++ b/lib/pg/aws_rds_iam/auth_token_generator_registry.rb @@ -18,8 +18,8 @@ def initialize(default_auth_token_generator_class: AuthTokenGenerator) # @param name [String, Symbol] # @return [void] # @yieldreturn [AuthTokenGenerator] - def add(name, &block) - @registry[name.to_s] = Memoizer.new(&block) + def add(name, &) + @registry[name.to_s] = Memoizer.new(&) end # Looks up an {AuthTokenGenerator} by name. diff --git a/pg-aws_rds_iam.gemspec b/pg-aws_rds_iam.gemspec index cd19d57..5605e26 100644 --- a/pg-aws_rds_iam.gemspec +++ b/pg-aws_rds_iam.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] - spec.required_ruby_version = ">= 3.0" + spec.required_ruby_version = ">= 3.1" spec.add_dependency "aws-sdk-rds", "~> 1.0" spec.add_dependency "pg", "~> 1.1" diff --git a/test/pg/aws_rds_iam/auth_token_generator_test.rb b/test/pg/aws_rds_iam/auth_token_generator_test.rb index a08db17..8c6087c 100644 --- a/test/pg/aws_rds_iam/auth_token_generator_test.rb +++ b/test/pg/aws_rds_iam/auth_token_generator_test.rb @@ -7,7 +7,7 @@ module AWS_RDS_IAM class AuthTokenGeneratorTest < Minitest::Test def setup credentials = Aws::Credentials.new("AKIAIOSFODNN7EXAMPLE", "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY") - @auth_token_generator = AuthTokenGenerator.new(credentials: credentials, region: "eu-west-2") + @auth_token_generator = AuthTokenGenerator.new(credentials:, region: "eu-west-2") end def test_generate_token