ibandit 0.11.16 → 0.11.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: f9a02ead16e75d81f8b1ada11d37372b5d6f3f293baf480fedabc42bae3edc9f
4
- data.tar.gz: d73bfd7838bc38ae20e351e8104113fed593fa82c4e376d9939c0969a124441e
2
+ SHA1:
3
+ metadata.gz: d185a7140b320e5a5d7e46b3c42276341b61093c
4
+ data.tar.gz: afcd5829a0f4ef9b74fd35ee66b7045c5f985154
5
5
  SHA512:
6
- metadata.gz: 2da7f3eea03bb511bc23373c38cb30e28e044e56365359aafccf17770350226a57a7a9a26cf593996a082fc185353a3ab189a671fff2d30cfe6bea3a8222190b
7
- data.tar.gz: 5a1a37becef9f46fce19445aec3bec965e11fcd62db747d74437dd7b5c2c92f2935a6d964446975445d4e79063d2adf49320ce7c2957269dfedb3ff78858dac8
6
+ metadata.gz: b31920d1c68bb1caaf52a0c0e2b31dedcae5ec91169f57ff525639bcc0f3c2a444701096569b278c536abacf95729cdef80c546178b7f37f7cec70558081ff35
7
+ data.tar.gz: 26f3c276022e91fd683335d454a1e81f5b8d49b3e4ea06e3b74212135350942fec82a96772a351027dd03a35a7782dd676715b8997864fe792a08dd4968e787c
@@ -1,3 +1,7 @@
1
+ ## 0.11.17 - September 17, 2018
2
+
3
+ - Do not crash when given too short account numbers for New Zealand
4
+
1
5
  ## 0.11.16 - September 3, 2018
2
6
 
3
7
  - Loosen `i18n` dependency (thanks @glaszig!)
data/README.md CHANGED
@@ -522,25 +522,25 @@ iban.iban # => nil
522
522
  iban = Ibandit::IBAN.new(
523
523
  country_code: 'NZ',
524
524
  bank_code: '01',
525
- branch_code: '5659',
525
+ branch_code: '0004',
526
526
  account_number: '3333333-44' # 7 digit account number and 2/3-digit account suffix
527
527
  )
528
- iban.pseudo_iban # => "NZZZ0156593333333044"
528
+ iban.pseudo_iban # => "NZZZ0100043333333044"
529
529
  iban.iban # => nil
530
530
 
531
531
  iban = Ibandit::IBAN.new(
532
532
  country_code: 'NZ',
533
- account_number: '01-5659-3333333-44'
533
+ account_number: '01-0004-3333333-44'
534
534
  )
535
- iban.pseudo_iban # => "NZZZ0156593333333044"
535
+ iban.pseudo_iban # => "NZZZ0100043333333044"
536
536
  iban.bank_code # => "01"
537
- iban.branch_code # => "5659"
537
+ iban.branch_code # => "0004"
538
538
  iban.account_number # => "3333333044"
539
539
 
540
- iban = Ibandit::IBAN.new('NZZZ0156593333333044')
540
+ iban = Ibandit::IBAN.new('NZZZ0100043333333044')
541
541
  iban.country_code # => "NZ"
542
542
  iban.bank_code # => "01"
543
- iban.branch_code # => "5659"
543
+ iban.branch_code # => "0004"
544
544
  iban.account_number # => "3333333044"
545
545
  ```
546
546
 
@@ -455,7 +455,7 @@ module Ibandit
455
455
  account_number = cleaned_account_number[6..-1]
456
456
  end
457
457
 
458
- if account_number.length == 9
458
+ if account_number && account_number.length == 9
459
459
  # > Some banks (such as BNZ) include three digits of the suffix in their
460
460
  # > presentation of the account number to the end customer. Other banks
461
461
  # > only show the last two digits of the suffix to the end customer.
@@ -1,3 +1,3 @@
1
1
  module Ibandit
2
- VERSION = "0.11.16".freeze
2
+ VERSION = "0.11.17".freeze
3
3
  end
@@ -956,6 +956,11 @@ describe Ibandit::LocalDetailsCleaner do
956
956
  its([:branch_code]) { is_expected.to eq("2222") }
957
957
  its([:account_number]) { is_expected.to eq("3333333044") }
958
958
  end
959
+
960
+ context "when the account number is shorter than 6 chars" do
961
+ let(:account_number) { "12345" }
962
+ its([:account_number]) { is_expected.to be_nil }
963
+ end
959
964
  end
960
965
 
961
966
  context "without an account number" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibandit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.16
4
+ version: 0.11.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-03 00:00:00.000000000 Z
11
+ date: 2018-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  version: '0'
207
207
  requirements: []
208
208
  rubyforge_project:
209
- rubygems_version: 2.7.6
209
+ rubygems_version: 2.6.14
210
210
  signing_key:
211
211
  specification_version: 4
212
212
  summary: Convert national banking details into IBANs, and vice-versa.