diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 466047c..d3f1a74 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,5 +24,5 @@ jobs: with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - - name: Run the default task - run: bundle exec rspec + - name: Cops & Specs + run: bin/rake diff --git a/.rubocop.yml b/.rubocop.yml index 17b1f43..3a733b3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,13 +1,20 @@ AllCops: - TargetRubyVersion: 2.5 + TargetRubyVersion: 2.6 + NewCops: enable + +Style/StringLiterals: + Enabled: true + EnforcedStyle: double_quotes + +Style/StringLiteralsInInterpolation: + Enabled: true + EnforcedStyle: double_quotes + +Style/Documentation: + Enabled: false + +Layout/LineLength: + Max: 150 Metrics/BlockLength: - Exclude: - - 'spec/**/*.rb' - -Metrics/LineLength: - Max: 100 - -Naming/FileName: - Exclude: - - 'lib/*.rb' + IgnoredMethods: ['describe', 'context', 'shared_examples'] diff --git a/Gemfile b/Gemfile index fd22095..ffc917a 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ # frozen_string_literal: true -source 'https://rubygems.org' +source "https://rubygems.org" git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } @@ -8,6 +8,11 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } gemspec group :development, :test do - gem 'pry', platform: :mri - gem 'pry-byebug', platform: :mri + gem "pry" + gem "pry-byebug" + gem "rake", "~> 13.0" + gem "rspec", "~> 3.0" + gem "rubocop", "~> 1.21" + gem "rubocop-rake", "~> 0.6.0" + gem "rubocop-rspec", "~> 2.5" end diff --git a/Gemfile.lock b/Gemfile.lock index 22aa404..8bb2051 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,7 +9,7 @@ GEM specs: addressable (2.6.0) public_suffix (>= 2.0.2, < 4.0) - ast (2.4.0) + ast (2.4.2) byebug (11.0.1) coderay (1.1.2) concurrent-ruby (1.1.7) @@ -26,15 +26,14 @@ GEM hashdiff (0.4.0) i18n (1.8.5) concurrent-ruby (~> 1.0) - jaro_winkler (1.5.2) json (2.2.0) method_source (0.9.2) mime-types (3.3.1) mime-types-data (~> 3.2015) mime-types-data (3.2020.1104) - parallel (1.17.0) - parser (2.6.3.0) - ast (~> 2.4.0) + parallel (1.21.0) + parser (3.0.2.0) + ast (~> 2.4.1) pry (0.12.2) coderay (~> 1.1.0) method_source (~> 0.9.0) @@ -44,7 +43,9 @@ GEM public_suffix (3.1.0) rack (2.2.3) rainbow (3.0.0) - rake (12.3.2) + rake (13.0.6) + regexp_parser (2.1.1) + rexml (3.2.5) rspec (3.8.0) rspec-core (~> 3.8.0) rspec-expectations (~> 3.8.0) @@ -58,14 +59,22 @@ GEM 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) + rubocop (1.22.3) parallel (~> 1.10) - parser (>= 2.6) + parser (>= 3.0.0.0) rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml + rubocop-ast (>= 1.12.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 1.7) - ruby-progressbar (1.10.1) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.12.0) + parser (>= 3.0.1.1) + rubocop-rake (0.6.0) + rubocop (~> 1.0) + rubocop-rspec (2.5.0) + rubocop (~> 1.19) + ruby-progressbar (1.11.0) safe_yaml (1.0.5) simplecov (0.16.1) docile (~> 1.1) @@ -75,7 +84,7 @@ GEM tram-policy (2.0.1) dry-initializer (> 2, < 4) i18n (~> 1.0) - unicode-display_width (1.6.0) + unicode-display_width (2.1.0) webmock (3.5.1) addressable (>= 2.3.6) crack (>= 0.3.2) @@ -87,9 +96,11 @@ PLATFORMS DEPENDENCIES pry pry-byebug - rake (>= 10.0) - rspec (~> 3.5) - rubocop (~> 0.71) + rake (~> 13.0) + rspec (~> 3.0) + rubocop (~> 1.21) + rubocop-rake (~> 0.6.0) + rubocop-rspec (~> 2.5) simplecov (~> 0.16) webmock (~> 3.5) yookassa! diff --git a/Rakefile b/Rakefile index b7e9ed5..dcdeab9 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,12 @@ +# frozen_string_literal: true + require "bundler/gem_tasks" require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec) -task :default => :spec +require "rubocop/rake_task" + +RuboCop::RakeTask.new + +task default: %i[rubocop spec] diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000..852b747 --- /dev/null +++ b/bin/rake @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rake' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rake", "rake") diff --git a/bin/rspec b/bin/rspec new file mode 100755 index 0000000..0fa393d --- /dev/null +++ b/bin/rspec @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rspec' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rspec-core", "rspec") diff --git a/bin/rubocop b/bin/rubocop new file mode 100755 index 0000000..710ad45 --- /dev/null +++ b/bin/rubocop @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rubocop' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rubocop", "rubocop") diff --git a/lib/yookassa.rb b/lib/yookassa.rb index 9f53334..074d01f 100644 --- a/lib/yookassa.rb +++ b/lib/yookassa.rb @@ -1,13 +1,13 @@ # frozen_string_literal: true -require 'evil/client' +require "evil/client" -require 'yookassa/version' -require 'yookassa/payment' -require 'yookassa/refund' -require 'yookassa/response' -require 'yookassa/callable' -require 'yookassa/optional' -require 'yookassa/entity/payment' -require 'yookassa/entity/refund' -require 'yookassa/error' +require "yookassa/version" +require "yookassa/payment" +require "yookassa/refund" +require "yookassa/response" +require "yookassa/callable" +require "yookassa/optional" +require "yookassa/entity/payment" +require "yookassa/entity/refund" +require "yookassa/error" diff --git a/lib/yookassa/entity/payment.rb b/lib/yookassa/entity/payment.rb index e91f5b4..7fb4133 100644 --- a/lib/yookassa/entity/payment.rb +++ b/lib/yookassa/entity/payment.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -require_relative './amount' -require_relative './payment_method' -require_relative './confirmation' +require_relative "./amount" +require_relative "./payment_method" +require_relative "./confirmation" module Yookassa module Entity diff --git a/lib/yookassa/entity/payment_method.rb b/lib/yookassa/entity/payment_method.rb index fb123eb..a7a93ea 100644 --- a/lib/yookassa/entity/payment_method.rb +++ b/lib/yookassa/entity/payment_method.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative './card' +require_relative "./card" module Yookassa module Entity diff --git a/lib/yookassa/entity/refund.rb b/lib/yookassa/entity/refund.rb index 56dabea..a5da761 100644 --- a/lib/yookassa/entity/refund.rb +++ b/lib/yookassa/entity/refund.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative './amount' +require_relative "./amount" module Yookassa module Entity diff --git a/lib/yookassa/error.rb b/lib/yookassa/error.rb index 7181614..e4d9974 100644 --- a/lib/yookassa/error.rb +++ b/lib/yookassa/error.rb @@ -13,7 +13,7 @@ module Yookassa option :parameter, proc(&:to_s), optional: true def error? - type == 'error' + type == "error" end class << self @@ -23,7 +23,7 @@ module Yookassa end def new(opts) - super opts.each_with_object({}) { |(key, val), obj| obj[key.to_sym] = val } + super opts.transform_keys(&:to_sym) end end end diff --git a/lib/yookassa/optional.rb b/lib/yookassa/optional.rb index 4bed54c..026c9eb 100644 --- a/lib/yookassa/optional.rb +++ b/lib/yookassa/optional.rb @@ -5,7 +5,7 @@ module Yookassa private def initialize(opts) - super opts.each_with_object({}) { |(key, val), obj| obj[key.to_sym] = val } + super opts.transform_keys(&:to_sym) end def __options__ diff --git a/lib/yookassa/payment.rb b/lib/yookassa/payment.rb index 53bdc3c..5dd3d5c 100644 --- a/lib/yookassa/payment.rb +++ b/lib/yookassa/payment.rb @@ -5,7 +5,7 @@ module Yookassa option :shop_id, proc(&:to_s) option :api_key, proc(&:to_s) - path { 'https://api.yookassa.ru/v3/payments' } + path { "https://api.yookassa.ru/v3/payments" } security { basic_auth shop_id, api_key } operation :get_payment_info do @@ -24,8 +24,8 @@ module Yookassa http_method :post - format 'json' - headers { { 'Idempotence-Key' => idempotency_key } } + format "json" + headers { { "Idempotence-Key" => idempotency_key } } body { payment } response(200) { |*res| Entity::Payment.build(*res) } @@ -40,8 +40,8 @@ module Yookassa path { "/#{payment_id}/capture" } - format 'json' - headers { { 'Idempotence-Key' => idempotency_key } } + format "json" + headers { { "Idempotence-Key" => idempotency_key } } response(200) { |*res| Entity::Payment.build(*res) } response(400) { |*res| Error.build(*res) } @@ -55,8 +55,8 @@ module Yookassa path { "/#{payment_id}/cancel" } - format 'json' - headers { { 'Idempotence-Key' => idempotency_key } } + format "json" + headers { { "Idempotence-Key" => idempotency_key } } response(200) { |*res| Entity::Payment.build(*res) } response(400) { |*res| Error.build(*res) } diff --git a/lib/yookassa/refund.rb b/lib/yookassa/refund.rb index a3acf5b..78fda6a 100644 --- a/lib/yookassa/refund.rb +++ b/lib/yookassa/refund.rb @@ -5,7 +5,7 @@ module Yookassa option :shop_id, proc(&:to_s) option :api_key, proc(&:to_s) - path { 'https://api.yookassa.ru/v3/refunds' } + path { "https://api.yookassa.ru/v3/refunds" } security { basic_auth shop_id, api_key } operation :get_refund_info do @@ -24,8 +24,8 @@ module Yookassa http_method :post - format 'json' - headers { { 'Idempotence-Key' => idempotency_key } } + format "json" + headers { { "Idempotence-Key" => idempotency_key } } body { payload } response(200) { |*res| Entity::Refund.build(*res) } diff --git a/lib/yookassa/response.rb b/lib/yookassa/response.rb index f4053b9..9c0fc19 100644 --- a/lib/yookassa/response.rb +++ b/lib/yookassa/response.rb @@ -4,7 +4,7 @@ module Yookassa class Response extend Dry::Initializer option :id, proc(&:to_s) - option :status, proc(&:to_s), default: proc { nil } + option :status, proc(&:to_s), default: proc {} class << self def build(*res) @@ -13,7 +13,7 @@ module Yookassa end def new(opts) - super opts.each_with_object({}) { |(key, val), obj| obj[key.to_sym] = val } + super opts.transform_keys(&:to_sym) end end end diff --git a/lib/yookassa/version.rb b/lib/yookassa/version.rb index 66fd411..fe42168 100644 --- a/lib/yookassa/version.rb +++ b/lib/yookassa/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Yookassa - VERSION = '0.1.0' + VERSION = "0.1.0" end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1539d0c..56a2849 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,13 +1,13 @@ # frozen_string_literal: true begin - require 'pry' + require "pry" rescue LoadError nil end -require 'yookassa' -require 'webmock/rspec' +require "yookassa" +require "webmock/rspec" RSpec.configure do |config| config.order = :random diff --git a/spec/yookassa/payment_spec.rb b/spec/yookassa/payment_spec.rb index dfa53f4..3d0f2fa 100644 --- a/spec/yookassa/payment_spec.rb +++ b/spec/yookassa/payment_spec.rb @@ -1,104 +1,104 @@ # frozen_string_literal: true RSpec.describe Yookassa::Payment do - let(:settings) { { shop_id: 'SHOP_ID', api_key: 'API_KEY' } } + let(:settings) { { shop_id: "SHOP_ID", api_key: "API_KEY" } } let(:idempotency_key) { 12_345 } let(:payment) { described_class.new(settings) } - shared_examples 'returns_payment_object' do - it 'returns success' do + shared_examples "returns_payment_object" do + it "returns success" do expect(subject).to be_kind_of Yookassa::Response - expect(subject.id).to eq '2490ded1-000f-5000-8000-1f64111bc63e' + expect(subject.id).to eq "2490ded1-000f-5000-8000-1f64111bc63e" expect(subject.test).to eq true expect(subject.paid).to eq false - expect(subject.status).to eq 'pending' + expect(subject.status).to eq "pending" expect(subject.captured_at).to eq nil - expect(subject.created_at).to eq '2019-06-10T21:26:41.395Z' + expect(subject.created_at).to eq "2019-06-10T21:26:41.395Z" expect(subject.description).to eq nil expect(subject.expires_at).to eq nil - expect(subject.metadata).to eq Hash[] + expect(subject.metadata).to eq({}) expect(subject.amount).to be_kind_of Yookassa::Entity::Amount - expect(subject.amount.currency).to eq 'RUB' + expect(subject.amount.currency).to eq "RUB" expect(subject.amount.value).to eq 10.0 expect(subject.confirmation).to be_kind_of Yookassa::Entity::Confirmation - expect(subject.confirmation.confirmation_url).to eq 'https://money.yookassa.ru/payments/external/confirmation?orderId=2490ded1-000f-5000-8000-1f64111bc63e' - expect(subject.confirmation.type).to eq 'redirect' - expect(subject.confirmation.return_url).to eq 'https://url.test' + expect(subject.confirmation.confirmation_url).to eq "https://money.yookassa.ru/payments/external/confirmation?orderId=2490ded1-000f-5000-8000-1f64111bc63e" + expect(subject.confirmation.type).to eq "redirect" + expect(subject.confirmation.return_url).to eq "https://url.test" expect(subject.confirmation.enforce).to eq nil expect(subject.payment_method).to be_kind_of Yookassa::Entity::PaymentMethod expect(subject.payment_method.card).to eq nil - expect(subject.payment_method.id).to eq '2490ded1-000f-5000-8000-1f64111bc63e' + expect(subject.payment_method.id).to eq "2490ded1-000f-5000-8000-1f64111bc63e" expect(subject.payment_method.saved).to eq false - expect(subject.payment_method.type).to eq 'bank_card' + expect(subject.payment_method.type).to eq "bank_card" expect(subject.payment_method.title).to eq nil end end - describe '#create' do - let(:params) { { payment: File.read('spec/fixtures/payment.json') } } - let(:url) { 'https://api.yookassa.ru/v3/payments' } - let(:body) { File.read('spec/fixtures/payment_response.json') } + describe "#create" do + let(:params) { { payment: File.read("spec/fixtures/payment.json") } } + let(:url) { "https://api.yookassa.ru/v3/payments" } + let(:body) { File.read("spec/fixtures/payment_response.json") } before { stub_request(:any, //).to_return(body: body) } subject { payment.create(payment: params, idempotency_key: idempotency_key) } - it 'sends a request' do + it "sends a request" do subject expect(a_request(:post, url)).to have_been_made end - it_behaves_like 'returns_payment_object' + it_behaves_like "returns_payment_object" end - describe '#get_payment_info' do - let(:payment_id) { '2490ded1-000f-5000-8000-1f64111bc63e' } + describe "#get_payment_info" do + let(:payment_id) { "2490ded1-000f-5000-8000-1f64111bc63e" } let(:url) { "https://api.yookassa.ru/v3/payments/#{payment_id}" } - let(:body) { File.read('spec/fixtures/payment_response.json') } + let(:body) { File.read("spec/fixtures/payment_response.json") } before { stub_request(:any, //).to_return(body: body) } subject { payment.get_payment_info(payment_id: payment_id) } - it 'sends a request' do + it "sends a request" do subject expect(a_request(:get, url)).to have_been_made end - it_behaves_like 'returns_payment_object' + it_behaves_like "returns_payment_object" end - describe '#capture' do - let(:payment_id) { '2490ded1-000f-5000-8000-1f64111bc63e' } - let(:params) { { payment: File.read('spec/fixtures/payment.json') } } + describe "#capture" do + let(:payment_id) { "2490ded1-000f-5000-8000-1f64111bc63e" } + let(:params) { { payment: File.read("spec/fixtures/payment.json") } } let(:url) { "https://api.yookassa.ru/v3/payments/#{payment_id}/capture" } - let(:body) { File.read('spec/fixtures/payment_response.json') } + let(:body) { File.read("spec/fixtures/payment_response.json") } before { stub_request(:any, //).to_return(body: body) } subject { payment.capture(payment_id: payment_id, idempotency_key: idempotency_key) } - it 'sends a request' do + it "sends a request" do subject expect(a_request(:post, url)).to have_been_made end - it_behaves_like 'returns_payment_object' + it_behaves_like "returns_payment_object" end - describe '#cancel' do - let(:payment_id) { '2490ded1-000f-5000-8000-1f64111bc63e' } + describe "#cancel" do + let(:payment_id) { "2490ded1-000f-5000-8000-1f64111bc63e" } let(:url) { "https://api.yookassa.ru/v3/payments/#{payment_id}/cancel" } - let(:body) { File.read('spec/fixtures/payment_response.json') } + let(:body) { File.read("spec/fixtures/payment_response.json") } before { stub_request(:any, //).to_return(body: body) } subject { payment.cancel(payment_id: payment_id, idempotency_key: idempotency_key) } - it 'sends a request' do + it "sends a request" do subject expect(a_request(:post, url)).to have_been_made end - it_behaves_like 'returns_payment_object' + it_behaves_like "returns_payment_object" end end diff --git a/spec/yookassa/refund_spec.rb b/spec/yookassa/refund_spec.rb index 5373e80..b1c6b7c 100644 --- a/spec/yookassa/refund_spec.rb +++ b/spec/yookassa/refund_spec.rb @@ -1,54 +1,54 @@ # frozen_string_literal: true RSpec.describe Yookassa::Refund do - let(:settings) { { shop_id: 'SHOP_ID', api_key: 'API_KEY' } } + let(:settings) { { shop_id: "SHOP_ID", api_key: "API_KEY" } } let(:idempotency_key) { 12_345 } let(:payment) { described_class.new(settings) } - shared_examples 'returns_refund_object' do - it 'returns success' do + shared_examples "returns_refund_object" do + it "returns success" do expect(subject).to be_kind_of Yookassa::Response - expect(subject.id).to eq '2491ab0c-0015-5000-9000-1640c7f1a6f0' - expect(subject.payment_id).to eq '2491a6e2-000f-5000-9000-1480e820ae17' - expect(subject.status).to eq 'succeeded' - expect(subject.created_at).to eq '2019-06-11T11:58:04.502Z' - expect(subject.description).to eq 'test refund, idem-key 78c95366-ec4b-4284-a0fd-41e694bcdf11' + expect(subject.id).to eq "2491ab0c-0015-5000-9000-1640c7f1a6f0" + expect(subject.payment_id).to eq "2491a6e2-000f-5000-9000-1480e820ae17" + expect(subject.status).to eq "succeeded" + expect(subject.created_at).to eq "2019-06-11T11:58:04.502Z" + expect(subject.description).to eq "test refund, idem-key 78c95366-ec4b-4284-a0fd-41e694bcdf11" expect(subject.amount).to be_kind_of Yookassa::Entity::Amount - expect(subject.amount.currency).to eq 'RUB' + expect(subject.amount.currency).to eq "RUB" expect(subject.amount.value).to eq 8.0 end end - describe '#create' do - let(:payload) { File.read('spec/fixtures/refund.json') } - let(:url) { 'https://api.yookassa.ru/v3/refunds' } - let(:body) { File.read('spec/fixtures/refund_response.json') } + describe "#create" do + let(:payload) { File.read("spec/fixtures/refund.json") } + let(:url) { "https://api.yookassa.ru/v3/refunds" } + let(:body) { File.read("spec/fixtures/refund_response.json") } before { stub_request(:any, //).to_return(body: body) } subject { payment.create(payload: payload, idempotency_key: idempotency_key) } - it 'sends a request' do + it "sends a request" do subject expect(a_request(:post, url)).to have_been_made end - it_behaves_like 'returns_refund_object' + it_behaves_like "returns_refund_object" end - describe '#get_refund_info' do - let(:payment_id) { '2490ded1-000f-5000-8000-1f64111bc63e' } + describe "#get_refund_info" do + let(:payment_id) { "2490ded1-000f-5000-8000-1f64111bc63e" } let(:url) { "https://api.yookassa.ru/v3/refunds/#{payment_id}" } - let(:body) { File.read('spec/fixtures/refund_response.json') } + let(:body) { File.read("spec/fixtures/refund_response.json") } before { stub_request(:any, //).to_return(body: body) } subject { payment.get_refund_info(payment_id: payment_id) } - it 'sends a request' do + it "sends a request" do subject expect(a_request(:get, url)).to have_been_made end - it_behaves_like 'returns_refund_object' + it_behaves_like "returns_refund_object" end end diff --git a/spec/yookassa_spec.rb b/spec/yookassa_spec.rb index c08df3a..ced91d5 100644 --- a/spec/yookassa_spec.rb +++ b/spec/yookassa_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true RSpec.describe Yookassa do - it 'has a version number' do + it "has a version number" do expect(Yookassa::VERSION).not_to be nil end end diff --git a/yookassa.gemspec b/yookassa.gemspec index b375d76..ef95cd9 100644 --- a/yookassa.gemspec +++ b/yookassa.gemspec @@ -1,32 +1,32 @@ # frozen_string_literal: true -lib = File.expand_path('lib', __dir__) +lib = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'yookassa/version' +require "yookassa/version" Gem::Specification.new do |spec| - spec.name = 'yookassa' + spec.name = "yookassa" spec.version = Yookassa::VERSION - spec.authors = 'Andrey Paderin' - spec.email = 'andy.paderin@gmail.com' + spec.authors = "Andrey Paderin" + spec.email = "andy.paderin@gmail.com" - spec.summary = 'This product is used for managing payments under The Yookassa API For usage by those who implemented Yookassa using the API method.' - spec.homepage = 'https://github.com/paderinandrey/yookassa' - spec.license = 'MIT' + spec.summary = "Yookassa API SDK for Ruby" + spec.homepage = "https://github.com/paderinandrey/yookassa" + spec.license = "MIT" spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) spec.test_files = spec.files.grep(/^spec/) - spec.extra_rdoc_files = Dir['README.md', 'LICENSE', 'CHANGELOG.md'] + spec.extra_rdoc_files = Dir["README.md", "LICENSE", "CHANGELOG.md"] - spec.require_paths = ['lib'] + spec.require_paths = ["lib"] - spec.required_ruby_version = '>= 2.5' + spec.required_ruby_version = ">= 2.6" - spec.add_runtime_dependency 'evil-client', '~> 3.0' + spec.add_runtime_dependency "evil-client", "~> 3.0" - 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", ">= 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" end