diff --git a/.github/workflows/gem-workflow.yml b/.github/workflows/gem-workflow.yml index 1207599d..cb865169 100644 --- a/.github/workflows/gem-workflow.yml +++ b/.github/workflows/gem-workflow.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - ruby-version: ['3.1.6', '3.2.6', '3.3.6'] + ruby-version: ["3.2.6", "3.3.6"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -21,18 +21,13 @@ jobs: with: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true - - name: Bundle install - run: | - gem install bundler - bundle config path vendor/bundle - bundle install --jobs 4 --retry 3 - name: Rubocop run: bundle exec rubocop rspec: strategy: matrix: os: [ubuntu-latest] - ruby-version: ['3.1.6', '3.2.6', '3.3.6'] + ruby-version: ["3.2.6", "3.3.6"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -44,10 +39,6 @@ jobs: with: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true - run: | - gem install bundler - bundle update - bundle install - name: rspec and report to coveralls run: bundle exec rspec --order rand - name: Coveralls @@ -69,7 +60,7 @@ jobs: - name: Ruby Setup and Bundle uses: ruby/setup-ruby@v1 with: - ruby-version: 3.1.6 + ruby-version: 3.2.6 bundler-cache: true - name: Publish to RubyGems run: | diff --git a/.rubocop.yml b/.rubocop.yml index b183beda..2f649878 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,7 +4,7 @@ AllCops: Exclude: - "documentation/site/_plugins/**/*" - "vendor/**/*" - TargetRubyVersion: 3.1 + TargetRubyVersion: 3.2 NewCops: enable Gemspec/DevelopmentDependencies: diff --git a/Gemfile.lock b/Gemfile.lock index def050d6..64da3df1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -19,9 +19,9 @@ PATH GEM remote: https://rubygems.org/ specs: - activemodel (7.2.2.2) - activesupport (= 7.2.2.2) - activesupport (7.2.2.2) + activemodel (8.0.3) + activesupport (= 8.0.3) + activesupport (8.0.3) base64 benchmark (>= 0.3) bigdecimal @@ -33,13 +33,14 @@ GEM minitest (>= 5.1) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ast (2.4.3) awesome_print (1.9.2) base64 (0.3.0) benchmark (0.4.1) - bigdecimal (3.2.2) + bigdecimal (3.3.1) bump (0.10.0) byebug (12.0.0) childprocess (5.1.0) @@ -47,7 +48,7 @@ GEM climate_control (1.2.0) colorize (1.1.0) concurrent-ruby (1.3.5) - connection_pool (2.5.3) + connection_pool (2.5.4) coveralls_reborn (0.29.0) simplecov (~> 0.22.0) term-ansicolor (~> 1.7) @@ -83,7 +84,7 @@ GEM dry-logic (~> 1.5) dry-types (~> 1.8) zeitwerk (~> 2.6) - dry-types (1.8.2) + dry-types (1.8.3) bigdecimal (~> 3.0) concurrent-ruby (~> 1.0) dry-core (~> 1.0) @@ -96,6 +97,7 @@ GEM dry-initializer (~> 3.2) dry-schema (~> 1.14) zeitwerk (~> 2.6) + erb (5.1.1) factory_bot (6.5.5) activesupport (>= 6.1.0) faraday (2.14.0) @@ -106,25 +108,38 @@ GEM net-http (>= 0.5.0) fingerprintable (1.2.1) colorize - hashdiff (1.1.2) + hashdiff (1.2.1) i18n (1.14.7) concurrent-ruby (~> 1.0) iniparse (1.5.0) - io-console (0.8.0) + io-console (0.8.1) irb (1.15.2) pp (>= 0.6.0) rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.15.0) + json (2.15.1) language_server-protocol (3.17.0.5) lint_roller (1.1.0) logger (1.7.0) - mini_portile2 (2.8.8) - minitest (5.25.5) + minitest (5.26.0) + mize (0.6.1) net-http (0.6.0) uri - nokogiri (1.16.7) - mini_portile2 (~> 2.8.2) + nokogiri (1.18.10-aarch64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.10-aarch64-linux-musl) + racc (~> 1.4) + nokogiri (1.18.10-arm-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.10-arm-linux-musl) + racc (~> 1.4) + nokogiri (1.18.10-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.10-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.18.10-x86_64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.10-x86_64-linux-musl) racc (~> 1.4) observer (0.1.2) openssl (3.3.1) @@ -138,30 +153,32 @@ GEM racc pd_ruby (0.2.3) colorize - pp (0.6.2) + pp (0.6.3) prettyprint prettyprint (0.2.0) - prism (1.5.1) - psych (5.2.3) + prism (1.5.2) + psych (5.2.6) date stringio - public_suffix (6.0.1) + public_suffix (6.0.2) racc (1.8.1) rack (3.2.3) rainbow (3.1.1) rake (13.3.0) - rdoc (6.13.1) + rdoc (6.15.0) + erb psych (>= 4.0.0) + tsort regexp_parser (2.11.3) - reline (0.6.1) + reline (0.6.2) io-console (~> 0.5) resonad (1.4.0) - rexml (3.4.2) + rexml (3.4.4) rspec (3.13.1) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-core (3.13.4) + rspec-core (3.13.5) rspec-support (~> 3.13.0) rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) @@ -169,7 +186,7 @@ GEM rspec-mocks (3.13.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-support (3.13.4) + rspec-support (3.13.6) rubocop (1.81.1) json (~> 2.3) language_server-protocol (~> 3.17.0.2) @@ -190,34 +207,42 @@ GEM docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) - simplecov-html (0.13.1) + simplecov-html (0.13.2) simplecov-lcov (0.9.0) simplecov_json_formatter (0.1.4) simply_serializable (1.5.1) fingerprintable (>= 1.2.1) - stringio (3.1.6) + stringio (3.1.7) sync (0.5.0) - term-ansicolor (1.11.2) - tins (~> 1.0) + term-ansicolor (1.11.3) + tins (~> 1) thor (1.4.0) - tins (1.38.0) + tins (1.44.1) bigdecimal + mize (~> 0.6) sync + tsort (0.2.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (3.2.0) unicode-emoji (~> 4.1) unicode-emoji (4.1.0) - uri (1.0.3) + uri (1.0.4) webmock (3.25.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - zeitwerk (2.6.18) + zeitwerk (2.7.3) PLATFORMS - ruby - x86_64-darwin-19 + aarch64-linux-gnu + aarch64-linux-musl + arm-linux-gnu + arm-linux-musl + arm64-darwin + x86_64-darwin + x86_64-linux-gnu + x86_64-linux-musl DEPENDENCIES awesome_print @@ -233,10 +258,10 @@ DEPENDENCIES overcommit (~> 0.68.0) rake (~> 13.0) rspec (~> 3.2) - rubocop (~> 1.81) + rubocop (~> 1.81, ~> 1.79) simplecov simplecov-lcov webmock BUNDLED WITH - 2.6.2 + 2.7.1 diff --git a/documentation/generators/generator.rb b/documentation/generators/generator.rb index 8580350a..319d6430 100644 --- a/documentation/generators/generator.rb +++ b/documentation/generators/generator.rb @@ -21,15 +21,15 @@ def clear_dir(path, except: []) nl end - def cp(src, dest, *args) + def cp(src, dest, *) yellow "Copying #{src} to #{dest}" - FileUtils.cp_r(src, dest, *args) + FileUtils.cp_r(src, dest, *) green "Copied #{src} to #{dest}" nl end - def destination_path(*args, **keywords) - docs_path(*args, format: :md, **keywords) + def destination_path(*, **keywords) + docs_path(*, format: :md, **keywords) end def docs_path(*path, format: nil) diff --git a/ledger_sync.gemspec b/ledger_sync.gemspec index e1aac95e..a343c41f 100644 --- a/ledger_sync.gemspec +++ b/ledger_sync.gemspec @@ -8,7 +8,7 @@ Gem::Specification.new do |spec| spec.name = 'ledger_sync' spec.version = LedgerSync.version - spec.required_ruby_version = '>= 3.1' + spec.required_ruby_version = '>= 3.2' # spec.required_rubygems_version = Gem::Requirement.new('>= 0') if spec.respond_to? :required_rubygems_version= spec.authors = ['Ryan Jackson'] diff --git a/lib/ledger_sync.rb b/lib/ledger_sync.rb index 142eff8f..81ca6863 100644 --- a/lib/ledger_sync.rb +++ b/lib/ledger_sync.rb @@ -107,8 +107,8 @@ def self.logger=(val) @logger = val end - def self.register_ledger(*args) - ledger_config = LedgerSync::LedgerConfiguration.new(*args) + def self.register_ledger(*) + ledger_config = LedgerSync::LedgerConfiguration.new(*) yield(ledger_config) diff --git a/lib/ledger_sync/error/ledger_errors.rb b/lib/ledger_sync/error/ledger_errors.rb index a4986d44..9c742b55 100644 --- a/lib/ledger_sync/error/ledger_errors.rb +++ b/lib/ledger_sync/error/ledger_errors.rb @@ -53,11 +53,11 @@ def initialize(client:, message: nil, response: nil) class UnknownURLFormat < self attr_reader :resource - def initialize(*args, resource:, **keywords) + def initialize(*, resource:, **keywords) @resource = resource super( - *args, + *, message: "Unknown URL format for #{resource.class}", **keywords ) end diff --git a/lib/ledger_sync/ledger_configuration.rb b/lib/ledger_sync/ledger_configuration.rb index 90cb1ffc..704dbf34 100644 --- a/lib/ledger_sync/ledger_configuration.rb +++ b/lib/ledger_sync/ledger_configuration.rb @@ -48,14 +48,14 @@ def add_alias(new_alias) # Delegate #new to the client class enabling faster client initialization # e.g. LedgerSync.ledgers.test.new(...) - def new(*args) - client_class.new(*args) + def new(*) + client_class.new(*) end # Delegate #new_from_env to the client class enabling faster client initialization # e.g. LedgerSync.ledgers.test.new_from_env(...) - def new_from_env(*args) - client_class.new_from_env(*args) + def new_from_env(*) + client_class.new_from_env(*) end def test? diff --git a/lib/ledger_sync/ledgers/client.rb b/lib/ledger_sync/ledgers/client.rb index a950c93a..dbafe287 100644 --- a/lib/ledger_sync/ledgers/client.rb +++ b/lib/ledger_sync/ledgers/client.rb @@ -56,8 +56,8 @@ def searcher_for(resource_type:, query: '') ) end - def searcher_class_for(*args, **keywords) - self.class.searcher_class_for(*args, **keywords) + def searcher_class_for(*, **keywords) + self.class.searcher_class_for(*, **keywords) end def url_for(*_args) @@ -93,8 +93,8 @@ def ledger_resource_type_overrides {} end - def operation_class_for(*args, **keywords) - Client.operation_class_for(*args, **keywords) + def operation_class_for(*, **keywords) + Client.operation_class_for(*, **keywords) end def resource_from_ledger_type(type:, converter: nil) diff --git a/lib/ledger_sync/result.rb b/lib/ledger_sync/result.rb index e4401df6..fb60ea89 100644 --- a/lib/ledger_sync/result.rb +++ b/lib/ledger_sync/result.rb @@ -3,12 +3,12 @@ module LedgerSync module ResultBase module HelperMethods - def Success(value = nil, *args, **keywords) # rubocop:disable Naming/MethodName - self::Success.new(value, *args, **keywords) + def Success(value = nil, *, **keywords) # rubocop:disable Naming/MethodName + self::Success.new(value, *, **keywords) end - def Failure(error = nil, *args, **keywords) # rubocop:disable Naming/MethodName - self::Failure.new(error, *args, **keywords) + def Failure(error = nil, *, **keywords) # rubocop:disable Naming/MethodName + self::Failure.new(error, *, **keywords) end end @@ -25,8 +25,8 @@ def self.included(base) class Result module ResultTypeBase - def initialize(*args, **keywords) # rubocop:disable Lint/UnusedMethodArgument - super(*args) + def initialize(*, **keywords) # rubocop:disable Lint/UnusedMethodArgument + super(*) end end @@ -43,11 +43,11 @@ def self.included(base) end end - def initialize(*args, **keywords) + def initialize(*, **keywords) @operation = keywords.fetch(:operation) @resource = keywords.fetch(:resource) @response = keywords.fetch(:response) - super(*args) + super(*) end end @@ -69,10 +69,10 @@ def self.included(base) end end - def initialize(*args, searcher:, **keywords) # rubocop:disable Lint/UnusedMethodArgument + def initialize(*, searcher:, **keywords) # rubocop:disable Lint/UnusedMethodArgument @resources = searcher.resources @searcher = searcher - super(*args) + super(*) end def next_searcher diff --git a/lib/ledger_sync/test/support/factory_bot.rb b/lib/ledger_sync/test/support/factory_bot.rb index 96f2f9a3..fbe7e4ab 100644 --- a/lib/ledger_sync/test/support/factory_bot.rb +++ b/lib/ledger_sync/test/support/factory_bot.rb @@ -143,8 +143,8 @@ def references_many(name, count: 0, factory: nil) # # @return [String] # -def rand_id(*args) - FactoryBot.rand_id(*args) +def rand_id(*) + FactoryBot.rand_id(*) end # @@ -152,6 +152,6 @@ def rand_id(*args) # # @return [String] # -def test_run_id(*args) - @test_run_id ||= FactoryBot.test_run_id(*args) +def test_run_id(*) + @test_run_id ||= FactoryBot.test_run_id(*) end diff --git a/lib/ledger_sync/test/support/qa/ledger_helpers.rb b/lib/ledger_sync/test/support/qa/ledger_helpers.rb index 5b464bf9..84332089 100644 --- a/lib/ledger_sync/test/support/qa/ledger_helpers.rb +++ b/lib/ledger_sync/test/support/qa/ledger_helpers.rb @@ -4,8 +4,8 @@ module LedgerSync module Test module QA module LedgerHelpers - def create_resource_for(*args) - create_result_for(*args).raise_if_error.resource + def create_resource_for(*) + create_result_for(*).raise_if_error.resource end def create_result_for(client:, resource:) @@ -16,8 +16,8 @@ def create_result_for(client:, resource:) ) end - def delete_resource_for(*args) - delete_result_for(*args).raise_if_error.resource + def delete_resource_for(*) + delete_result_for(*).raise_if_error.resource end def delete_result_for(client:, resource:) @@ -28,8 +28,8 @@ def delete_result_for(client:, resource:) ) end - def find_resource_for(*args) - find_result_for(*args).raise_if_error.resource + def find_resource_for(*) + find_result_for(*).raise_if_error.resource end def find_result_for(client:, resource:) @@ -47,8 +47,8 @@ def result_for(client:, method:, resource:) ).perform end - def update_resource_for(*args) - update_result_for(*args).raise_if_error.resource + def update_resource_for(*) + update_result_for(*).raise_if_error.resource end def update_result_for(client:, resource:) diff --git a/lib/ledger_sync/test/support/webmock_helpers.rb b/lib/ledger_sync/test/support/webmock_helpers.rb index 14f929b3..f22b804c 100644 --- a/lib/ledger_sync/test/support/webmock_helpers.rb +++ b/lib/ledger_sync/test/support/webmock_helpers.rb @@ -12,9 +12,9 @@ module WebMock module API # Overwrite the original stub_request method to enforce we explicitly say # how many times we expect a request to be called - def stub_request(*args, times: 1) + def stub_request(*, times: 1) ret = WebMock::StubRegistry.instance - .register_request_stub(WebMock::RequestStub.new(*args)) + .register_request_stub(WebMock::RequestStub.new(*)) stubs_and_times << [ret, times] unless times.nil? ret end