banktools-se 3.3.0 → 3.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5d38b29a0e8e17173e684e2aa57595210cd8239a3faad83881e09a2155b47ec
4
- data.tar.gz: 536681543fe7547f8c5589a09929c3c4273f3de5126f8b56ff88edebea2c02d5
3
+ metadata.gz: 600245bcaff1e259996286998821855e9e4193222d8d335b10adc46a26b16648
4
+ data.tar.gz: 8daa94ebc4db1d562b0b7b8546732ca4cd987a583245ad56dd0af738beb5349a
5
5
  SHA512:
6
- metadata.gz: 24b822afa750fd939f09245cecdc18eaf04dbedf9a7a04e8f246c0d5c4d264906817b63f89a7f93b1a73b1dc4d867791c09bb27277546a8536ae055744cd1aed
7
- data.tar.gz: 2c3c2217e150f37beb61215d64407af6b592bddca513204d520c06c07e5a6da8ae3ee40147d5d2ffeb6b34cea9a553f9239f4e5e51d2d8c05f3d337e9b4adc19
6
+ metadata.gz: 4794736dd16c9390a3f2536e59cdb3a988a0039dbcc4b641361db9955f0c787647f2a178e3e0e3289962ab0be42fcbcb0509dd284a6c2bd58cf357075c61dbaf
7
+ data.tar.gz: 6d5cb0c57e1fdce708b5b77761be6db8a1e6390baf730a347c8241dbf5d22378d282b8de8baf66c07463462dc8a7fc531e8c632858f3fe2f34715895c6c5f5c1
@@ -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.1
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@v4
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/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 = { "rubygems_mfa_required" => "true" }
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 = 10
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 < 2
22
- errors << Errors::TOO_LONG if digits.length > 8
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
 
@@ -1,5 +1,5 @@
1
1
  module BankTools
2
2
  module SE
3
- VERSION = "3.3.0"
3
+ VERSION = "3.3.1"
4
4
  end
5
5
  end
@@ -26,6 +26,7 @@ RSpec.describe BankTools::SE::Plusgiro do
26
26
  [
27
27
  "28 65 43-4", # IKEA
28
28
  "410 54 68-5", # IKEA
29
+ "421 880 87-25", # Göteborg Dödsbotjänster AB
29
30
  "4-2", # Sveriges riksbank
30
31
  ].each do |number|
31
32
  it "should be empty for a valid number like #{number}" do
@@ -40,8 +41,8 @@ RSpec.describe BankTools::SE::Plusgiro do
40
41
  expect(BankTools::SE::Plusgiro.new("1---------").errors).to include(BankTools::SE::Errors::TOO_SHORT)
41
42
  end
42
43
 
43
- it "should include :too_long for numbers longer than 8 digits" do
44
- expect(BankTools::SE::Plusgiro.new("410 54 68-51").errors).to include(BankTools::SE::Errors::TOO_LONG)
44
+ it "should include :too_long for numbers longer than 10 digits" do
45
+ expect(BankTools::SE::Plusgiro.new("410 54 68-51 21").errors).to include(BankTools::SE::Errors::TOO_LONG)
45
46
  end
46
47
 
47
48
  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.0
4
+ version: 3.3.1
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.1/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: 3.6.8
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: []