cmxl 0.2.0 → 0.2.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 +4 -4
- data/.travis.yml +7 -9
- data/CHANGELOG.mdown +6 -0
- data/lib/cmxl/fields/entry_date.rb +12 -0
- data/lib/cmxl/fields/statement_details.rb +3 -1
- data/lib/cmxl/fields/transaction.rb +8 -1
- data/lib/cmxl/statement.rb +1 -1
- data/lib/cmxl/version.rb +1 -1
- data/spec/fields/entry_date_spec.rb +9 -0
- data/spec/fields/statement_details_spec.rb +8 -0
- data/spec/fixtures/lines/entry_date.txt +1 -0
- data/spec/fixtures/lines/statement_details_empty_fields.txt +1 -0
- data/spec/fixtures/statement-mt940.txt +1 -0
- data/spec/statement_spec.rb +12 -0
- metadata +10 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd3e4666e761be27044a4b4e97aabb85ad3d714d
|
4
|
+
data.tar.gz: 2333bb6d9680fbf7ffafd4488f53760cbce29960
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bbb768c8b133798c7208f38d62def5b8282661c8eca73a0178eea1826170e1d69bdc200b23ae42b30af38e738368d7641f2babe3c178fc8b5752ff58e0348b7
|
7
|
+
data.tar.gz: 5fcd0c23e6bdbdb8b1c3465089c76025dc19bce761eb7f7b848287ae82a5138d669857c1719fbc345f0df5377ab69889c7387b4c5a03ab56c9a4c331cbfb5c23
|
data/.travis.yml
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
sudo: false
|
2
2
|
language: ruby
|
3
3
|
rvm:
|
4
|
-
-
|
5
|
-
- 2.
|
6
|
-
- 2.
|
7
|
-
- 2.
|
8
|
-
-
|
9
|
-
|
10
|
-
|
11
|
-
allow_failures:
|
12
|
-
- rvm: 1.9.3
|
4
|
+
- 2.2.8
|
5
|
+
- 2.3.4
|
6
|
+
- 2.4.3
|
7
|
+
- 2.5.0
|
8
|
+
- jruby-9.1.10.0
|
9
|
+
before_install:
|
10
|
+
gem update --system
|
13
11
|
after_success:
|
14
12
|
- bundle exec codeclimate-test-reporter
|
15
13
|
addons:
|
data/CHANGELOG.mdown
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# 0.2.1
|
2
|
+
* addressing an bug that occoured for transactions submitted end of
|
3
|
+
but were fetched in the new year -> those ended up with the wrong year
|
4
|
+
on the entry date
|
5
|
+
* MT942 support for field 13
|
6
|
+
|
1
7
|
# 0.2.0
|
2
8
|
* added several balance related accessors (#7)
|
3
9
|
* configuration option for `statement separator` (#5)
|
@@ -37,8 +37,15 @@ module Cmxl
|
|
37
37
|
def date
|
38
38
|
to_date(self.data['date'])
|
39
39
|
end
|
40
|
+
|
40
41
|
def entry_date
|
41
|
-
|
42
|
+
if self.data['entry_date'] && self.date
|
43
|
+
if date.month == 1 && date.month < to_date(self.data['entry_date'], self.date.year).month
|
44
|
+
to_date(self.data['entry_date'], self.date.year - 1)
|
45
|
+
else
|
46
|
+
to_date(self.data['entry_date'], self.date.year)
|
47
|
+
end
|
48
|
+
end
|
42
49
|
end
|
43
50
|
|
44
51
|
# Fields from details
|
data/lib/cmxl/statement.rb
CHANGED
data/lib/cmxl/version.rb
CHANGED
@@ -73,4 +73,12 @@ describe Cmxl::Fields::StatementDetails do
|
|
73
73
|
it { expect(subject.to_hash).to eql(subject.to_h) }
|
74
74
|
end
|
75
75
|
|
76
|
+
describe 'information parsing with empty fields on the end' do
|
77
|
+
subject { Cmxl::Fields::StatementDetails.parse(fixture_line(:statement_details_empty_fields)) }
|
78
|
+
|
79
|
+
it { expect(subject.sepa).to eql({
|
80
|
+
"EREF" => "S1001675",
|
81
|
+
"SVWZ" => ""
|
82
|
+
}) }
|
83
|
+
end
|
76
84
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
:13D:1712290540+0100
|
@@ -0,0 +1 @@
|
|
1
|
+
:86:166?00SEPA-CT HABEN EINZELBUCHUNG?1097261?20EREF+S1001675?21SVWZ+?30DEUTDEDB510?31DE23510700240352432900?32John Doe
|
data/spec/statement_spec.rb
CHANGED
@@ -90,6 +90,18 @@ describe Cmxl do
|
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
|
+
describe 'statement issued over a years boudary' do
|
94
|
+
subject { Cmxl.parse( mt940_file('statement-mt940') ).first.transactions.last }
|
95
|
+
|
96
|
+
it 'includes correct entry date' do
|
97
|
+
expect(subject.entry_date).to eq(Date.new(2013,12,29))
|
98
|
+
end
|
99
|
+
|
100
|
+
it 'includes correct date' do
|
101
|
+
expect(subject.date).to eq(Date.new(2014,01,04))
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
93
105
|
describe 'statement with detailed end balance' do
|
94
106
|
subject { Cmxl.parse( mt940_file('mt940-with-detailed-end-balance') ).first.transactions.first }
|
95
107
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cmxl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bumann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -103,6 +103,7 @@ files:
|
|
103
103
|
- lib/cmxl/fields/account_identification.rb
|
104
104
|
- lib/cmxl/fields/available_balance.rb
|
105
105
|
- lib/cmxl/fields/closing_balance.rb
|
106
|
+
- lib/cmxl/fields/entry_date.rb
|
106
107
|
- lib/cmxl/fields/reference.rb
|
107
108
|
- lib/cmxl/fields/statement_details.rb
|
108
109
|
- lib/cmxl/fields/statement_number.rb
|
@@ -114,6 +115,7 @@ files:
|
|
114
115
|
- spec/fields/account_identification_spec.rb
|
115
116
|
- spec/fields/available_balance_spec.rb
|
116
117
|
- spec/fields/closing_balance_spec.rb
|
118
|
+
- spec/fields/entry_date_spec.rb
|
117
119
|
- spec/fields/reference_spec.rb
|
118
120
|
- spec/fields/statement_details_spec.rb
|
119
121
|
- spec/fields/statement_number_spec.rb
|
@@ -125,8 +127,10 @@ files:
|
|
125
127
|
- spec/fixtures/lines/account_identification_legacy.txt
|
126
128
|
- spec/fixtures/lines/available_balance.txt
|
127
129
|
- spec/fixtures/lines/closing_balance.txt
|
130
|
+
- spec/fixtures/lines/entry_date.txt
|
128
131
|
- spec/fixtures/lines/reference.txt
|
129
132
|
- spec/fixtures/lines/statement_details.txt
|
133
|
+
- spec/fixtures/lines/statement_details_empty_fields.txt
|
130
134
|
- spec/fixtures/lines/statement_line.txt
|
131
135
|
- spec/fixtures/lines/statement_number.txt
|
132
136
|
- spec/fixtures/mt940-deutsche_bank.txt
|
@@ -161,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
165
|
version: '0'
|
162
166
|
requirements: []
|
163
167
|
rubyforge_project:
|
164
|
-
rubygems_version: 2.
|
168
|
+
rubygems_version: 2.6.14
|
165
169
|
signing_key:
|
166
170
|
specification_version: 4
|
167
171
|
summary: Cmxl is your friendly MT940 bank statement parser
|
@@ -171,6 +175,7 @@ test_files:
|
|
171
175
|
- spec/fields/account_identification_spec.rb
|
172
176
|
- spec/fields/available_balance_spec.rb
|
173
177
|
- spec/fields/closing_balance_spec.rb
|
178
|
+
- spec/fields/entry_date_spec.rb
|
174
179
|
- spec/fields/reference_spec.rb
|
175
180
|
- spec/fields/statement_details_spec.rb
|
176
181
|
- spec/fields/statement_number_spec.rb
|
@@ -182,8 +187,10 @@ test_files:
|
|
182
187
|
- spec/fixtures/lines/account_identification_legacy.txt
|
183
188
|
- spec/fixtures/lines/available_balance.txt
|
184
189
|
- spec/fixtures/lines/closing_balance.txt
|
190
|
+
- spec/fixtures/lines/entry_date.txt
|
185
191
|
- spec/fixtures/lines/reference.txt
|
186
192
|
- spec/fixtures/lines/statement_details.txt
|
193
|
+
- spec/fixtures/lines/statement_details_empty_fields.txt
|
187
194
|
- spec/fixtures/lines/statement_line.txt
|
188
195
|
- spec/fixtures/lines/statement_number.txt
|
189
196
|
- spec/fixtures/mt940-deutsche_bank.txt
|