mt940 0.7.0 → 0.7.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
  SHA1:
3
- metadata.gz: 9687025fcee76507ec72ba177dbacfeedd3b755e
4
- data.tar.gz: 2be9f9cf8bd116eabd1e5e28c1470809fe8f51ca
3
+ metadata.gz: a4974b89c12da285719a0002bc6e59fe132940b3
4
+ data.tar.gz: f35f1ab7264f07e3a55196bb9adadebc083779fa
5
5
  SHA512:
6
- metadata.gz: eb88e8a1b47dee2efa2ea6cf008e92d3bf40a578eb834ddf469a00464b2b868a37f95b0ecfefad789bbae745196b53bf1cd3417621e277e2785477e263c4e0af
7
- data.tar.gz: 65323779df20a4a8d4ce4f24994406026b70152b72ad5a31b3de95e3e778761bf6637245cd9aaf4ad67e0447ca70354845623a33b84fffc00ba788f97b0de606
6
+ metadata.gz: eb4dc9a5a936a255a97dcc605de144481cf72a49956f8d9f85ee583e3192ad72b5751adeb8549db4f8d443512f95e0dfc407566cf83700de83a98a03767253e7
7
+ data.tar.gz: 84ea5616194fd6b27c65d296dc9178a155431b7a1b0552bd3ee51a9885f0c8f7499365f245efd16d742534114fb562454469dafddffdcf9f92fff8bb8103fd86
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mt940 (0.7.0)
4
+ mt940 (0.7.1)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
- MT940
2
- ======
1
+ MT940 (Dutch banks only)
2
+ ========================
3
3
 
4
4
  <a href='http://travis-ci.org/dovadi/mt940'>
5
5
  ![http://travis-ci.org/dovadi/mt940](https://secure.travis-ci.org/dovadi/mt940.png)
data/lib/mt940/base.rb CHANGED
@@ -13,13 +13,14 @@ module MT940
13
13
  @transactions, @lines = [], []
14
14
  @bank = self.class.to_s.split('::').last
15
15
  file.readlines.each do |line|
16
+ line.encode!('UTF-8', 'UTF-8', :invalid => :replace)
16
17
  begin_of_line?(line) ? @lines << line : @lines[-1] += line
17
18
  end
18
19
  end
19
20
 
20
21
  def parse
21
22
  @lines.each do |line|
22
- @line = line.strip.gsub(/\n/,'')
23
+ @line = line.strip.gsub(/\n|\r/,'').gsub(/\s{2,}/,' ')
23
24
  if @line.match(/^:(\d{2}F?):/)
24
25
  case $1
25
26
  when '25'
data/lib/mt940/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module MT940
2
- VERSION = '0.7.0'
2
+ VERSION = '0.7.1'
3
3
  end
@@ -29,11 +29,11 @@ class TestMt940Abnamro < Test::Unit::TestCase
29
29
 
30
30
  context 'Description' do
31
31
  should 'have the correct description in case of a GIRO account' do
32
- assert_equal ' KPN - DIGITENNE BETALINGSKENM. 0000000421886595314606715 BETREFT FACTUUR D.D. 20-05-2011INCL. 1,44 BTW', @transaction.description
32
+ assert_equal ' KPN - DIGITENNE BETALINGSKENM. 0000000421886595314606715 BETREFT FACTUUR D.D. 20-05-2011INCL. 1,44 BTW', @transaction.description
33
33
  end
34
34
 
35
35
  should 'have the correct description in case of a regular bank' do
36
- assert_equal ' MYCOM DEN HAAG S-GRAVEN,PAS999', @transactions.last.description
36
+ assert_equal ' MYCOM DEN HAAG S-GRAVEN,PAS999', @transactions.last.description
37
37
  end
38
38
  end
39
39
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mt940
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Oxener
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-09 00:00:00.000000000 Z
11
+ date: 2014-03-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A basic MT940 parser with implementations for Dutch banks.
14
14
  email: frank.oxener@gmail.com
@@ -102,4 +102,3 @@ test_files:
102
102
  - test/mt940_ing_test.rb
103
103
  - test/mt940_rabobank_test.rb
104
104
  - test/mt940_triodos_test.rb
105
- has_rdoc: