From 553bedc82b44fd9a98143d3b97e1b7f917d62810 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Oct 2021 18:12:55 +0000 Subject: [PATCH 1/2] Update gc_ruboconfig requirement from ~> 2.26.0 to ~> 2.29.0 Updates the requirements on [gc_ruboconfig](https://github.com/gocardless/ruboconfig) to permit the latest version. - [Release notes](https://github.com/gocardless/ruboconfig/releases) - [Changelog](https://github.com/gocardless/gc_ruboconfig/blob/master/CHANGELOG.md) - [Commits](https://github.com/gocardless/ruboconfig/compare/v2.26.0...v2.29.0) --- updated-dependencies: - dependency-name: gc_ruboconfig dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- ibandit.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ibandit.gemspec b/ibandit.gemspec index 393baf4..09b2e94 100644 --- a/ibandit.gemspec +++ b/ibandit.gemspec @@ -3,7 +3,7 @@ require File.expand_path("lib/ibandit/version", __dir__) Gem::Specification.new do |gem| - gem.add_development_dependency "gc_ruboconfig", "~> 2.26.0" + gem.add_development_dependency "gc_ruboconfig", "~> 2.29.0" gem.add_development_dependency "nokogiri", "~> 1.6" gem.add_development_dependency "pry", "~> 0.13" gem.add_development_dependency "pry-byebug", "~> 3.9" From 1ee0cb62729af5ddbdfbbc2c9224f86512d4d3bb Mon Sep 17 00:00:00 2001 From: Joseph Southan Date: Wed, 20 Oct 2021 09:54:36 +0100 Subject: [PATCH 2/2] Autocorrect gc_ruboconfig v2.29 --- lib/ibandit/german_details_converter.rb | 6 ++++-- lib/ibandit/local_details_cleaner.rb | 3 ++- spec/ibandit/german_details_converter_spec.rb | 4 ++-- spec/ibandit/iban_spec.rb | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/ibandit/german_details_converter.rb b/lib/ibandit/german_details_converter.rb index fbebe9a..75104a9 100644 --- a/lib/ibandit/german_details_converter.rb +++ b/lib/ibandit/german_details_converter.rb @@ -270,13 +270,15 @@ def padded_account_number_for_validity when "13" if unpadded_account_number.size.between?(6, 7) unpadded_account_number + "00" - else @account_number + else + @account_number end when "76" case unpadded_account_number.size when 7..8 if Check76.new(@account_number).valid? then @account_number - else unpadded_account_number + "00" + else + unpadded_account_number + "00" end when 5..6 then unpadded_account_number + "00" else @account_number diff --git a/lib/ibandit/local_details_cleaner.rb b/lib/ibandit/local_details_cleaner.rb index 435c5c0..2da1ae0 100644 --- a/lib/ibandit/local_details_cleaner.rb +++ b/lib/ibandit/local_details_cleaner.rb @@ -42,7 +42,8 @@ def self.required_fields(country_code) %i[account_number] when "GB", "IE", "MT" if Ibandit.bic_finder.nil? then %i[bank_code branch_code account_number] - else %i[branch_code account_number] + else + %i[branch_code account_number] end when "AU" %i[branch_code account_number] diff --git a/spec/ibandit/german_details_converter_spec.rb b/spec/ibandit/german_details_converter_spec.rb index 977461e..9e98679 100644 --- a/spec/ibandit/german_details_converter_spec.rb +++ b/spec/ibandit/german_details_converter_spec.rb @@ -19,7 +19,7 @@ convertor.fetch("valid", []).each do |tuple| context "bank code: #{tuple['bank_code']} account number " \ - "#{tuple['account_number']}" do + "#{tuple['account_number']}" do let(:bank_code) do tuple["bank_code"] end @@ -44,7 +44,7 @@ convertor.fetch("invalid", []).each do |tuple| context "bank code: #{tuple['bank_code']} account number " \ - "#{tuple['account_number']}" do + "#{tuple['account_number']}" do let(:bank_code) { tuple["bank_code"] || "00000000" } let(:account_number) { tuple["account_number"] } diff --git a/spec/ibandit/iban_spec.rb b/spec/ibandit/iban_spec.rb index 3e3e11e..8e677d8 100755 --- a/spec/ibandit/iban_spec.rb +++ b/spec/ibandit/iban_spec.rb @@ -1061,7 +1061,7 @@ iban.valid_length? expect(iban.errors). to include(length: "Length doesn't match SWIFT specification " \ - "(expected 22 characters, received 20)") + "(expected 22 characters, received 20)") end end @@ -1313,7 +1313,7 @@ iban.valid_branch_code_length? expect(iban.errors). to include(branch_code: "is the wrong length (should be 6 " \ - "characters)") + "characters)") end end