ibandit 0.8.4 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/ibandit/local_details_cleaner.rb +7 -1
- data/lib/ibandit/version.rb +1 -1
- data/spec/ibandit/local_details_cleaner_spec.rb +17 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4fcf311c9ff784733a34a07ecb38aa6699cd041
|
4
|
+
data.tar.gz: bb2c9ceb88d909c050c430e5e8e11965f9b11152
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f9e13863ddfb58f0b7a8ecc85adaaad9337fe392e50b7bedfcd2a79a110f2f622013c46993384dee3ad4dba4945856f5e91c4e2a3638fe2a090175207eb1374
|
7
|
+
data.tar.gz: d9bec271c5691fb295ce0e6ee397f770675d521af9aacf21170c7d28b289e4127cde62a0ef4c391537d47c3ec6f43c727a31722bc1808fc277b93aa1f5b45f5b
|
data/CHANGELOG.md
CHANGED
@@ -147,8 +147,14 @@ module Ibandit
|
|
147
147
|
if local_details[:bank_code]
|
148
148
|
bank_code = local_details[:bank_code].rjust(4, '0')
|
149
149
|
account_number = local_details[:account_number].rjust(10, '0')
|
150
|
-
|
150
|
+
elsif local_details[:account_number].include?('-')
|
151
151
|
bank_code, account_number = local_details[:account_number].split('-', 2)
|
152
|
+
elsif local_details[:account_number].gsub(/\s/, '').length == 14
|
153
|
+
cleaned_account_number = local_details[:account_number].gsub(/\s/, '')
|
154
|
+
bank_code = cleaned_account_number.slice(0, 4)
|
155
|
+
account_number = cleaned_account_number.slice(4, 10)
|
156
|
+
else
|
157
|
+
return {}
|
152
158
|
end
|
153
159
|
|
154
160
|
{
|
data/lib/ibandit/version.rb
CHANGED
@@ -245,6 +245,23 @@ describe Ibandit::LocalDetailsCleaner do
|
|
245
245
|
its([:account_number]) { is_expected.to eq('0003179681') }
|
246
246
|
end
|
247
247
|
|
248
|
+
context 'with a space-separated 14-digit account number' do
|
249
|
+
let(:bank_code) { nil }
|
250
|
+
let(:branch_code) { nil }
|
251
|
+
let(:account_number) { '0345 0003179681' }
|
252
|
+
|
253
|
+
its([:bank_code]) { is_expected.to eq('0345') }
|
254
|
+
its([:account_number]) { is_expected.to eq('0003179681') }
|
255
|
+
end
|
256
|
+
|
257
|
+
context 'with a space-separated 13-digit account number' do
|
258
|
+
let(:bank_code) { nil }
|
259
|
+
let(:branch_code) { nil }
|
260
|
+
let(:account_number) { '0345 003179681' }
|
261
|
+
|
262
|
+
it { is_expected.to eq(local_details_with_swift) }
|
263
|
+
end
|
264
|
+
|
248
265
|
context 'without an account number' do
|
249
266
|
let(:account_number) { nil }
|
250
267
|
it { is_expected.to eq(local_details_with_swift) }
|
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.8.
|
4
|
+
version: 0.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grey Baker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|