Skip to content

Commit

Permalink
Tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
hakanensari committed Aug 17, 2024
1 parent 0333731 commit 46ca11b
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 32 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ require:

AllCops:
NewCops: enable
TargetRubyVersion: 2.7
TargetRubyVersion: 3.1
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/vacuum/operation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/vacuum/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion test/integration/test_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_operation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions vacuum.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 46ca11b

Please sign in to comment.