Skip to content

Commit

Permalink
Merge pull request #596 from k1LoW/drop-support-for-ruby-2.x
Browse files Browse the repository at this point in the history
fix: Drop support for Ruby 2.x
  • Loading branch information
k1LoW authored Jan 21, 2025
2 parents 7c19ade + c99a532 commit 8a14918
Show file tree
Hide file tree
Showing 18 changed files with 62 additions and 64 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,11 @@ jobs:
fail-fast: false
matrix:
ruby-version:
- '2.3'
- '2.4'
- '2.5'
- '2.6'
- '2.7'
- '3.0'
- '3.1'
- '3.2'
- '3.3'
- '3.4'
runs-on: ubuntu-latest
env:
DISABLE_AWS_CLIENT_CHECK: true
Expand Down
1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ begin
require 'rspec'
require 'rspec/core'
require 'rspec/core/rake_task'
require 'octorelease' unless ENV['CI']
require 'parallel'
require 'rubocop/rake_task'
rescue LoadError
Expand Down
4 changes: 3 additions & 1 deletion awspec.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.required_ruby_version = '>= 2.3'
spec.required_ruby_version = '>= 3.0'
spec.add_runtime_dependency 'addressable'
spec.add_runtime_dependency 'awsecrets', '~> 1'
spec.add_runtime_dependency 'aws-sdk', '~> 3'
spec.add_runtime_dependency 'base64', '~> 0.1.0'
spec.add_runtime_dependency 'dry-inflector'
spec.add_runtime_dependency 'ipaddress'
spec.add_runtime_dependency 'ostruct', '~> 0.6.1'
spec.add_runtime_dependency 'rspec', '~> 3.0'
spec.add_runtime_dependency 'rspec-its'
spec.add_runtime_dependency 'term-ansicolor'
Expand Down
62 changes: 31 additions & 31 deletions doc/resource_types.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions lib/awspec/generator/doc/type/rds_db_cluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
module Awspec::Generator
module Doc
module Type
class RdsDbCluster < Base
class RdsDBCluster < Base
def initialize
super
@type_name = 'RdsDbCluster'
@type = Awspec::Type::RdsDbCluster.new('my-rds-db-cluster')
@type_name = 'RdsDBCluster'
@type = Awspec::Type::RdsDBCluster.new('my-rds-db-cluster')
@ret = @type.resource_via_client
@matchers = [
Awspec::Type::RdsDbCluster::STATES.map { |state| "be_#{state.tr('-', '_')}" }.join(', ')
Awspec::Type::RdsDBCluster::STATES.map { |state| "be_#{state.tr('-', '_')}" }.join(', ')
]
@ignore_matchers = Awspec::Type::RdsDbCluster::STATES.map { |state| "be_#{state.tr('-', '_')}" }
@ignore_matchers = Awspec::Type::RdsDBCluster::STATES.map { |state| "be_#{state.tr('-', '_')}" }
@describes = []
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
module Awspec::Generator
module Doc
module Type
class RdsDbClusterParameterGroup < Base
class RdsDBClusterParameterGroup < Base
def initialize
super
@type = Awspec::Type::RdsDbClusterParameterGroup.new('my-rds-db-cluster-parameter-group')
@type = Awspec::Type::RdsDBClusterParameterGroup.new('my-rds-db-cluster-parameter-group')
@matchers = []
@ignore_matchers = []
@describes = []
Expand Down
4 changes: 2 additions & 2 deletions lib/awspec/generator/doc/type/rds_db_parameter_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
module Awspec::Generator
module Doc
module Type
class RdsDbParameterGroup < Base
class RdsDBParameterGroup < Base
def initialize
super
@type = Awspec::Type::RdsDbParameterGroup.new('my-rds-db-parameter-group')
@type = Awspec::Type::RdsDBParameterGroup.new('my-rds-db-parameter-group')
@matchers = []
@ignore_matchers = []
@describes = []
Expand Down
6 changes: 3 additions & 3 deletions lib/awspec/generator/doc/type/rds_db_subnet_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
module Awspec::Generator
module Doc
module Type
class RdsDbSubnetGroup < Base
class RdsDBSubnetGroup < Base
def initialize
super
@type_name = 'RdsDbSubnetGroup'
@type = Awspec::Type::RdsDbSubnetGroup.new('my-rds-db-subnet-group')
@type_name = 'RdsDBSubnetGroup'
@type = Awspec::Type::RdsDBSubnetGroup.new('my-rds-db-subnet-group')
@ret = @type.resource_via_client
@matchers = %w[belong_to_vpc belong_to_subnet]
@ignore_matchers = []
Expand Down
2 changes: 1 addition & 1 deletion lib/awspec/generator/spec/rds_db_cluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Awspec::Generator
module Spec
class RdsDbCluster
class RdsDBCluster
include Awspec::Helper::Finder
def generate(db_cluster_identifier)
cluster = find_db_cluster(db_cluster_identifier)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Awspec::Generator
module Spec
class RdsDbClusterParameterGroup
class RdsDBClusterParameterGroup
include Awspec::Helper::Finder
def generate_by_parameter_group(parameter_group)
@parameter_group = parameter_group
Expand Down
2 changes: 1 addition & 1 deletion lib/awspec/generator/spec/rds_db_parameter_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Awspec::Generator
module Spec
class RdsDbParameterGroup
class RdsDBParameterGroup
include Awspec::Helper::Finder
def generate_by_parameter_group(parameter_group)
@parameter_group = parameter_group
Expand Down
2 changes: 1 addition & 1 deletion lib/awspec/matcher/belong_to_subnet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
end

# RDS DB Subnet Group
if type.instance_of?(Awspec::Type::RdsDbSubnetGroup)
if type.instance_of?(Awspec::Type::RdsDBSubnetGroup)
subnets = type.resource_via_client[:subnets]
ret = subnets.find do |s|
s[:subnet_identifier] == subnet_id
Expand Down
2 changes: 1 addition & 1 deletion lib/awspec/type/rds_db_cluster.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

module Awspec::Type
class RdsDbCluster < ResourceBase
class RdsDBCluster < ResourceBase
aws_resource Aws::RDS::Types::DBCluster

def resource_via_client
Expand Down
2 changes: 1 addition & 1 deletion lib/awspec/type/rds_db_cluster_parameter_group.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

module Awspec::Type
class RdsDbClusterParameterGroup < ResourceBase
class RdsDBClusterParameterGroup < ResourceBase
def resource_via_client
return @resource_via_client if @resource_via_client

Expand Down
8 changes: 4 additions & 4 deletions lib/awspec/type/rds_db_parameter_group.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

module Awspec::Type
class InvalidRdsDbParameter < StandardError
class InvalidRdsDBParameter < StandardError
##
# Overrides the superclass initialize method to include more information
# and default error message.
Expand All @@ -19,7 +19,7 @@ class RdsDBParameters
##
# Thanks to AWS for creating parameters names like
# 'rds.accepted_password_auth_method', which would be caught as method 'rds'
# by method_missing in RdsDbParameterGroup class, this class was created
# by method_missing in RdsDBParameterGroup class, this class was created
# See https://github.com/k1LoW/awspec/issues/527 for more details
def initialize(params)
@params = params
Expand All @@ -33,11 +33,11 @@ def method_missing(name)
param_name = name.to_sym
return @params[param_name] if @params.include?(param_name)

raise InvalidRdsDbParameter, name
raise InvalidRdsDBParameter, name
end
end

class RdsDbParameterGroup < ResourceBase
class RdsDBParameterGroup < ResourceBase
def resource_via_client
return @resource_via_client if @resource_via_client

Expand Down
2 changes: 1 addition & 1 deletion lib/awspec/type/rds_db_subnet_group.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

module Awspec::Type
class RdsDbSubnetGroup < ResourceBase
class RdsDBSubnetGroup < ResourceBase
aws_resource Aws::RDS::Types::DBSubnetGroup

def resource_via_client
Expand Down
4 changes: 2 additions & 2 deletions spec/generator/spec/rds_db_cluster_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

require 'spec_helper'

describe 'Awspec::Generator::Spec::RdsDbCluster' do
describe 'Awspec::Generator::Spec::RdsDBCluster' do
before do
Awspec::Stub.load 'rds_db_cluster'
end
let(:rds_db_cluster) { Awspec::Generator::Spec::RdsDbCluster.new }
let(:rds_db_cluster) { Awspec::Generator::Spec::RdsDBCluster.new }
it 'generate spec' do
spec = <<-'EOF'
describe rds_db_cluster('my-rds-db-cluster') do
Expand Down
2 changes: 1 addition & 1 deletion spec/type/rds_db_parameter_group_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
its(:max_allowed_packet) { should eq '16777216' }
its('rds.logical_replication') { should eq '1' }
its('rds.accepted_password_auth_method') { should eq 'md5+scram' }
its('rds.foobar') { will raise_error(Awspec::Type::InvalidRdsDbParameter) }
its('rds.foobar') { will raise_error(Awspec::Type::InvalidRdsDBParameter) }
end

0 comments on commit 8a14918

Please sign in to comment.