bankline_csv_import_file 0.3.0 → 0.3.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
- SHA1:
3
- metadata.gz: 5873525845d592185e8e2588efb4ae4780f891e5
4
- data.tar.gz: 23c0e7b3fde8695b4e1bdcf31258ff37b4f64b68
2
+ SHA256:
3
+ metadata.gz: a291c34665a288d576f2b5aa20c621ad58dec49b2b4c61e240f33c33e21e15fd
4
+ data.tar.gz: 0abd8a2e5d0b851954b641faa7cfb3d044cc0f56f8f4d18edb62cc61dbea5c6b
5
5
  SHA512:
6
- metadata.gz: c114810c6d7a56388a2e8c9f6bec660719bb1344c8e5c40711892bd316c0095f2f21f43f93ec02fe41e9f08e6be3286d5b27f365ddc0c6e327584285e7be71e1
7
- data.tar.gz: 85cb877a0b3506166048addfaeb236605c6c18e2452a760ddbf73829248f6da365f42894844bb43f349c68a685f284a82c3ef7b2be5e35cac347cdee4023060e
6
+ metadata.gz: 6de7bfb93252c6a1a99bfdcdf7467a0886f4ce8b1ced41f03562b3b782c1ad643317ebbb02e187c91a9ecfd3bf24c6c9405aa42c109dc98f6308341d9cbb1e8c
7
+ data.tar.gz: 1353404252535a7def4ddaf8e4d67e2837ff849bf2f876ad6acbbfe54a7504abdebd3a596f928800d14282c31f31ddeb6212d955a49e78bdf339bffe1d82fa57
@@ -0,0 +1,26 @@
1
+ name: Ruby CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+
12
+ runs-on: ubuntu-latest
13
+
14
+ strategy:
15
+ matrix:
16
+ ruby-version: ["3.0", "2.7", "2.6", "2.5"]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v2
20
+ - name: Set up Ruby ${{ matrix.ruby-version }}
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ${{ matrix.ruby-version }}
24
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
25
+ - name: Run tests
26
+ run: bundle exec rake
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
@@ -1,6 +1,11 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
3
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify your gem's dependencies in bankline_csv_import_file.gemspec
6
6
  gemspec
7
+
8
+ group :development do
9
+ gem "barsoom_utils", github: "barsoom/barsoom_utils"
10
+ gem "rubocop"
11
+ end
data/Gemfile.lock CHANGED
@@ -1,3 +1,9 @@
1
+ GIT
2
+ remote: https://github.com/barsoom/barsoom_utils
3
+ revision: d59121c10b4ba0e996d213ad23dc1545dcd27de0
4
+ specs:
5
+ barsoom_utils (0.1.0)
6
+
1
7
  PATH
2
8
  remote: .
3
9
  specs:
@@ -6,30 +12,52 @@ PATH
6
12
  GEM
7
13
  remote: https://rubygems.org/
8
14
  specs:
9
- diff-lcs (1.3)
10
- rake (10.5.0)
11
- rspec (3.7.0)
12
- rspec-core (~> 3.7.0)
13
- rspec-expectations (~> 3.7.0)
14
- rspec-mocks (~> 3.7.0)
15
- rspec-core (3.7.1)
16
- rspec-support (~> 3.7.0)
17
- rspec-expectations (3.7.0)
15
+ ast (2.4.2)
16
+ diff-lcs (1.4.4)
17
+ parallel (1.20.1)
18
+ parser (3.0.2.0)
19
+ ast (~> 2.4.1)
20
+ rainbow (3.0.0)
21
+ rake (13.0.1)
22
+ regexp_parser (2.1.1)
23
+ rexml (3.2.5)
24
+ rspec (3.9.0)
25
+ rspec-core (~> 3.9.0)
26
+ rspec-expectations (~> 3.9.0)
27
+ rspec-mocks (~> 3.9.0)
28
+ rspec-core (3.9.2)
29
+ rspec-support (~> 3.9.3)
30
+ rspec-expectations (3.9.2)
18
31
  diff-lcs (>= 1.2.0, < 2.0)
19
- rspec-support (~> 3.7.0)
20
- rspec-mocks (3.7.0)
32
+ rspec-support (~> 3.9.0)
33
+ rspec-mocks (3.9.1)
21
34
  diff-lcs (>= 1.2.0, < 2.0)
22
- rspec-support (~> 3.7.0)
23
- rspec-support (3.7.1)
35
+ rspec-support (~> 3.9.0)
36
+ rspec-support (3.9.3)
37
+ rubocop (1.18.4)
38
+ parallel (~> 1.10)
39
+ parser (>= 3.0.0.0)
40
+ rainbow (>= 2.2.2, < 4.0)
41
+ regexp_parser (>= 1.8, < 3.0)
42
+ rexml
43
+ rubocop-ast (>= 1.8.0, < 2.0)
44
+ ruby-progressbar (~> 1.7)
45
+ unicode-display_width (>= 1.4.0, < 3.0)
46
+ rubocop-ast (1.8.0)
47
+ parser (>= 3.0.1.1)
48
+ ruby-progressbar (1.11.0)
49
+ unicode-display_width (2.0.0)
24
50
 
25
51
  PLATFORMS
26
52
  ruby
27
53
 
28
54
  DEPENDENCIES
29
55
  bankline_csv_import_file!
56
+ barsoom_utils!
30
57
  bundler
31
58
  rake
32
59
  rspec
60
+ rubocop
33
61
 
34
62
  BUNDLED WITH
35
- 1.16.0
63
+ 2.2.25
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # Bankline CSV import file
2
2
 
3
+ [![Ruby CI](https://github.com/barsoom/bankline_csv_import_file/actions/workflows/ci.yml/badge.svg)](https://github.com/barsoom/bankline_csv_import_file/actions/workflows/ci.yml)
4
+
3
5
  Generate Bankline CSV import files per <https://www.business.rbs.co.uk/content/dam/rbs_co_uk/Business_and_Content/PDFs/Bankline/Bankline-import-file-guide-CSV-RBS.pdf>, used e.g. by NatWest.
4
6
 
5
7
  Not intended to be a complete implementation. We have implemented what we need; feel free to make PRs for further behaviour.
6
8
 
7
- USER BEWARE: At the time of writing, we have not yet verified that the produced file works.
8
-
9
9
 
10
10
  ## Usage
11
11
 
@@ -21,6 +21,8 @@ file.add_international_payment(…)
21
21
  file.generate # => "foo,bar,…"
22
22
  ```
23
23
 
24
+ At least with NatWest, it seems that the uploaded file must have a `.txt` extension, despite containing CSV.
25
+
24
26
  ### Domestic payment
25
27
 
26
28
  All these arguments are required unless stated otherwise.
@@ -32,11 +34,11 @@ file.add_domestic_payment(
32
34
  payer_sort_code: "151000",
33
35
  payer_account_number: "31806542",
34
36
  amount: "123.45", # Strings and BigDecimal are allowed. (Floats are not advisable for money.) Rounded to 2 decimals.
37
+ payment_date: Date.new(2018, 1, 1), # See note below.
35
38
  beneficiary_sort_code: "151000",
36
39
  beneficiary_account_number: "44298801",
37
40
  beneficiary_name: "John Doe", # Truncated to a max length of 35.
38
41
  beneficiary_reference: "Invoice 123", # Truncated to a max length of 18.
39
- payment_date: Date.new(2018, 1, 1), # See note below.
40
42
  )
41
43
 
42
44
  file.generate # => "foo,bar,…"
@@ -63,18 +65,17 @@ All these arguments are required unless stated otherwise.
63
65
  file = BanklineCsvImportFile.new
64
66
 
65
67
  file.add_international_payment(
66
- payer_sort_code: "151000", # Any non-digits will be stripped automatically.
67
- payer_account_number: "31806542", # Any non-digits will be stripped automatically.
68
+ payer_sort_code: "151000",
69
+ payer_account_number: "31806542",
68
70
  amount: "123.45", # Strings and BigDecimal are allowed. (Floats are not advisable for money.)
69
71
  payment_date: Date.new(2018, 1, 1), # See note below.
70
72
  beneficiary_bic: "SPKHDE2H",
71
73
  beneficiary_iban: "DE53250501800039370089",
72
74
  beneficiary_name: "John Doe",
75
+ beneficiary_reference: "Invoice 123", # Optional. Truncated to 35 chars per line and max 4 lines.
73
76
 
74
77
  # Optional but recommended, see below. Truncated to 35 chars per line and max 3 lines.
75
78
  beneficiary_address: "10 Foo Street\nBartown, Baz County\nABC 123"
76
-
77
- beneficiary_reference: "Invoice 123", # Optional. Truncated to 35 chars per line and max 4 lines.
78
79
  )
79
80
 
80
81
  file.generate # => "foo,bar,…"
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ begin
5
5
 
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
8
- task :default => :spec
8
+ task default: :spec
9
9
  rescue LoadError
10
10
  # no RSpec available
11
11
  end
@@ -7,19 +7,18 @@ require "bankline_csv_import_file/version"
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = "bankline_csv_import_file"
9
9
  spec.version = BanklineCsvImportFile::VERSION
10
- spec.authors = ["Henrik Nyh"]
11
- spec.email = ["henrik@nyh.se"]
10
+ spec.authors = [ "Henrik Nyh" ]
11
+ spec.email = [ "henrik@nyh.se" ]
12
12
 
13
13
  spec.summary = %q{Generate Bankline CSV import files.}
14
14
  spec.homepage = "https://github.com/barsoom/bankline_csv_import_file"
15
15
  spec.license = "MIT"
16
+ spec.metadata = { "rubygems_mfa_required" => "true" }
16
17
 
17
18
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
19
  f.match(%r{^(test|spec|features)/})
19
20
  end
20
- spec.bindir = "exe"
21
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
- spec.require_paths = ["lib"]
21
+ spec.require_paths = [ "lib" ]
23
22
 
24
23
  spec.add_development_dependency "bundler"
25
24
  spec.add_development_dependency "rake"
@@ -1,7 +1,7 @@
1
1
  class BanklineCsvImportFile
2
2
  class Record
3
3
  def initialize
4
- # H001..H003, T001..T082.
4
+ # 85 columns, namely H001..H003 and T001..T082 per https://www.business.rbs.co.uk/content/dam/rbs_co_uk/Business_and_Content/PDFs/Bankline/Bankline-import-file-guide-CSV-RBS.pdf (section 3).
5
5
  @array = Array.new(85)
6
6
  end
7
7
 
@@ -13,6 +13,7 @@ class BanklineCsvImportFile
13
13
  when /\AT(\d\d\d)\z/
14
14
  i = $1.to_i
15
15
  raise "Out of range!" unless (1..82).cover?(i)
16
+
16
17
  @array[i + 2] = value
17
18
  else
18
19
  raise "Unknown field: #{key.inspect}"
@@ -1,3 +1,3 @@
1
1
  class BanklineCsvImportFile
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bankline_csv_import_file
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrik Nyh
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-06 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: bundler
@@ -59,9 +59,10 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - ".github/workflows/ci.yml"
62
63
  - ".gitignore"
63
64
  - ".rspec"
64
- - ".travis.yml"
65
+ - ".rubocop.yml"
65
66
  - Gemfile
66
67
  - Gemfile.lock
67
68
  - LICENSE.txt
@@ -76,7 +77,8 @@ files:
76
77
  homepage: https://github.com/barsoom/bankline_csv_import_file
77
78
  licenses:
78
79
  - MIT
79
- metadata: {}
80
+ metadata:
81
+ rubygems_mfa_required: 'true'
80
82
  post_install_message:
81
83
  rdoc_options: []
82
84
  require_paths:
@@ -92,8 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
94
  - !ruby/object:Gem::Version
93
95
  version: '0'
94
96
  requirements: []
95
- rubyforge_project:
96
- rubygems_version: 2.6.11
97
+ rubygems_version: 3.2.28
97
98
  signing_key:
98
99
  specification_version: 4
99
100
  summary: Generate Bankline CSV import files.
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 1.9.3
5
- before_install: gem install bundler -v 1.16.0