ibandit 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -5
- data/.travis.yml +1 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -1
- data/ibandit.gemspec +1 -1
- data/lib/ibandit.rb +1 -1
- data/lib/ibandit/check_digit.rb +1 -1
- data/lib/ibandit/german_details_converter.rb +1 -1
- data/lib/ibandit/iban.rb +3 -3
- data/lib/ibandit/local_details_cleaner.rb +2 -2
- data/lib/ibandit/version.rb +1 -1
- data/spec/ibandit/pseudo_iban_assembler_spec.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29a9fc0b51d3da97442a468761fa927eb8912028030752acd47537b46b7fe2e1
|
4
|
+
data.tar.gz: 012dd0332664e89b2e95e43b0ef4888b74b1c4be673da954a7a85e6564d20c59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39984a7f77d2cfd7b8033869eb16ff3b27ed1e173e63ff8d31dbd8cefadeb3ed96bc3ddaa5144e5fa313c74e5979e1ecad8b7b840c4e684cf889ae212678e3ef
|
7
|
+
data.tar.gz: 8ca397438ee9ad97bbe3d7dbc33a1ea2950b29895f62f951a55ee92e05d5fca0599d58614a4730fc24efba39b600a5de4bb9173971473defa6002c90bd09ddd0
|
data/.rubocop.yml
CHANGED
@@ -6,24 +6,24 @@ AllCops:
|
|
6
6
|
TargetRubyVersion: 2.4
|
7
7
|
|
8
8
|
# Limit lines to 80 characters.
|
9
|
-
LineLength:
|
9
|
+
Metrics/LineLength:
|
10
10
|
Max: 80
|
11
11
|
|
12
|
-
ClassLength:
|
12
|
+
Metrics/ClassLength:
|
13
13
|
Max: 400
|
14
14
|
|
15
15
|
# Avoid single-line methods.
|
16
|
-
SingleLineMethods:
|
16
|
+
Style/SingleLineMethods:
|
17
17
|
AllowIfMethodIsEmpty: true
|
18
18
|
|
19
19
|
# Wants underscores in all large numbers. Pain in the ass for things like
|
20
20
|
# unix timestamps.
|
21
|
-
NumericLiterals:
|
21
|
+
Style/NumericLiterals:
|
22
22
|
Enabled: false
|
23
23
|
|
24
24
|
# Wants you to use the same argument names for every reduce. This seems kinda
|
25
25
|
# naff compared to naming them semantically
|
26
|
-
SingleLineBlockParams:
|
26
|
+
Style/SingleLineBlockParams:
|
27
27
|
Enabled: false
|
28
28
|
|
29
29
|
Style/SignalException:
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/ibandit.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.add_development_dependency "pry-nav", "~> 0.2"
|
9
9
|
gem.add_development_dependency "rspec", "~> 3.3"
|
10
10
|
gem.add_development_dependency "rspec-its", "~> 1.2"
|
11
|
-
gem.add_development_dependency "rubocop", "~> 0.
|
11
|
+
gem.add_development_dependency "rubocop", "~> 0.75.1"
|
12
12
|
gem.add_development_dependency "sax-machine", "~> 1.3"
|
13
13
|
|
14
14
|
gem.add_runtime_dependency "i18n"
|
data/lib/ibandit.rb
CHANGED
data/lib/ibandit/check_digit.rb
CHANGED
@@ -517,7 +517,7 @@ module Ibandit
|
|
517
517
|
updated_account_number =
|
518
518
|
case unpadded_account_number.size
|
519
519
|
when 5, 6 then unpadded_account_number + "00"
|
520
|
-
when 7
|
520
|
+
when 7
|
521
521
|
if Check63.new(unpadded_account_number + "00").valid?
|
522
522
|
unpadded_account_number + "00"
|
523
523
|
else
|
data/lib/ibandit/iban.rb
CHANGED
@@ -460,12 +460,12 @@ module Ibandit
|
|
460
460
|
@swift_branch_code = try_dup(local_details[:swift_branch_code])
|
461
461
|
@swift_bank_code = try_dup(local_details[:swift_bank_code])
|
462
462
|
|
463
|
-
@iban
|
463
|
+
@iban = IBANAssembler.assemble(swift_details)
|
464
464
|
|
465
465
|
if source == :pseudo_iban
|
466
|
-
@check_digits
|
466
|
+
@check_digits = try_dup(local_details[:check_digits])
|
467
467
|
else
|
468
|
-
@check_digits
|
468
|
+
@check_digits = @iban.slice(2, 2) unless @iban.nil?
|
469
469
|
end
|
470
470
|
end
|
471
471
|
|
@@ -198,7 +198,7 @@ module Ibandit
|
|
198
198
|
bank_code, account_number = local_details[:account_number].split("-", 2)
|
199
199
|
elsif local_details[:account_number].gsub(/\s/, "").length == 14
|
200
200
|
cleaned_account_number = local_details[:account_number].gsub(/\s/, "")
|
201
|
-
bank_code
|
201
|
+
bank_code = cleaned_account_number.slice(0, 4)
|
202
202
|
account_number = cleaned_account_number.slice(4, 10)
|
203
203
|
else
|
204
204
|
return {}
|
@@ -573,7 +573,7 @@ module Ibandit
|
|
573
573
|
ken_1 = parts[2].nil? ? "" : parts[2].rjust(6, "0")
|
574
574
|
ken_2 = parts[3].nil? ? "" : parts[3].rjust(4, "0")
|
575
575
|
|
576
|
-
kennitala
|
576
|
+
kennitala = ken_1.empty? ? "" : (ken_1 + ken_2).rjust(10, "0")
|
577
577
|
|
578
578
|
hufo + reikningsnumer + kennitala
|
579
579
|
end
|
data/lib/ibandit/version.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
require "spec_helper"
|
4
4
|
|
5
5
|
describe Ibandit::PseudoIBANAssembler do
|
6
|
-
subject(:pseudo_iban) { described_class.new(local_details).assemble }
|
6
|
+
subject(:pseudo_iban) { described_class.new(**local_details).assemble }
|
7
7
|
|
8
8
|
context "for Sweden" do
|
9
9
|
context "with valid parameters" 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: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GoCardless
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.
|
89
|
+
version: 0.75.1
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.
|
96
|
+
version: 0.75.1
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: sax-machine
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
209
|
- !ruby/object:Gem::Version
|
210
210
|
version: '0'
|
211
211
|
requirements: []
|
212
|
-
rubygems_version: 3.
|
212
|
+
rubygems_version: 3.1.2
|
213
213
|
signing_key:
|
214
214
|
specification_version: 4
|
215
215
|
summary: Convert national banking details into IBANs, and vice-versa.
|