mt940_parser 1.5.1 → 1.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.document +1 -1
- data/.github/workflows/lint.yml +29 -0
- data/.github/workflows/tests.yml +22 -0
- data/.rubocop.yml +61 -0
- data/.specification +25 -26
- data/.tool-versions +1 -0
- data/Gemfile +0 -4
- data/{README.rdoc → README.md} +8 -5
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/lib/mt940/version.rb +1 -1
- data/lib/mt940.rb +17 -9
- data/lib/mt940_parser.rb +3 -0
- data/mt940_parser.gemspec +25 -29
- data/test/fixtures/colon_in_descriptor.txt +3 -0
- data/test/fixtures/colon_in_descriptor.yml +13 -0
- data/test/test_helper.rb +0 -10
- data/test/test_mt940.rb +4 -1
- metadata +20 -15
- data/.travis.yml +0 -14
- data/VERSION.yml +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c10c25af0fbeca4a9f993982b9d6836c93f97a7689aad0437f6d7c296db76627
|
4
|
+
data.tar.gz: e374fb82f872046d4928c56356e80d26f2aaf2d3ee987ce73ca97b3b8a97f7b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f2e1879aa0385913ae9d5d1144e55104c94d0eb7195ce5a8cb63a61b5c7121f97371f365fe473c6d30b825d8756102fd4f1f79b5708189d4de4256d993a4fe1
|
7
|
+
data.tar.gz: e41928d11934d6d2419850bc8792b26f96eda4de933bba63e8caa67034751f211965ff1ca588a8a6d5ded3e8b0acd7937f4ee779bcf337911bd6ea9f02413cb1
|
data/.document
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
# based on https://github.com/rails/rails/blob/4a78dcb/.github/workflows/rubocop.yml
|
2
|
+
|
3
|
+
name: rubocop linting
|
4
|
+
|
5
|
+
on: [push, pull_request]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
build:
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v2
|
13
|
+
- name: Set up Ruby
|
14
|
+
uses: ruby/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: 2.7
|
17
|
+
- name: Cache gems
|
18
|
+
uses: actions/cache@v1
|
19
|
+
with:
|
20
|
+
path: vendor/bundle
|
21
|
+
key: ${{ runner.os }}-rubocop-${{ hashFiles('**/Gemfile.lock') }}
|
22
|
+
restore-keys: |
|
23
|
+
${{ runner.os }}-rubocop-
|
24
|
+
- name: Install gems
|
25
|
+
run: |
|
26
|
+
bundle config path vendor/bundle
|
27
|
+
bundle install --jobs 4 --retry 3
|
28
|
+
- name: Run rubocop
|
29
|
+
run: bundle exec rubocop --lint
|
@@ -0,0 +1,22 @@
|
|
1
|
+
name: tests
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
|
9
|
+
strategy:
|
10
|
+
matrix:
|
11
|
+
ruby: [ '2.7', 'ruby-head', 'jruby-head' ]
|
12
|
+
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v2
|
15
|
+
- name: Set up Ruby ${{ matrix.ruby }}
|
16
|
+
uses: ruby/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: ${{ matrix.ruby }}
|
19
|
+
- name: Install dependencies
|
20
|
+
run: bundle install --jobs 4
|
21
|
+
- name: Test with Rake
|
22
|
+
run: bundle exec rake
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
# usage: `rubocop --lint`
|
2
|
+
|
3
|
+
AllCops:
|
4
|
+
NewCops: enable
|
5
|
+
|
6
|
+
# disable some linters that are not so likely to indicate bugs
|
7
|
+
|
8
|
+
Lint/AmbiguousAssignment:
|
9
|
+
Enabled: false
|
10
|
+
Lint/AmbiguousBlockAssociation:
|
11
|
+
Enabled: false
|
12
|
+
Lint/AmbiguousOperator:
|
13
|
+
Enabled: false
|
14
|
+
Lint/AmbiguousRegexpLiteral:
|
15
|
+
Enabled: false
|
16
|
+
Lint/AssignmentInCondition:
|
17
|
+
Enabled: false
|
18
|
+
Lint/ConstantDefinitionInBlock:
|
19
|
+
Enabled: false
|
20
|
+
Lint/ConstantResolution:
|
21
|
+
Enabled: false
|
22
|
+
Lint/DuplicateBranch:
|
23
|
+
Enabled: false
|
24
|
+
Lint/EmptyBlock:
|
25
|
+
Enabled: false
|
26
|
+
Lint/EmptyClass:
|
27
|
+
Enabled: false
|
28
|
+
Lint/EmptyConditionalBody:
|
29
|
+
Enabled: false
|
30
|
+
Lint/EmptyExpression:
|
31
|
+
Enabled: false
|
32
|
+
Lint/EmptyFile:
|
33
|
+
Enabled: false
|
34
|
+
Lint/EmptyWhen:
|
35
|
+
Enabled: false
|
36
|
+
Lint/EnsureReturn:
|
37
|
+
Enabled: false
|
38
|
+
Lint/Loop:
|
39
|
+
Enabled: false
|
40
|
+
Lint/MissingSuper:
|
41
|
+
Enabled: false
|
42
|
+
Lint/MixedRegexpCaptureTypes:
|
43
|
+
Enabled: false
|
44
|
+
Lint/NumberConversion:
|
45
|
+
Enabled: false
|
46
|
+
Lint/ParenthesesAsGroupedExpression:
|
47
|
+
Enabled: false
|
48
|
+
Lint/RedundantStringCoercion:
|
49
|
+
Enabled: false
|
50
|
+
Lint/ShadowedArgument:
|
51
|
+
Enabled: false
|
52
|
+
Lint/ShadowedException:
|
53
|
+
Enabled: false
|
54
|
+
Lint/ShadowingOuterLocalVariable:
|
55
|
+
Enabled: false
|
56
|
+
Lint/SuppressedException:
|
57
|
+
Enabled: false
|
58
|
+
Lint/UnusedBlockArgument:
|
59
|
+
Enabled: false
|
60
|
+
Lint/UnusedMethodArgument:
|
61
|
+
Enabled: false
|
data/.specification
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: mt940
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
4
|
hash: 23
|
5
|
-
segments:
|
5
|
+
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
8
|
- 0
|
@@ -10,58 +10,57 @@ version: !ruby/object:Gem::Version
|
|
10
10
|
platform: ruby
|
11
11
|
authors: []
|
12
12
|
|
13
|
-
autorequire:
|
13
|
+
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
17
|
date: 2010-03-24 00:00:00 +01:00
|
18
|
-
default_executable:
|
18
|
+
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
21
|
-
description:
|
22
|
-
email:
|
21
|
+
description:
|
22
|
+
email:
|
23
23
|
executables: []
|
24
24
|
|
25
25
|
extensions: []
|
26
26
|
|
27
27
|
extra_rdoc_files: []
|
28
28
|
|
29
|
-
files:
|
29
|
+
files:
|
30
30
|
- lib
|
31
31
|
- lib/mt940.rb
|
32
|
-
has_rdoc:
|
33
|
-
homepage:
|
32
|
+
has_rdoc: false
|
33
|
+
homepage:
|
34
34
|
licenses: []
|
35
35
|
|
36
|
-
post_install_message:
|
36
|
+
post_install_message:
|
37
37
|
rdoc_options: []
|
38
38
|
|
39
|
-
require_paths:
|
39
|
+
require_paths:
|
40
40
|
- lib
|
41
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
42
|
-
requirements:
|
41
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
43
|
- - ">="
|
44
|
-
- !ruby/object:Gem::Version
|
44
|
+
- !ruby/object:Gem::Version
|
45
45
|
hash: 3
|
46
|
-
segments:
|
46
|
+
segments:
|
47
47
|
- 0
|
48
48
|
version: "0"
|
49
|
-
version:
|
50
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
49
|
+
version:
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
52
|
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
53
|
+
- !ruby/object:Gem::Version
|
54
54
|
hash: 3
|
55
|
-
segments:
|
55
|
+
segments:
|
56
56
|
- 0
|
57
57
|
version: "0"
|
58
|
-
version:
|
58
|
+
version:
|
59
59
|
requirements: []
|
60
60
|
|
61
|
-
rubyforge_project:
|
61
|
+
rubyforge_project:
|
62
62
|
rubygems_version: 1.3.7
|
63
|
-
signing_key:
|
63
|
+
signing_key:
|
64
64
|
specification_version: 3
|
65
|
-
summary:
|
65
|
+
summary:
|
66
66
|
test_files: []
|
67
|
-
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.1.0
|
data/Gemfile
CHANGED
data/{README.rdoc → README.md}
RENAMED
@@ -1,12 +1,15 @@
|
|
1
|
-
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/mt940_parser.svg)](http://badge.fury.io/rb/mt940_parser)
|
2
|
+
[![Build Status](https://github.com/betterplace/mt940_parser/workflows/tests/badge.svg)](https://github.com/betterplace/mt940_parser/actions)
|
2
3
|
|
3
|
-
|
4
|
+
# mt940_parser
|
5
|
+
|
6
|
+
This is a library to parse account statements which are formatted as SWIFT mt940.
|
4
7
|
|
5
8
|
See the following link for documentation of the format.
|
6
9
|
http://www.google.de/url?sa=t&source=web&cd=1&ved=0CBwQFjAA&url=http%3A%2F%2Fmartin.hinner.info%2Fbankconvert%2Fswift_mt940_942.pdf&ei=alO_TObpPNGRswbD15WqDQ&usg=AFQjCNHkVGOfzofgKkk6dEkynAho02S2cg
|
7
10
|
|
8
|
-
|
9
|
-
|
11
|
+
## Note on Patches/Pull Requests
|
12
|
+
|
10
13
|
* Fork the project.
|
11
14
|
* Make your feature addition or bug fix.
|
12
15
|
* Add tests for it. This is important so I don't break it in a
|
@@ -15,6 +18,6 @@ http://www.google.de/url?sa=t&source=web&cd=1&ved=0CBwQFjAA&url=http%3A%2F%2Fmar
|
|
15
18
|
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
16
19
|
* Send me a pull request. Bonus points for topic branches.
|
17
20
|
|
18
|
-
|
21
|
+
## Copyright
|
19
22
|
|
20
23
|
Copyright (c) 2010 Thies C. Arntzen. See LICENSE for details.
|
data/Rakefile
CHANGED
@@ -18,11 +18,11 @@ GemHadar do
|
|
18
18
|
ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock', '.rvmrc', 'coverage',
|
19
19
|
'.DS_Store', '.ruby-gemset', '.ruby-version', '.bundle', '.AppleDouble'
|
20
20
|
|
21
|
-
readme 'README.
|
21
|
+
readme 'README.md'
|
22
22
|
licenses 'MIT'
|
23
23
|
|
24
24
|
development_dependency 'test-unit'
|
25
|
-
development_dependency '
|
25
|
+
development_dependency 'rubocop'
|
26
26
|
end
|
27
27
|
|
28
28
|
task :default => :test
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.5.
|
1
|
+
1.5.4
|
data/lib/mt940/version.rb
CHANGED
data/lib/mt940.rb
CHANGED
@@ -2,6 +2,8 @@ require 'mt940/version'
|
|
2
2
|
require 'mt940/errors'
|
3
3
|
require 'mt940/customer_statement_message'
|
4
4
|
require 'bigdecimal'
|
5
|
+
require 'bigdecimal/util'
|
6
|
+
require 'date'
|
5
7
|
|
6
8
|
class MT940
|
7
9
|
class Field
|
@@ -12,8 +14,10 @@ class MT940
|
|
12
14
|
|
13
15
|
class << self
|
14
16
|
|
17
|
+
LINE = /^:(\d{2})(\w)?:(.*)$/
|
18
|
+
|
15
19
|
def for(line)
|
16
|
-
if line.match(
|
20
|
+
if line.match(LINE)
|
17
21
|
number, modifier, content = $1, $2, $3
|
18
22
|
klass = {
|
19
23
|
'20' => Job,
|
@@ -32,7 +36,9 @@ class MT940
|
|
32
36
|
|
33
37
|
klass.new(modifier, content)
|
34
38
|
else
|
35
|
-
raise Errors::WrongLineFormatError,
|
39
|
+
raise Errors::WrongLineFormatError,
|
40
|
+
"Wrong line format does not match #{LINE.inspect}. Got: "\
|
41
|
+
"#{line.dump[0...80]}#{'[...]' if line.dump.size > 80}"
|
36
42
|
end
|
37
43
|
end
|
38
44
|
end
|
@@ -48,17 +54,17 @@ class MT940
|
|
48
54
|
def parse_amount_in_cents(amount)
|
49
55
|
amount =~ /\A(\d+)(,\d*)?\z/ or
|
50
56
|
raise Errors::InvalidAmountFormatError, "invalid amount #{amount.inspect}"
|
51
|
-
(100 *
|
57
|
+
(100 * amount.sub(',', '.').sub(/\.\z/, '').to_d).floor
|
52
58
|
end
|
53
59
|
|
54
60
|
def parse_date(date)
|
55
61
|
date.match(DATE)
|
56
|
-
Date.new("20#{$1}".to_i, $2.to_i, $3.to_i)
|
62
|
+
::Date.new("20#{$1}".to_i, $2.to_i, $3.to_i)
|
57
63
|
end
|
58
64
|
|
59
65
|
def parse_entry_date(raw_entry_date, value_date)
|
60
66
|
raw_entry_date.match(SHORT_DATE)
|
61
|
-
entry_date = Date.new(value_date.year, $1.to_i, $2.to_i)
|
67
|
+
entry_date = ::Date.new(value_date.year, $1.to_i, $2.to_i)
|
62
68
|
unless entry_date.year == value_date.year
|
63
69
|
raise "Unhandled case: value date and entry date are in different years"
|
64
70
|
end
|
@@ -165,7 +171,7 @@ class MT940
|
|
165
171
|
when 'ALT', '0'
|
166
172
|
nil
|
167
173
|
when DATE
|
168
|
-
Date.new("20#{$1}".to_i, $2.to_i, $3.to_i)
|
174
|
+
::Date.new("20#{$1}".to_i, $2.to_i, $3.to_i)
|
169
175
|
end
|
170
176
|
end
|
171
177
|
end
|
@@ -270,9 +276,11 @@ class MT940
|
|
270
276
|
class << self
|
271
277
|
def parse(text)
|
272
278
|
new_text = text.encode('UTF-8').strip
|
273
|
-
new_text << "\r\n" if new_text
|
274
|
-
raw_sheets = new_text.split(/^-\s*\r\n/).map
|
275
|
-
|
279
|
+
new_text << "\r\n" if new_text.end_with?('-')
|
280
|
+
raw_sheets = new_text.split(/^-\s*\r\n/).map do |sheet|
|
281
|
+
sheet.gsub(/\r\n(?!:\d{2}\w?:)/, '')
|
282
|
+
end
|
283
|
+
raw_sheets.map { |raw_sheet| parse_sheet(raw_sheet) }
|
276
284
|
end
|
277
285
|
|
278
286
|
private
|
data/lib/mt940_parser.rb
ADDED
data/mt940_parser.gemspec
CHANGED
@@ -1,40 +1,36 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: mt940_parser 1.5.
|
2
|
+
# stub: mt940_parser 1.5.4 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
|
-
s.name = "mt940_parser"
|
6
|
-
s.version = "1.5.
|
5
|
+
s.name = "mt940_parser".freeze
|
6
|
+
s.version = "1.5.4"
|
7
7
|
|
8
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
9
|
-
s.require_paths = ["lib"]
|
10
|
-
s.authors = ["Thies C. Arntzen", "Phillip Oertel"]
|
11
|
-
s.date = "
|
12
|
-
s.description = "Ruby library that parses account statements in the SWIFT MT940 format."
|
13
|
-
s.email = "developers@betterplace.org"
|
14
|
-
s.extra_rdoc_files = ["README.
|
15
|
-
s.files = [".document", ".
|
16
|
-
s.homepage = "http://github.com/betterplace/mt940_parser"
|
17
|
-
s.licenses = ["MIT"]
|
18
|
-
s.rdoc_options = ["--title", "Mt940Parser - MT940 parses account statements in the SWIFT MT940 format.", "--main", "README.
|
19
|
-
s.rubygems_version = "
|
20
|
-
s.summary = "MT940 parses account statements in the SWIFT MT940 format."
|
21
|
-
s.test_files = ["test/test_account_identifier.rb", "test/test_customer_statement_message.rb", "test/test_helper.rb", "test/test_mt940.rb"]
|
8
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
|
+
s.require_paths = ["lib".freeze]
|
10
|
+
s.authors = ["Thies C. Arntzen".freeze, "Phillip Oertel".freeze]
|
11
|
+
s.date = "2022-05-27"
|
12
|
+
s.description = "Ruby library that parses account statements in the SWIFT MT940 format.".freeze
|
13
|
+
s.email = "developers@betterplace.org".freeze
|
14
|
+
s.extra_rdoc_files = ["README.md".freeze, "lib/mt940.rb".freeze, "lib/mt940/customer_statement_message.rb".freeze, "lib/mt940/errors.rb".freeze, "lib/mt940/version.rb".freeze, "lib/mt940_parser.rb".freeze]
|
15
|
+
s.files = [".document".freeze, ".github/workflows/lint.yml".freeze, ".github/workflows/tests.yml".freeze, ".gitignore".freeze, ".rubocop.yml".freeze, ".specification".freeze, ".tool-versions".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "VERSION".freeze, "docs/0E0Y00DNY.pdf".freeze, "docs/FinTS_4.0_Formals.pdf".freeze, "docs/FinTS_4.0_Messages_Finanzdatenformate.pdf".freeze, "docs/MT940_Deutschland_Structure2002.pdf".freeze, "docs/SEPA_20MT940__Schnittstellenbeschreibung.pdf".freeze, "docs/mt940.pdf".freeze, "docs/swift_mt940_942.pdf".freeze, "docs/uebersicht_der_geschaeftsvorfallcodes_und_buchungs_textschluessel.pdf".freeze, "lib/mt940.rb".freeze, "lib/mt940/customer_statement_message.rb".freeze, "lib/mt940/errors.rb".freeze, "lib/mt940/version.rb".freeze, "lib/mt940_parser.rb".freeze, "mt940_parser.gemspec".freeze, "test/fixtures/amount_formats.txt".freeze, "test/fixtures/amount_formats.yml".freeze, "test/fixtures/colon_in_descriptor.txt".freeze, "test/fixtures/colon_in_descriptor.yml".freeze, "test/fixtures/currency_in_25.txt".freeze, "test/fixtures/currency_in_25.yml".freeze, "test/fixtures/empty_86.txt".freeze, "test/fixtures/empty_86.yml".freeze, "test/fixtures/empty_entry_date.txt".freeze, "test/fixtures/empty_entry_date.yml".freeze, "test/fixtures/empty_line.txt".freeze, "test/fixtures/empty_line.yml".freeze, "test/fixtures/missing_crlf_at_end.txt".freeze, "test/fixtures/missing_crlf_at_end.yml".freeze, "test/fixtures/sepa_mt9401.txt".freeze, "test/fixtures/sepa_mt9401.yml".freeze, "test/fixtures/sepa_snippet.txt".freeze, "test/fixtures/sepa_snippet_broken.txt".freeze, "test/fixtures/with_binary_character.txt".freeze, "test/fixtures/with_binary_character.yml".freeze, "test/test_account_identifier.rb".freeze, "test/test_customer_statement_message.rb".freeze, "test/test_helper.rb".freeze, "test/test_mt940.rb".freeze]
|
16
|
+
s.homepage = "http://github.com/betterplace/mt940_parser".freeze
|
17
|
+
s.licenses = ["MIT".freeze]
|
18
|
+
s.rdoc_options = ["--title".freeze, "Mt940Parser - MT940 parses account statements in the SWIFT MT940 format.".freeze, "--main".freeze, "README.md".freeze]
|
19
|
+
s.rubygems_version = "3.3.3".freeze
|
20
|
+
s.summary = "MT940 parses account statements in the SWIFT MT940 format.".freeze
|
21
|
+
s.test_files = ["test/test_account_identifier.rb".freeze, "test/test_customer_statement_message.rb".freeze, "test/test_helper.rb".freeze, "test/test_mt940.rb".freeze]
|
22
22
|
|
23
23
|
if s.respond_to? :specification_version then
|
24
24
|
s.specification_version = 4
|
25
|
+
end
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
else
|
31
|
-
s.add_dependency(%q<gem_hadar>, ["~> 1.3.1"])
|
32
|
-
s.add_dependency(%q<test-unit>, [">= 0"])
|
33
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
34
|
-
end
|
27
|
+
if s.respond_to? :add_runtime_dependency then
|
28
|
+
s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 1.11.0"])
|
29
|
+
s.add_development_dependency(%q<test-unit>.freeze, [">= 0"])
|
30
|
+
s.add_development_dependency(%q<rubocop>.freeze, [">= 0"])
|
35
31
|
else
|
36
|
-
s.add_dependency(%q<gem_hadar
|
37
|
-
s.add_dependency(%q<test-unit
|
38
|
-
s.add_dependency(%q<
|
32
|
+
s.add_dependency(%q<gem_hadar>.freeze, ["~> 1.11.0"])
|
33
|
+
s.add_dependency(%q<test-unit>.freeze, [">= 0"])
|
34
|
+
s.add_dependency(%q<rubocop>.freeze, [">= 0"])
|
39
35
|
end
|
40
36
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
---
|
2
|
+
- - !ruby/object:MT940::StatementLineInformation
|
3
|
+
modifier:
|
4
|
+
content: '166?20Spende abcdefghijklmnopqrstuvwxyzabcde Verwendungszweck: ?701234567
|
5
|
+
Betterplace?30ABCDEFGH?31DE12345678912345789012?32Abcdefg Hijklmnop'
|
6
|
+
code: 166
|
7
|
+
bank_code: ABCDEFGH
|
8
|
+
account_number: DE12345678912345789012
|
9
|
+
not_implemented_fields:
|
10
|
+
- - '70'
|
11
|
+
- 1234567 Betterplace
|
12
|
+
details: 'Spende abcdefghijklmnopqrstuvwxyzabcde Verwendungszweck: '
|
13
|
+
account_holder: Abcdefg Hijklmnop
|
data/test/test_helper.rb
CHANGED
@@ -1,13 +1,3 @@
|
|
1
|
-
if ENV['START_SIMPLECOV'].to_i == 1
|
2
|
-
require 'simplecov'
|
3
|
-
SimpleCov.start do
|
4
|
-
add_filter "#{File.basename(File.dirname(__FILE__))}/"
|
5
|
-
end
|
6
|
-
end
|
7
|
-
if ENV['CODECLIMATE_REPO_TOKEN']
|
8
|
-
require "codeclimate-test-reporter"
|
9
|
-
CodeClimate::TestReporter.start
|
10
|
-
end
|
11
1
|
require 'test/unit'
|
12
2
|
begin
|
13
3
|
require 'byebug'
|
data/test/test_mt940.rb
CHANGED
@@ -9,8 +9,11 @@ class TestMt940 < Test::Unit::TestCase
|
|
9
9
|
data = MT940.parse(IO.read(file))
|
10
10
|
|
11
11
|
generated_structure_file = file.gsub(/.txt$/, ".yml")
|
12
|
+
# ruby 3.1 / psych 4 disallows loading classes from YAML by default
|
13
|
+
load_method = YAML.respond_to?(:unsafe_load_file) ? :unsafe_load_file : :load_file
|
12
14
|
|
13
|
-
assert_equal YAML
|
15
|
+
assert_equal YAML.send(load_method, generated_structure_file).to_yaml,
|
16
|
+
data.to_yaml
|
14
17
|
end
|
15
18
|
end
|
16
19
|
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mt940_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thies C. Arntzen
|
8
8
|
- Phillip Oertel
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-05-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gem_hadar
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 1.
|
20
|
+
version: 1.11.0
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 1.
|
27
|
+
version: 1.11.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: test-unit
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
|
-
name:
|
43
|
+
name: rubocop
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - ">="
|
@@ -58,22 +58,25 @@ email: developers@betterplace.org
|
|
58
58
|
executables: []
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files:
|
61
|
-
- README.
|
61
|
+
- README.md
|
62
62
|
- lib/mt940.rb
|
63
63
|
- lib/mt940/customer_statement_message.rb
|
64
64
|
- lib/mt940/errors.rb
|
65
65
|
- lib/mt940/version.rb
|
66
|
+
- lib/mt940_parser.rb
|
66
67
|
files:
|
67
68
|
- ".document"
|
69
|
+
- ".github/workflows/lint.yml"
|
70
|
+
- ".github/workflows/tests.yml"
|
68
71
|
- ".gitignore"
|
72
|
+
- ".rubocop.yml"
|
69
73
|
- ".specification"
|
70
|
-
- ".
|
74
|
+
- ".tool-versions"
|
71
75
|
- Gemfile
|
72
76
|
- LICENSE
|
73
|
-
- README.
|
77
|
+
- README.md
|
74
78
|
- Rakefile
|
75
79
|
- VERSION
|
76
|
-
- VERSION.yml
|
77
80
|
- docs/0E0Y00DNY.pdf
|
78
81
|
- docs/FinTS_4.0_Formals.pdf
|
79
82
|
- docs/FinTS_4.0_Messages_Finanzdatenformate.pdf
|
@@ -86,9 +89,12 @@ files:
|
|
86
89
|
- lib/mt940/customer_statement_message.rb
|
87
90
|
- lib/mt940/errors.rb
|
88
91
|
- lib/mt940/version.rb
|
92
|
+
- lib/mt940_parser.rb
|
89
93
|
- mt940_parser.gemspec
|
90
94
|
- test/fixtures/amount_formats.txt
|
91
95
|
- test/fixtures/amount_formats.yml
|
96
|
+
- test/fixtures/colon_in_descriptor.txt
|
97
|
+
- test/fixtures/colon_in_descriptor.yml
|
92
98
|
- test/fixtures/currency_in_25.txt
|
93
99
|
- test/fixtures/currency_in_25.yml
|
94
100
|
- test/fixtures/empty_86.txt
|
@@ -113,12 +119,12 @@ homepage: http://github.com/betterplace/mt940_parser
|
|
113
119
|
licenses:
|
114
120
|
- MIT
|
115
121
|
metadata: {}
|
116
|
-
post_install_message:
|
122
|
+
post_install_message:
|
117
123
|
rdoc_options:
|
118
124
|
- "--title"
|
119
125
|
- Mt940Parser - MT940 parses account statements in the SWIFT MT940 format.
|
120
126
|
- "--main"
|
121
|
-
- README.
|
127
|
+
- README.md
|
122
128
|
require_paths:
|
123
129
|
- lib
|
124
130
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -132,9 +138,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
138
|
- !ruby/object:Gem::Version
|
133
139
|
version: '0'
|
134
140
|
requirements: []
|
135
|
-
|
136
|
-
|
137
|
-
signing_key:
|
141
|
+
rubygems_version: 3.3.3
|
142
|
+
signing_key:
|
138
143
|
specification_version: 4
|
139
144
|
summary: MT940 parses account statements in the SWIFT MT940 format.
|
140
145
|
test_files:
|
data/.travis.yml
DELETED