banktools-se 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +2 -3
- data/.gitignore +1 -0
- data/.rubocop.yml +5 -0
- data/Gemfile +5 -0
- data/Rakefile +2 -2
- data/banktools-se.gemspec +4 -3
- data/lib/banktools-se/account.rb +5 -5
- data/lib/banktools-se/bankgiro.rb +1 -1
- data/lib/banktools-se/ocr.rb +1 -0
- data/lib/banktools-se/plusgiro.rb +1 -1
- data/lib/banktools-se/version.rb +1 -1
- data/spec/account_spec.rb +1 -1
- data/spec/bankgiro_spec.rb +1 -1
- data/spec/plusgiro_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae26d83c75f488a904bc1dcaffada866c129f7f923a4083ef4c2886c58c4d605
|
4
|
+
data.tar.gz: 1a52ea7948ea5d90c0df16501455015ff8c870f22f00b64ca7ccf64f050aba83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ea749b95887d14fce1fa99b3f34537f497706ea1670050014cf94064830b6e23a1db8c3a71caeaab0282a559879562ea4305d9507608f1ad01f04c0ffa859fc
|
7
|
+
data.tar.gz: 3aef88169d2c7be49fcfa7d88148db48db4a2ff2d9f8822cc9898ee03f9fad0cc0b4e7f9197ce0410f1021c3459172b8159d99d49269f20a0f06c98b882f8eb7
|
data/.github/workflows/ci.yml
CHANGED
@@ -18,11 +18,10 @@ jobs:
|
|
18
18
|
steps:
|
19
19
|
- uses: actions/checkout@v2
|
20
20
|
- name: Set up Ruby ${{ matrix.ruby-version }}
|
21
|
-
uses: ruby/setup-ruby@
|
21
|
+
uses: ruby/setup-ruby@ae9cb3b565e36682a2c6045e4f664388da4c73aa
|
22
22
|
with:
|
23
23
|
ruby-version: ${{ matrix.ruby-version }}
|
24
|
-
|
25
|
-
run: bundle install
|
24
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
26
25
|
- name: Run tests
|
27
26
|
run: bundle exec rake
|
28
27
|
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/banktools-se.gemspec
CHANGED
@@ -5,14 +5,15 @@ require "banktools-se/version"
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "banktools-se"
|
7
7
|
s.version = BankTools::SE::VERSION
|
8
|
-
s.authors = ["Henrik Nyh"]
|
9
|
-
s.email = ["henrik@barsoom.se"]
|
8
|
+
s.authors = [ "Henrik Nyh" ]
|
9
|
+
s.email = [ "henrik@barsoom.se" ]
|
10
10
|
s.homepage = ""
|
11
11
|
s.summary = %q{Validate and normalize Swedish bank account numbers, plusgiro and bankgiro.}
|
12
12
|
|
13
13
|
s.files = `git ls-files`.split("\n")
|
14
14
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
15
|
-
s.require_paths = ["lib"]
|
15
|
+
s.require_paths = [ "lib" ]
|
16
|
+
s.metadata = { "rubygems_mfa_required" => "true" }
|
16
17
|
|
17
18
|
s.add_development_dependency "rake"
|
18
19
|
s.add_development_dependency "rspec"
|
data/lib/banktools-se/account.rb
CHANGED
@@ -50,8 +50,8 @@ module BankTools
|
|
50
50
|
|
51
51
|
def clearing_number
|
52
52
|
[
|
53
|
-
digits[0,4],
|
54
|
-
checksum_for_clearing? ? digits[4,1] : nil
|
53
|
+
digits[0, 4],
|
54
|
+
checksum_for_clearing? ? digits[4, 1] : nil,
|
55
55
|
].compact.join("-")
|
56
56
|
end
|
57
57
|
|
@@ -72,7 +72,7 @@ module BankTools
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def bank_data
|
75
|
-
number = digits[0,4].to_i
|
75
|
+
number = digits[0, 4].to_i
|
76
76
|
_, found_data = CLEARING_NUMBER_MAP.find { |interval, data| interval.include?(number) }
|
77
77
|
found_data || {}
|
78
78
|
end
|
@@ -90,7 +90,7 @@ module BankTools
|
|
90
90
|
Array(serial_number_length).last +
|
91
91
|
(checksum_for_clearing? ? 1 : 0)
|
92
92
|
else
|
93
|
-
1/0.0 # Infinity.
|
93
|
+
1 / 0.0 # Infinity.
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
@@ -107,7 +107,7 @@ module BankTools
|
|
107
107
|
end
|
108
108
|
|
109
109
|
def digits
|
110
|
-
number.to_s.gsub(/\D/,
|
110
|
+
number.to_s.gsub(/\D/, "")
|
111
111
|
end
|
112
112
|
|
113
113
|
def zerofill?
|
data/lib/banktools-se/ocr.rb
CHANGED
data/lib/banktools-se/version.rb
CHANGED
data/spec/account_spec.rb
CHANGED
@@ -17,7 +17,7 @@ describe BankTools::SE::Account do
|
|
17
17
|
|
18
18
|
it "should be false with errors" do
|
19
19
|
account = BankTools::SE::Account.new("foo")
|
20
|
-
allow(account).to receive(:errors).and_return([:error])
|
20
|
+
allow(account).to receive(:errors).and_return([ :error ])
|
21
21
|
expect(account).not_to be_valid
|
22
22
|
end
|
23
23
|
end
|
data/spec/bankgiro_spec.rb
CHANGED
@@ -15,7 +15,7 @@ describe BankTools::SE::Bankgiro do
|
|
15
15
|
|
16
16
|
it "should be false with errors" do
|
17
17
|
account = BankTools::SE::Bankgiro.new("foo")
|
18
|
-
allow(account).to receive(:errors).and_return([:error])
|
18
|
+
allow(account).to receive(:errors).and_return([ :error ])
|
19
19
|
expect(account).not_to be_valid
|
20
20
|
end
|
21
21
|
end
|
data/spec/plusgiro_spec.rb
CHANGED
@@ -17,7 +17,7 @@ describe BankTools::SE::Plusgiro do
|
|
17
17
|
|
18
18
|
it "should be false with errors" do
|
19
19
|
account = BankTools::SE::Plusgiro.new("foo")
|
20
|
-
allow(account).to receive(:errors).and_return([:error])
|
20
|
+
allow(account).to receive(:errors).and_return([ :error ])
|
21
21
|
expect(account).not_to be_valid
|
22
22
|
end
|
23
23
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: banktools-se
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henrik Nyh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -75,6 +75,7 @@ extra_rdoc_files: []
|
|
75
75
|
files:
|
76
76
|
- ".github/workflows/ci.yml"
|
77
77
|
- ".gitignore"
|
78
|
+
- ".rubocop.yml"
|
78
79
|
- CHANGELOG.md
|
79
80
|
- Gemfile
|
80
81
|
- README.markdown
|
@@ -97,7 +98,8 @@ files:
|
|
97
98
|
- spec/utils_spec.rb
|
98
99
|
homepage: ''
|
99
100
|
licenses: []
|
100
|
-
metadata:
|
101
|
+
metadata:
|
102
|
+
rubygems_mfa_required: 'true'
|
101
103
|
post_install_message:
|
102
104
|
rdoc_options: []
|
103
105
|
require_paths:
|
@@ -113,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
115
|
- !ruby/object:Gem::Version
|
114
116
|
version: '0'
|
115
117
|
requirements: []
|
116
|
-
rubygems_version: 3.2.
|
118
|
+
rubygems_version: 3.2.28
|
117
119
|
signing_key:
|
118
120
|
specification_version: 4
|
119
121
|
summary: Validate and normalize Swedish bank account numbers, plusgiro and bankgiro.
|