banktools-se 3.3.0 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +2 -2
- data/CHANGELOG.md +8 -0
- data/banktools-se.gemspec +5 -1
- data/lib/banktools-se/plusgiro.rb +5 -2
- data/lib/banktools-se/version.rb +1 -1
- data/spec/plusgiro_spec.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ccccc22d21f8267923982fc38deeb6a399e005f7447ce10c7cad333786cae07d
|
|
4
|
+
data.tar.gz: 9fb1a7b6cd47306bc55b206d73bd9e64a95f299d5123f957eff1894411820a58
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b33615c06ae45f94fc8a73cf1f0b5dffcf2558bb33aaeacf9537c33f52b9f13d6d86a538e77437d866aab720040df8bf5253080915eeabb54ee56b49fe05c2f0
|
|
7
|
+
data.tar.gz: ac5d291cc1008477b7580f372015e7a9bd1c9613f8887a21fced5ba2ac2a419396f698421f9c659f7aaf181013deb2c39cb670daa8fb3a832d32a2f455597cb5
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -10,7 +10,7 @@ jobs:
|
|
|
10
10
|
ruby-versions:
|
|
11
11
|
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
|
|
12
12
|
with:
|
|
13
|
-
min_version: 3.
|
|
13
|
+
min_version: 3.2
|
|
14
14
|
engine: cruby
|
|
15
15
|
|
|
16
16
|
test:
|
|
@@ -22,7 +22,7 @@ jobs:
|
|
|
22
22
|
ruby-version: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
|
|
23
23
|
|
|
24
24
|
steps:
|
|
25
|
-
- uses: actions/checkout@
|
|
25
|
+
- uses: actions/checkout@v6
|
|
26
26
|
- name: Set up Ruby ${{ matrix.ruby-version }}
|
|
27
27
|
uses: ruby/setup-ruby@v1
|
|
28
28
|
with:
|
data/CHANGELOG.md
CHANGED
data/banktools-se.gemspec
CHANGED
|
@@ -13,5 +13,9 @@ Gem::Specification.new do |s|
|
|
|
13
13
|
s.files = `git ls-files`.split("\n")
|
|
14
14
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
15
15
|
s.require_paths = [ "lib" ]
|
|
16
|
-
s.metadata = {
|
|
16
|
+
s.metadata = {
|
|
17
|
+
"rubygems_mfa_required" => "true",
|
|
18
|
+
"source_code_uri" => "https://github.com/barsoom/banktools-se",
|
|
19
|
+
"changelog_uri" => "https://github.com/barsoom/banktools-se/blob/v#{BankTools::SE::VERSION}/CHANGELOG.md",
|
|
20
|
+
}
|
|
17
21
|
end
|
|
@@ -4,6 +4,9 @@ module BankTools
|
|
|
4
4
|
|
|
5
5
|
# Could sadly not find anything more authoritative than
|
|
6
6
|
# http://pellesoft.se/communicate/forum/view.aspx?msgid=267449&forumid=63&sum=0
|
|
7
|
+
# https://www.nordea.se/foretag/kundservice/fragor-och-svar-konton.html#faq=Kontouppgifter+432454
|
|
8
|
+
MAX_LENGTH = 8
|
|
9
|
+
MIN_LENGTH = 2
|
|
7
10
|
|
|
8
11
|
attr_reader :number
|
|
9
12
|
|
|
@@ -18,8 +21,8 @@ module BankTools
|
|
|
18
21
|
def errors
|
|
19
22
|
errors = []
|
|
20
23
|
|
|
21
|
-
errors << Errors::TOO_SHORT if digits.length <
|
|
22
|
-
errors << Errors::TOO_LONG if digits.length >
|
|
24
|
+
errors << Errors::TOO_SHORT if digits.length < MIN_LENGTH
|
|
25
|
+
errors << Errors::TOO_LONG if digits.length > MAX_LENGTH
|
|
23
26
|
errors << Errors::INVALID_CHARACTERS if number.to_s.match(/[^0-9 -]/)
|
|
24
27
|
errors << Errors::BAD_CHECKSUM unless Utils.valid_luhn?(number)
|
|
25
28
|
|
data/lib/banktools-se/version.rb
CHANGED
data/spec/plusgiro_spec.rb
CHANGED
|
@@ -41,7 +41,7 @@ RSpec.describe BankTools::SE::Plusgiro do
|
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
it "should include :too_long for numbers longer than 8 digits" do
|
|
44
|
-
expect(BankTools::SE::Plusgiro.new("410 54
|
|
44
|
+
expect(BankTools::SE::Plusgiro.new("410 54-51 21").errors).to include(BankTools::SE::Errors::TOO_LONG)
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
it "should include :invalid_characters for numbers with other character than digits, spaces and dashes" do
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: banktools-se
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.3.
|
|
4
|
+
version: 3.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Henrik Nyh
|
|
@@ -44,6 +44,8 @@ homepage: ''
|
|
|
44
44
|
licenses: []
|
|
45
45
|
metadata:
|
|
46
46
|
rubygems_mfa_required: 'true'
|
|
47
|
+
source_code_uri: https://github.com/barsoom/banktools-se
|
|
48
|
+
changelog_uri: https://github.com/barsoom/banktools-se/blob/v3.3.2/CHANGELOG.md
|
|
47
49
|
rdoc_options: []
|
|
48
50
|
require_paths:
|
|
49
51
|
- lib
|
|
@@ -58,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
58
60
|
- !ruby/object:Gem::Version
|
|
59
61
|
version: '0'
|
|
60
62
|
requirements: []
|
|
61
|
-
rubygems_version:
|
|
63
|
+
rubygems_version: 4.0.8
|
|
62
64
|
specification_version: 4
|
|
63
65
|
summary: Validate and normalize Swedish bank account numbers, plusgiro and bankgiro.
|
|
64
66
|
test_files: []
|