From 46ca11beee6f9bd9ec2554f591289ad8a72d412a Mon Sep 17 00:00:00 2001 From: Hakan Ensari Date: Sat, 17 Aug 2024 23:54:31 +0200 Subject: [PATCH] Tidy up --- .github/workflows/build.yml | 30 +++++++++++++++--------------- .rubocop.yml | 2 +- LICENSE | 2 +- lib/vacuum/operation.rb | 2 +- lib/vacuum/request.rb | 4 ++-- test/integration/test_requests.rb | 2 +- test/unit/test_operation.rb | 2 +- vacuum.gemspec | 20 ++++++++++---------- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d968edc3..d1d43bf7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,27 +7,27 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: [2.7, 3.0, 3.1, 3.2] + ruby: [3.1, 3.2, 3.3] container: image: ruby:${{ matrix.ruby }} steps: - - uses: actions/checkout@v3 - - run: gem install bundler - - run: bundle install --jobs 4 --retry 3 - - run: bundle exec rake + - uses: actions/checkout@v4 + - run: gem install bundler + - run: bundle install --jobs 4 --retry 3 + - run: bundle exec rake coverage: - needs: [ test ] + needs: [test] if: github.event_name == 'push' runs-on: ubuntu-latest container: - image: ruby:2.7 + image: ruby:3.3 steps: - - uses: actions/checkout@v3 - - run: gem install bundler - - run: bundle install --jobs 4 --retry 3 - - uses: paambaati/codeclimate-action@v3.0.0 - env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - with: - coverageCommand: bundle exec rake test + - uses: actions/checkout@v4 + - run: gem install bundler + - run: bundle install --jobs 4 --retry 3 + - uses: paambaati/codeclimate-action@v8.0.0 + env: + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + with: + coverageCommand: bundle exec rake test diff --git a/.rubocop.yml b/.rubocop.yml index 8348d7c7..9dd0935d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,4 +6,4 @@ require: AllCops: NewCops: enable - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.1 diff --git a/LICENSE b/LICENSE index 6d00cfce..a9d95f59 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ (The MIT License) -Copyright (c) 2010-2021 Hakan Ensari +Copyright (c) 2010-2024 Hakan Ensari Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/lib/vacuum/operation.rb b/lib/vacuum/operation.rb index dc423f78..9a3ba2eb 100644 --- a/lib/vacuum/operation.rb +++ b/lib/vacuum/operation.rb @@ -61,7 +61,7 @@ def build_url end def signature - signer.sign_request(http_method: 'POST', url: url, body: body) + signer.sign_request(http_method: 'POST', url:, body:) end def signer diff --git a/lib/vacuum/request.rb b/lib/vacuum/request.rb index f4e4e2ec..b6a0a03c 100644 --- a/lib/vacuum/request.rb +++ b/lib/vacuum/request.rb @@ -129,7 +129,7 @@ def search_items(**params) # @return [self] def persistent(timeout: 5) host = "https://#{locale.host}" - @client = client.persistent(host, timeout: timeout) + @client = client.persistent(host, timeout:) self end @@ -163,7 +163,7 @@ def validate_keywords(params) def request(operation_name, params) validate_keywords(params) - @operation = Operation.new(operation_name, params: params, locale: locale) + @operation = Operation.new(operation_name, params:, locale:) response = client.headers(operation.headers) .post(operation.url, body: operation.body) diff --git a/test/integration/test_requests.rb b/test/integration/test_requests.rb index 16ba9dec..50b3e135 100644 --- a/test/integration/test_requests.rb +++ b/test/integration/test_requests.rb @@ -105,7 +105,7 @@ def test_logging logdev = StringIO.new logger = Logger.new(logdev) request = requests.sample - request.use(logging: { logger: logger }) + request.use(logging: { logger: }) request.search_items(keywords: 'Harry Potter') refute_empty logdev.string diff --git a/test/unit/test_operation.rb b/test/unit/test_operation.rb index d7541fdb..e43c4175 100644 --- a/test/unit/test_operation.rb +++ b/test/unit/test_operation.rb @@ -7,7 +7,7 @@ module Vacuum class TestOperation < Minitest::Test def setup - @operation = Operation.new('Action', params: { foo: 1 }, locale: locale) + @operation = Operation.new('Action', params: { foo: 1 }, locale:) end def test_body diff --git a/vacuum.gemspec b/vacuum.gemspec index aacbe42b..a165d2c6 100644 --- a/vacuum.gemspec +++ b/vacuum.gemspec @@ -4,21 +4,21 @@ $LOAD_PATH.push File.expand_path('lib', __dir__) require 'vacuum/version' Gem::Specification.new do |gem| - gem.name = 'vacuum' - gem.version = Vacuum::VERSION - gem.platform = Gem::Platform::RUBY - gem.authors = ['Hakan Ensari', 'Stanislav Katkov'] - gem.email = ['me@hakanensari.com', 'sk@skylup.com'] - gem.homepage = 'https://github.com/hakanensari/vacuum' + gem.name = 'vacuum' + gem.version = Vacuum::VERSION + gem.platform = Gem::Platform::RUBY + gem.authors = ['Hakan Ensari', 'Stanislav Katkov'] + gem.email = %w[hakanensari@gmail.com sk@skylup.com] + gem.homepage = 'https://github.com/hakanensari/vacuum' gem.description = 'A wrapper to the Amazon Product Advertising API' - gem.summary = 'Amazon Product Advertising in Ruby' - gem.license = 'MIT' + gem.summary = 'Amazon Product Advertising in Ruby' + gem.license = 'MIT' - gem.files = Dir.glob('lib/**/*') + %w[LICENSE README.md] + gem.files = Dir.glob('lib/**/*') + %w[LICENSE README.md] gem.require_paths = ['lib'] gem.add_dependency 'aws-sigv4', '~> 1.0' gem.add_dependency 'http', '>= 4.0', '< 6.0' - gem.required_ruby_version = '>= 2.7' + gem.required_ruby_version = '>= 3.1' gem.metadata['rubygems_mfa_required'] = 'true' end