Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for ruby 3 #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Ruby

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
rspec:
runs-on: ubuntu-latest
env:
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3
CI: true
strategy:
fail-fast: false
matrix:
ruby: ["2.7", "3.1", "3.2", "3.3"]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: /home/runner/bundle
key: bundle-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
restore-keys: |
bundle-${{ matrix.ruby }}-
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Bundle install
run: |
bundle config path /home/runner/bundle
bundle install
bundle update
- name: Run RSpec
run: |
bundle exec rspec
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gemspec

group :development, :test do
gem 'pry', platform: :mri
gem 'pry-byebug', platform: :mri
end
gem 'pry', '~> 0.14.2', platform: :mri
gem 'pry-byebug', '~> 3.10', '>= 3.10.1', platform: :mri
end
138 changes: 75 additions & 63 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,97 +2,109 @@ PATH
remote: .
specs:
yandex-checkout (0.1.1)
evil-client (~> 3.0)
evil-client (~> 3.2)

GEM
remote: https://rubygems.org/
specs:
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
ast (2.4.0)
byebug (11.0.1)
coderay (1.1.2)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
bigdecimal (3.1.7)
byebug (11.1.3)
coderay (1.1.3)
concurrent-ruby (1.1.5)
crack (0.4.3)
safe_yaml (~> 1.0.0)
diff-lcs (1.3)
docile (1.3.1)
crack (1.0.0)
bigdecimal
rexml
diff-lcs (1.5.1)
docile (1.4.0)
dry-initializer (3.0.1)
evil-client (3.0.3)
dry-initializer (>= 2.1, < 4)
mime-types (~> 3.1)
rack (~> 2)
tram-policy (>= 0.3.1, < 2)
hashdiff (0.4.0)
evil-client (3.2.0)
dry-initializer (>= 2.1)
mime-types (>= 3.1)
rack (>= 2)
tram-policy (>= 0.3.1, < 3)
hashdiff (1.1.0)
i18n (1.6.0)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.2)
json (2.2.0)
method_source (0.9.2)
json (2.7.2)
language_server-protocol (3.17.0.3)
method_source (1.1.0)
mime-types (3.2.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.0331)
parallel (1.17.0)
parser (2.6.3.0)
ast (~> 2.4.0)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
pry-byebug (3.7.0)
parallel (1.24.0)
parser (3.3.1.0)
ast (~> 2.4.1)
racc
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.10.1)
byebug (~> 11.0)
pry (~> 0.10)
public_suffix (3.1.0)
pry (>= 0.13, < 0.15)
public_suffix (5.0.5)
racc (1.7.3)
rack (2.0.7)
rainbow (3.0.0)
rake (12.3.2)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.3)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.9.0)
rexml (3.2.6)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.0)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rubocop (0.71.0)
jaro_winkler (~> 1.5.1)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.63.4)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 2.6)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
ruby-progressbar (1.10.1)
safe_yaml (1.0.5)
simplecov (0.16.1)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.3)
parser (>= 3.3.1.0)
ruby-progressbar (1.13.0)
simplecov (0.22.0)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
tram-policy (1.0.1)
dry-initializer (> 2, < 4)
i18n (~> 1.0)
unicode-display_width (1.6.0)
webmock (3.5.1)
addressable (>= 2.3.6)
unicode-display_width (2.5.0)
webmock (3.23.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff
hashdiff (>= 0.4.0, < 2.0.0)

PLATFORMS
ruby

DEPENDENCIES
pry
pry-byebug
rake (>= 10.0)
rspec (~> 3.5)
rubocop (~> 0.71)
simplecov (~> 0.16)
webmock (~> 3.5)
pry (~> 0.14.2)
pry-byebug (~> 3.10, >= 3.10.1)
rake (>= 13.2.1)
rspec (~> 3.13.0)
rubocop (~> 1.63, >= 1.63.4)
simplecov (~> 0.22)
webmock (~> 3.23.0)
yandex-checkout!

BUNDLED WITH
1.17.3
2.4.22
2 changes: 1 addition & 1 deletion lib/yandex-checkout/error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def build(*res)
end

def new(opts)
super opts.each_with_object({}) { |(key, val), obj| obj[key.to_sym] = val }
super(**opts.each_with_object({}) { |(key, val), obj| obj[key.to_sym] = val })
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/yandex-checkout/optional.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Optional
private

def initialize(opts)
super opts.each_with_object({}) { |(key, val), obj| obj[key.to_sym] = val }
super(**opts.each_with_object({}) { |(key, val), obj| obj[key.to_sym] = val })
end

def __options__
Expand Down
2 changes: 1 addition & 1 deletion lib/yandex-checkout/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def build(*res)
end

def new(opts)
super opts.each_with_object({}) { |(key, val), obj| obj[key.to_sym] = val }
super(**opts.each_with_object({}) { |(key, val), obj| obj[key.to_sym] = val })
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/yandex-checkout/payment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RSpec.describe YandexCheckout::Payment do
let(:settings) { { shop_id: 'SHOP_ID', api_key: 'API_KEY' } }
let(:idempotency_key) { 12_345 }
let(:payment) { described_class.new(settings) }
let(:payment) { described_class.new(**settings) }

shared_examples 'returns_payment_object' do
it 'returns success' do
Expand Down
2 changes: 1 addition & 1 deletion spec/yandex-checkout/refund_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RSpec.describe YandexCheckout::Refund do
let(:settings) { { shop_id: 'SHOP_ID', api_key: 'API_KEY' } }
let(:idempotency_key) { 12_345 }
let(:payment) { described_class.new(settings) }
let(:payment) { described_class.new(**settings) }

shared_examples 'returns_refund_object' do
it 'returns success' do
Expand Down
13 changes: 7 additions & 6 deletions yandex-checkout.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = '>= 2.5'

spec.add_runtime_dependency 'evil-client', '~> 3.0'
spec.add_runtime_dependency 'evil-client', '~> 3.2'

spec.add_development_dependency 'rake', '>= 10.0'
spec.add_development_dependency 'rspec', '~> 3.5'
spec.add_development_dependency 'rubocop', '~> 0.71'
spec.add_development_dependency 'simplecov', '~> 0.16'
spec.add_development_dependency 'webmock', '~> 3.5'

spec.add_development_dependency 'rake', '>= 13.2.1'
spec.add_development_dependency 'rspec', '~> 3.13.0'
spec.add_development_dependency 'rubocop', '~> 1.63', '>= 1.63.4'
spec.add_development_dependency 'simplecov', '~> 0.22'
spec.add_development_dependency 'webmock', '~> 3.23.0'
end
Loading