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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f07fdb509f30138a506f6f6417ff304ed85500d08898e96c16d431b4f8c3ec3
4
- data.tar.gz: 4582e2ed894b372b164d0634663a454aa36a7fc12fddaa65c3a322658daeca40
3
+ metadata.gz: ae26d83c75f488a904bc1dcaffada866c129f7f923a4083ef4c2886c58c4d605
4
+ data.tar.gz: 1a52ea7948ea5d90c0df16501455015ff8c870f22f00b64ca7ccf64f050aba83
5
5
  SHA512:
6
- metadata.gz: 85df98a4cf73147671d52a66af1eb8af728e9610857b9a58a1f078642d33fe0386c973e375d964b47022aae44683f4e62b0313d4352a77434c827007bd83ff23
7
- data.tar.gz: 46620b5b9b5f9f4af077bb93862669acbb4ae026ebccfd9cc462caf0711f4b67e14f01ce8ef4a36587c6964c3935530af637a851c7011f20c166300451861d2a
6
+ metadata.gz: 4ea749b95887d14fce1fa99b3f34537f497706ea1670050014cf94064830b6e23a1db8c3a71caeaab0282a559879562ea4305d9507608f1ad01f04c0ffa859fc
7
+ data.tar.gz: 3aef88169d2c7be49fcfa7d88148db48db4a2ff2d9f8822cc9898ee03f9fad0cc0b4e7f9197ce0410f1021c3459172b8159d99d49269f20a0f06c98b882f8eb7
@@ -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@477b21f02be01bcb8030d50f37cfec92bfa615b6
21
+ uses: ruby/setup-ruby@ae9cb3b565e36682a2c6045e4f664388da4c73aa
22
22
  with:
23
23
  ruby-version: ${{ matrix.ruby-version }}
24
- - name: Install dependencies
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
@@ -2,3 +2,4 @@
2
2
  .bundle
3
3
  Gemfile.lock
4
4
  pkg/*
5
+ tmp/*
data/.rubocop.yml ADDED
@@ -0,0 +1,5 @@
1
+ AllCops:
2
+ Exclude:
3
+ - "tmp/**/*"
4
+ inherit_gem:
5
+ barsoom_utils: shared_rubocop.yml
data/Gemfile CHANGED
@@ -2,3 +2,8 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in bank-tools-se.gemspec
4
4
  gemspec
5
+
6
+ group :development do
7
+ gem "barsoom_utils", github: "barsoom/barsoom_utils"
8
+ gem "rubocop"
9
+ end
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
- require 'rspec/core/rake_task'
2
+ require "rspec/core/rake_task"
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ task default: :spec
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"
@@ -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?
@@ -38,7 +38,7 @@ module BankTools
38
38
  private
39
39
 
40
40
  def digits
41
- number.to_s.gsub(/\D/, '')
41
+ number.to_s.gsub(/\D/, "")
42
42
  end
43
43
 
44
44
  end
@@ -20,6 +20,7 @@ module BankTools
20
20
  pad = pad.to_s
21
21
 
22
22
  raise MustBeNumeric unless number.match(/\A\d+\z/)
23
+
23
24
  # Padding isn't something BGC specifies, but we needed it to support a legacy scheme.
24
25
  number += pad
25
26
  # Adding 2: 1 length digit, 1 check digit.
@@ -45,7 +45,7 @@ module BankTools
45
45
  private
46
46
 
47
47
  def digits
48
- number.to_s.gsub(/\D/, '')
48
+ number.to_s.gsub(/\D/, "")
49
49
  end
50
50
 
51
51
  end
@@ -1,5 +1,5 @@
1
1
  module BankTools
2
2
  module SE
3
- VERSION = "3.1.0"
3
+ VERSION = "3.1.1"
4
4
  end
5
5
  end
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
@@ -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
@@ -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
@@ -1,4 +1,4 @@
1
1
  RSpec.configure do |config|
2
- config.filter_run :focus => true
2
+ config.filter_run focus: true
3
3
  config.run_all_when_everything_filtered = true
4
4
  end
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.0
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-08-02 00:00:00.000000000 Z
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.25
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.