ibandit 0.11.2 → 0.11.3

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
2
  SHA1:
3
- metadata.gz: d300c227e1241bbe38f67903a55eaf488372d7fd
4
- data.tar.gz: 7b0fc9cacb089d31f3241365e073fcc8f38a5d05
3
+ metadata.gz: 80501a5289264551642783a61e29f3945e5f9887
4
+ data.tar.gz: 6cdd2b4ca9dcbf371f5a931bed37b50142f8a29d
5
5
  SHA512:
6
- metadata.gz: 35dc612464c188343d734c5db8aa65f1d7fa685eb3cbf387e166f670adbae07fcd6de36aacaf98a15a571cd06be36ca33e958516df440950773c4294681f2c89
7
- data.tar.gz: 26f75f511ddcf6af67c4d89474c52a1312d405cb8d013b281de30b1f77ca6a6c39c85dede2ec19fe36d3f1b2bca162e5ecd7ceb89c0fecb8389ae3cd43ba6dd8
6
+ metadata.gz: 3169d8e8b92c4249ba37daea8ab1ac5300527d184421fb4b46e4efe7fe484f03bbe05e719ea546a9322067185281e2fef5bda7ef3333910920b5c10ef941ef23
7
+ data.tar.gz: 9018fcda5c13367d8a82b8059ca685c6fc5912f6aa93460c8307f07acd63e81bce41ee794809a3935d7d2ed9ca56a02221c97ab4cb9458ce317c6a61bb488bf2
data/.travis.yml CHANGED
@@ -2,16 +2,11 @@ language: ruby
2
2
 
3
3
  matrix:
4
4
  allow_failures:
5
- - rvm: jruby
6
- - rvm: rbx-2
7
5
 
8
6
  rvm:
9
- - 2.0
10
7
  - 2.1
11
8
  - 2.2
12
9
  - 2.3.0
13
- - jruby
14
- - rbx-2
15
10
 
16
11
  sudo: false
17
12
 
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 0.11.3 - March 9, 2017
2
+
3
+ - Fix bug: Previously, constructing an `Ibandit::IBAN` object with
4
+ `country_code: "SE"` and certain 4-digit values for `account_number`
5
+ would throw `NoMethodError`. The IBAN object can now be successfully
6
+ constructed (and will return a false value for `valid?`).
7
+
1
8
  ## 0.11.2 - July 4, 2016
2
9
 
3
10
  - Handle invalid pseudo-IBANs
@@ -76,15 +76,15 @@ module Ibandit
76
76
  end
77
77
 
78
78
  return serial_number unless bank_info.fetch(:zerofill_serial_number)
79
-
80
- serial_number.rjust(serial_number_length, '0')
79
+ serial_number && serial_number.rjust(serial_number_length, '0')
81
80
  end
82
81
 
83
82
  def swift_account_number
84
- if bank_info.fetch(:include_clearing_code)
83
+ if bank_info.fetch(:include_clearing_code) &&
84
+ clearing_code && serial_number
85
85
  (clearing_code + serial_number).rjust(17, '0')
86
86
  else
87
- serial_number.rjust(17, '0')
87
+ serial_number && serial_number.rjust(17, '0')
88
88
  end
89
89
  end
90
90
  end
@@ -1,3 +1,3 @@
1
1
  module Ibandit
2
- VERSION = '0.11.2'.freeze
2
+ VERSION = '0.11.3'.freeze
3
3
  end
@@ -131,6 +131,16 @@ describe Ibandit::Sweden::LocalDetailsConverter do
131
131
  its([:swift_bank_code]) { is_expected.to eq('800') }
132
132
  its([:swift_account_number]) { is_expected.to eq('00820169143579630') }
133
133
  end
134
+
135
+ context 'in the 8000s range, with a very short input' do
136
+ let(:account_number) { '8004' }
137
+ let(:branch_code) { nil }
138
+
139
+ its([:account_number]) { is_expected.to be_nil }
140
+ its([:branch_code]) { is_expected.to eq('8004') }
141
+ its([:swift_bank_code]) { is_expected.to eq('800') }
142
+ its([:swift_account_number]) { is_expected.to be_nil }
143
+ end
134
144
  end
135
145
 
136
146
  context 'with a Sparbanken Öresund clearing code' 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.2
4
+ version: 0.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grey Baker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-04 00:00:00.000000000 Z
11
+ date: 2017-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -176,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
176
  version: '0'
177
177
  requirements: []
178
178
  rubyforge_project:
179
- rubygems_version: 2.5.1
179
+ rubygems_version: 2.5.2
180
180
  signing_key:
181
181
  specification_version: 4
182
182
  summary: Convert national banking details into IBANs, and vice-versa.