rbankgiro 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.
- data/README.MD +37 -0
- data/lib/rbankgiro.rb +31 -30
- data/test/test_transaction.rb +3 -3
- data/test/test_transactions.rb +22 -22
- metadata +40 -49
- data/LICENSE +0 -24
- data/Rakefile +0 -26
- data/VERSION +0 -1
- data/rbankgiro.gemspec +0 -58
- data/test/fixtures/corrupt_header_09_02_27.txt +0 -7
- data/test/fixtures/file_format_error_09_02_27.txt +0 -7
- data/test/fixtures/invalid_bankgiro_number_09_02_27.txt +0 -7
- data/test/fixtures/missing_transaction_09_02_27.txt +0 -6
- data/test/fixtures/multiple_transactions_06_06_20.txt +0 -45
- data/test/fixtures/multiple_transactions_with_plusgiro_06_06_20.txt +0 -46
- data/test/fixtures/one_too_many_transactions_09_02_27.txt +0 -8
- data/test/fixtures/one_transaction_09_02_27.txt +0 -7
- data/test/fixtures/overpunch_transaction_with_missing_lb_flag_06_06_20.txt +0 -45
data/README.MD
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# rbankgiro - parse Bankgiro transaction files [](http://travis-ci.org/#!/jage/rbankgiro)
|
2
|
+
|
3
|
+
Read more about bankgiro at: http://www.bgc.se/
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
Bankgiro transactions are stored in plain text files, these are generated by [BGC][1]. Rbankgiro reads and parses these files.
|
8
|
+
|
9
|
+
`Rbankgiro::Transactions` is an extended `Array` which stores `Rbankgiro::Transaction` objects, each object being a Bankgiro transaction.
|
10
|
+
|
11
|
+
Read a transaction file:
|
12
|
+
|
13
|
+
require 'rbankgiro'
|
14
|
+
|
15
|
+
transactions = Rbankgiro::Transactions.new('transactions_06_06_20.txt')
|
16
|
+
# => #<Rbankgiro::Transactions:0x3fe8ac5e7110 @sum=47093, @length=38, @file_date=2006-06-20 00:00:00 +0200>
|
17
|
+
|
18
|
+
* `Rbankgiro::Transactions#sum` total sum of all transactions
|
19
|
+
|
20
|
+
`Rbankgiro::Transaction` reflects all information stored in a Bankgiro transaction file.
|
21
|
+
|
22
|
+
transaction = transactions.first
|
23
|
+
# => #<Rbankgiro::Transaction:0x007fd158bcbdb8 @raw_amount="0000000147700", @amount=1477, @ore=0, @reference_number="3940715", @file_date=2006-06-20 00:00:00 +0200, @bankgiro_number="9912346", @lb_flag=false, @service_number="">
|
24
|
+
|
25
|
+
* `Rbankgiro::Transaction#raw_amount` is a copy of BGCs amount string
|
26
|
+
* `Rbankgiro::Transaction#amount` is the transferred amount of whole SEK as an Integer
|
27
|
+
* `Rbankgiro::Transaction#ore` is the amount of öre which was transferred
|
28
|
+
* `Rbankgiro::Transaction#reference_number` payment reference number
|
29
|
+
* `Rbankgiro::Transaction#file_date` date of the generated bankgiro transaction file
|
30
|
+
* `Rbankgiro::Transaction#bankgiro_number` to which bankgiro number the payments are transferred
|
31
|
+
* `Rbankgiro::Transaction#lb_flag` indicates "Leverantörsbetalning"
|
32
|
+
* `Rbankgiro::Transaction#service_number` is the service number
|
33
|
+
* `Rbankgiro::Transaction#rounded?` is true if there was rounding in the transactions
|
34
|
+
|
35
|
+
For more specifics, read the Bankgiro manual at [BGC][1].
|
36
|
+
|
37
|
+
[1]: http://www.bgc.se/ "BGC"
|
data/lib/rbankgiro.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'date'
|
2
2
|
|
3
3
|
module Rbankgiro
|
4
4
|
class CorruptHeader < StandardError; end
|
@@ -6,14 +6,14 @@ module Rbankgiro
|
|
6
6
|
class FileFormatError < StandardError; end
|
7
7
|
class TransactionCountError < StandardError; end
|
8
8
|
class PartSumError < StandardError; end
|
9
|
-
|
9
|
+
|
10
10
|
# A Bankgiro transaction, contains reference_number-number for the transaction
|
11
11
|
# amount in SEK and the transaction date
|
12
12
|
class Transaction
|
13
|
-
attr_reader :amount, :ore, :reference_number, :file_date,
|
13
|
+
attr_reader :amount, :ore, :reference_number, :file_date,
|
14
14
|
:bankgiro_number, :lb_flag, :service_number
|
15
|
-
|
16
|
-
OVERPUNCH_TRANSLATION = {
|
15
|
+
|
16
|
+
OVERPUNCH_TRANSLATION = {
|
17
17
|
"-" => "0",
|
18
18
|
"J" => "1",
|
19
19
|
"K" => "2",
|
@@ -25,10 +25,10 @@ module Rbankgiro
|
|
25
25
|
"Q" => "8",
|
26
26
|
"R" => "9"
|
27
27
|
}
|
28
|
-
|
28
|
+
|
29
29
|
def initialize(reference_number, raw_amount, file_date, bankgiro_number, lb_flag = false, service_number = false)
|
30
30
|
@raw_amount = raw_amount
|
31
|
-
|
31
|
+
|
32
32
|
r = raw_amount.match(/^(\d{11})(.)(.)$/)
|
33
33
|
|
34
34
|
if OVERPUNCH_TRANSLATION.include?(r[3])
|
@@ -39,17 +39,17 @@ module Rbankgiro
|
|
39
39
|
amount = r[1]
|
40
40
|
ore = r[2] + r[3]
|
41
41
|
end
|
42
|
-
|
43
|
-
@amount
|
44
|
-
@ore
|
45
|
-
@reference_number
|
46
|
-
@file_date
|
47
|
-
@bankgiro_number
|
48
|
-
@lb_flag
|
49
|
-
@service_number
|
50
|
-
end
|
51
|
-
|
52
|
-
# If the amount last two characters aren't 00,
|
42
|
+
|
43
|
+
@amount = amount.to_i
|
44
|
+
@ore = ore.to_i
|
45
|
+
@reference_number = reference_number
|
46
|
+
@file_date = file_date
|
47
|
+
@bankgiro_number = bankgiro_number
|
48
|
+
@lb_flag = lb_flag
|
49
|
+
@service_number = service_number
|
50
|
+
end
|
51
|
+
|
52
|
+
# If the amount last two characters aren't 00,
|
53
53
|
# there has been some kind of rounding
|
54
54
|
def rounding?
|
55
55
|
@raw_amount.split('')[-2..-1].join != '00'
|
@@ -58,7 +58,7 @@ module Rbankgiro
|
|
58
58
|
|
59
59
|
class Transactions < Array
|
60
60
|
attr_reader :file_date
|
61
|
-
|
61
|
+
|
62
62
|
# Parses an reference_number transaction file from Rbankgirocentralen
|
63
63
|
# Creates Rbankgiro::Transaction objects for each transaction
|
64
64
|
def initialize(file)
|
@@ -67,22 +67,22 @@ module Rbankgiro
|
|
67
67
|
parse_row(row)
|
68
68
|
end
|
69
69
|
end
|
70
|
-
|
70
|
+
|
71
71
|
def sum
|
72
72
|
self.collect {|t| t.amount }.inject {|s,n| s + n }
|
73
73
|
end
|
74
|
-
|
74
|
+
|
75
75
|
def inspect
|
76
|
-
sprintf("#<%s:0x%x %s>", self.class.name, __id__,
|
76
|
+
sprintf("#<%s:0x%x %s>", self.class.name, __id__,
|
77
77
|
"@sum=#{self.sum}, @length=#{self.length}, @file_date=#{self.file_date}")
|
78
78
|
end
|
79
|
-
|
79
|
+
|
80
80
|
def select_with(bankgiro_number)
|
81
81
|
self.dup.replace(self.select {|t| t.bankgiro_number == bankgiro_number })
|
82
82
|
end
|
83
|
-
|
83
|
+
|
84
84
|
private
|
85
|
-
|
85
|
+
|
86
86
|
def parse_row(row)
|
87
87
|
columns = row.split(' ').collect {|c| c.strip }.compact
|
88
88
|
case columns[0]
|
@@ -92,18 +92,19 @@ module Rbankgiro
|
|
92
92
|
raise CorruptHeader unless columns[2] == 'BANKGIROT'
|
93
93
|
@service_number = $2
|
94
94
|
@raw_file_date = columns[1]
|
95
|
-
|
95
|
+
year, month, day = @raw_file_date.scan(/\d{2}/).map {|i| i.to_i }
|
96
|
+
@file_date = Date.new(2000 + year, month, day)
|
96
97
|
when '10'
|
97
98
|
when '20'
|
98
99
|
# Specifies the bankgiro number:
|
99
100
|
# <8:bankgiro number>
|
100
101
|
@bankgiro_number = columns[1]
|
101
102
|
raise InvalidBankgiroNumber unless @bankgiro_number
|
102
|
-
when '30'
|
103
|
+
when '30'
|
103
104
|
# Specifies the bankgiro number with the transaction date after:
|
104
105
|
# <8:bankgiro number><6:date>
|
105
106
|
raise FileFormatError unless columns[1] == @bankgiro_number + @raw_file_date
|
106
|
-
when '40'
|
107
|
+
when '40'
|
107
108
|
# Transaction row:
|
108
109
|
# <17:reference number><13:Amount with öre or overpunch> <2:LB flag if "Leverantörsbetalning">
|
109
110
|
if r = columns[1].match(/^(\d+)(.{13})$/)
|
@@ -125,7 +126,7 @@ module Rbankgiro
|
|
125
126
|
else
|
126
127
|
raise FileFormatError, "Part payment row"
|
127
128
|
end
|
128
|
-
|
129
|
+
|
129
130
|
transactions_sum = self.select_with(@bankgiro_number).sum
|
130
131
|
unless payments_sum == transactions_sum
|
131
132
|
raise PartSumError, "part payment row is #{payments_sum}, transaction sum is #{transactions_sum}"
|
@@ -141,7 +142,7 @@ module Rbankgiro
|
|
141
142
|
else
|
142
143
|
raise FileFormatError, "Total payment row, syntax error"
|
143
144
|
end
|
144
|
-
|
145
|
+
|
145
146
|
raise PartSumError, "Total payment row" unless payments_sum == self.sum
|
146
147
|
raise TransactionCountError unless number_of_transactions == self.length
|
147
148
|
else
|
data/test/test_transaction.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
require 'helper'
|
2
2
|
|
3
|
-
class TestTransaction < Test::Unit::TestCase
|
3
|
+
class TestTransaction < Test::Unit::TestCase
|
4
4
|
def test_transaction
|
5
5
|
transactions = Rbankgiro::Transactions.new(fixture_file_path('one_transaction_09_02_27.txt'))
|
6
6
|
transaction = transactions.first
|
7
|
-
|
7
|
+
|
8
8
|
assert_equal(false, transaction.rounding?)
|
9
9
|
assert_equal('86042103700000012', transaction.reference_number)
|
10
10
|
assert_equal(1, transaction.amount)
|
11
11
|
assert_equal('53090965', transaction.bankgiro_number)
|
12
12
|
assert_equal('909897', transaction.service_number)
|
13
|
-
assert_equal(
|
13
|
+
assert_equal(Date.parse('Fri Feb 27 00:00:00 2009'), transaction.file_date)
|
14
14
|
end
|
15
15
|
end
|
data/test/test_transactions.rb
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
require 'helper'
|
2
2
|
|
3
|
-
class TestTransactions < Test::Unit::TestCase
|
3
|
+
class TestTransactions < Test::Unit::TestCase
|
4
4
|
def test_one_transaction
|
5
5
|
transactions = Rbankgiro::Transactions.new(fixture_file_path('one_transaction_09_02_27.txt'))
|
6
|
-
|
6
|
+
|
7
7
|
assert_equal(1, transactions.sum)
|
8
8
|
assert_equal(1, transactions.length)
|
9
|
-
assert_equal(
|
9
|
+
assert_equal(Date.parse('Fri Feb 27 2009'), transactions.file_date)
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
def test_multiple_transactions
|
13
13
|
transactions = Rbankgiro::Transactions.new(fixture_file_path('multiple_transactions_06_06_20.txt'))
|
14
|
-
|
14
|
+
|
15
15
|
# Test SEK
|
16
16
|
assert_equal(47093, transactions.sum)
|
17
17
|
assert_equal(38, transactions.length)
|
18
|
-
assert_equal(
|
19
|
-
|
18
|
+
assert_equal(Date.parse('Tue Jun 20 2006'), transactions.file_date)
|
19
|
+
|
20
20
|
# Test LB flag
|
21
21
|
assert_equal(false, transactions[28].lb_flag)
|
22
22
|
assert transactions[27].lb_flag
|
@@ -24,61 +24,61 @@ class TestTransactions < Test::Unit::TestCase
|
|
24
24
|
assert transactions[31].lb_flag
|
25
25
|
assert transactions[36].lb_flag
|
26
26
|
assert transactions[37].lb_flag
|
27
|
-
|
27
|
+
|
28
28
|
# Test Öre
|
29
29
|
assert_equal(95, transactions[27].ore)
|
30
30
|
assert_equal(-95, transactions[36].ore)
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
def test_multiple_transaction_with_postgiro
|
34
34
|
transactions = Rbankgiro::Transactions.new(fixture_file_path('multiple_transactions_with_plusgiro_06_06_20.txt'))
|
35
|
-
|
35
|
+
|
36
36
|
assert_equal(55166, transactions.sum)
|
37
37
|
assert_equal(37, transactions.length)
|
38
|
-
assert_equal(
|
39
|
-
|
38
|
+
assert_equal(Date.parse('Tue Jun 20 00:00:00 2006'), transactions.file_date)
|
39
|
+
|
40
40
|
for i in 0..1
|
41
41
|
assert_equal('99123465', transactions[i].bankgiro_number)
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
for i in 2..36
|
45
45
|
assert_equal('9912346', transactions[i].bankgiro_number)
|
46
46
|
end
|
47
47
|
end
|
48
|
-
|
48
|
+
|
49
49
|
def test_overpunch_without_lb_flag
|
50
50
|
assert_raise(Rbankgiro::FileFormatError) do
|
51
51
|
Rbankgiro::Transactions.new(fixture_file_path('overpunch_transaction_with_missing_lb_flag_06_06_20.txt'))
|
52
52
|
end
|
53
53
|
end
|
54
|
-
|
54
|
+
|
55
55
|
def test_missing_transaction
|
56
56
|
assert_raise(Rbankgiro::PartSumError) do
|
57
57
|
Rbankgiro::Transactions.new(fixture_file_path('missing_transaction_09_02_27.txt'))
|
58
58
|
end
|
59
59
|
end
|
60
|
-
|
60
|
+
|
61
61
|
def test_corrupt_header
|
62
62
|
assert_raise(Rbankgiro::CorruptHeader) do
|
63
|
-
Rbankgiro::Transactions.new(fixture_file_path('corrupt_header_09_02_27.txt'))
|
63
|
+
Rbankgiro::Transactions.new(fixture_file_path('corrupt_header_09_02_27.txt'))
|
64
64
|
end
|
65
65
|
end
|
66
|
-
|
66
|
+
|
67
67
|
def test_invalid_bankgiro_number
|
68
68
|
assert_raise(Rbankgiro::InvalidBankgiroNumber) do
|
69
69
|
Rbankgiro::Transactions.new(fixture_file_path('invalid_bankgiro_number_09_02_27.txt'))
|
70
70
|
end
|
71
71
|
end
|
72
|
-
|
72
|
+
|
73
73
|
def test_file_format_error
|
74
74
|
assert_raise(Rbankgiro::FileFormatError) do
|
75
|
-
Rbankgiro::Transactions.new(fixture_file_path('file_format_error_09_02_27.txt'))
|
75
|
+
Rbankgiro::Transactions.new(fixture_file_path('file_format_error_09_02_27.txt'))
|
76
76
|
end
|
77
77
|
end
|
78
|
-
|
78
|
+
|
79
79
|
def test_transaction_count_error
|
80
80
|
assert_raise(Rbankgiro::TransactionCountError) do
|
81
|
-
Rbankgiro::Transactions.new(fixture_file_path('one_too_many_transactions_09_02_27.txt'))
|
81
|
+
Rbankgiro::Transactions.new(fixture_file_path('one_too_many_transactions_09_02_27.txt'))
|
82
82
|
end
|
83
83
|
end
|
84
84
|
end
|
metadata
CHANGED
@@ -1,73 +1,64 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbankgiro
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.1
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
|
-
authors:
|
7
|
-
-
|
7
|
+
authors:
|
8
|
+
- Johan Eckerström
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
date: 2012-04-02 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: &70241409545460 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.9.2
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70241409545460
|
16
25
|
description: Parsing transaction files from swedish Bankgiro central
|
17
26
|
email: johan@duh.se
|
18
27
|
executables: []
|
19
|
-
|
20
28
|
extensions: []
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
files:
|
25
|
-
- LICENSE
|
26
|
-
- Rakefile
|
27
|
-
- VERSION
|
29
|
+
extra_rdoc_files:
|
30
|
+
- README.MD
|
31
|
+
files:
|
28
32
|
- lib/rbankgiro.rb
|
29
|
-
-
|
30
|
-
- test/fixtures/corrupt_header_09_02_27.txt
|
31
|
-
- test/fixtures/file_format_error_09_02_27.txt
|
32
|
-
- test/fixtures/invalid_bankgiro_number_09_02_27.txt
|
33
|
-
- test/fixtures/missing_transaction_09_02_27.txt
|
34
|
-
- test/fixtures/multiple_transactions_06_06_20.txt
|
35
|
-
- test/fixtures/multiple_transactions_with_plusgiro_06_06_20.txt
|
36
|
-
- test/fixtures/one_too_many_transactions_09_02_27.txt
|
37
|
-
- test/fixtures/one_transaction_09_02_27.txt
|
38
|
-
- test/fixtures/overpunch_transaction_with_missing_lb_flag_06_06_20.txt
|
33
|
+
- README.MD
|
39
34
|
- test/helper.rb
|
40
35
|
- test/test_transaction.rb
|
41
36
|
- test/test_transactions.rb
|
42
|
-
|
43
|
-
homepage: http://github.com/jage/rbankgiro
|
37
|
+
homepage: https://github.com/jage/rbankgiro
|
44
38
|
licenses: []
|
45
|
-
|
46
39
|
post_install_message:
|
47
|
-
rdoc_options:
|
48
|
-
|
49
|
-
require_paths:
|
40
|
+
rdoc_options: []
|
41
|
+
require_paths:
|
50
42
|
- lib
|
51
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
63
55
|
requirements: []
|
64
|
-
|
65
56
|
rubyforge_project:
|
66
|
-
rubygems_version: 1.
|
57
|
+
rubygems_version: 1.8.11
|
67
58
|
signing_key:
|
68
59
|
specification_version: 3
|
69
60
|
summary: Parse Bankgiro transaction files
|
70
|
-
test_files:
|
61
|
+
test_files:
|
71
62
|
- test/helper.rb
|
72
63
|
- test/test_transaction.rb
|
73
64
|
- test/test_transactions.rb
|
data/LICENSE
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
Copyright (c) 2009, Johan Eckerström
|
2
|
-
All rights reserved.
|
3
|
-
|
4
|
-
Redistribution and use in source and binary forms, with or without
|
5
|
-
modification, are permitted provided that the following conditions are met:
|
6
|
-
* Redistributions of source code must retain the above copyright
|
7
|
-
notice, this list of conditions and the following disclaimer.
|
8
|
-
* Redistributions in binary form must reproduce the above copyright
|
9
|
-
notice, this list of conditions and the following disclaimer in the
|
10
|
-
documentation and/or other materials provided with the distribution.
|
11
|
-
* Neither the name of rbankgiro nor the
|
12
|
-
names of its contributors may be used to endorse or promote products
|
13
|
-
derived from this software without specific prior written permission.
|
14
|
-
|
15
|
-
THIS SOFTWARE IS PROVIDED BY Johan Eckerström ''AS IS'' AND ANY
|
16
|
-
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
17
|
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
18
|
-
DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
19
|
-
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
20
|
-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
21
|
-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
22
|
-
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
23
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
24
|
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/Rakefile
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rake'
|
3
|
-
require 'rake/testtask'
|
4
|
-
|
5
|
-
begin
|
6
|
-
require 'jeweler'
|
7
|
-
Jeweler::Tasks.new do |gemspec|
|
8
|
-
gemspec.name = "rbankgiro"
|
9
|
-
gemspec.summary = "Parse Bankgiro transaction files"
|
10
|
-
gemspec.description = "Parsing transaction files from swedish Bankgiro central"
|
11
|
-
gemspec.email = "johan@duh.se"
|
12
|
-
gemspec.homepage = "http://github.com/jage/rbankgiro"
|
13
|
-
gemspec.authors = ["Johan Eckerström"]
|
14
|
-
gemspec.has_rdoc = false
|
15
|
-
end
|
16
|
-
rescue LoadError
|
17
|
-
$stderr.puts "Jeweler not available. Install it with: sudo gem install jeweler"
|
18
|
-
end
|
19
|
-
|
20
|
-
Rake::TestTask.new(:test) do |test|
|
21
|
-
test.libs << 'lib' << 'test'
|
22
|
-
test.pattern = 'test/**/test_*.rb'
|
23
|
-
test.verbose = true
|
24
|
-
end
|
25
|
-
|
26
|
-
task :default => :test
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.2.0
|
data/rbankgiro.gemspec
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{rbankgiro}
|
8
|
-
s.version = "0.2.0"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Johan Eckerstr\303\266m"]
|
12
|
-
s.date = %q{2009-12-08}
|
13
|
-
s.description = %q{Parsing transaction files from swedish Bankgiro central}
|
14
|
-
s.email = %q{johan@duh.se}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE"
|
17
|
-
]
|
18
|
-
s.files = [
|
19
|
-
"LICENSE",
|
20
|
-
"Rakefile",
|
21
|
-
"VERSION",
|
22
|
-
"lib/rbankgiro.rb",
|
23
|
-
"rbankgiro.gemspec",
|
24
|
-
"test/fixtures/corrupt_header_09_02_27.txt",
|
25
|
-
"test/fixtures/file_format_error_09_02_27.txt",
|
26
|
-
"test/fixtures/invalid_bankgiro_number_09_02_27.txt",
|
27
|
-
"test/fixtures/missing_transaction_09_02_27.txt",
|
28
|
-
"test/fixtures/multiple_transactions_06_06_20.txt",
|
29
|
-
"test/fixtures/multiple_transactions_with_plusgiro_06_06_20.txt",
|
30
|
-
"test/fixtures/one_too_many_transactions_09_02_27.txt",
|
31
|
-
"test/fixtures/one_transaction_09_02_27.txt",
|
32
|
-
"test/fixtures/overpunch_transaction_with_missing_lb_flag_06_06_20.txt",
|
33
|
-
"test/helper.rb",
|
34
|
-
"test/test_transaction.rb",
|
35
|
-
"test/test_transactions.rb"
|
36
|
-
]
|
37
|
-
s.homepage = %q{http://github.com/jage/rbankgiro}
|
38
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
39
|
-
s.require_paths = ["lib"]
|
40
|
-
s.rubygems_version = %q{1.3.5}
|
41
|
-
s.summary = %q{Parse Bankgiro transaction files}
|
42
|
-
s.test_files = [
|
43
|
-
"test/helper.rb",
|
44
|
-
"test/test_transaction.rb",
|
45
|
-
"test/test_transactions.rb"
|
46
|
-
]
|
47
|
-
|
48
|
-
if s.respond_to? :specification_version then
|
49
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
50
|
-
s.specification_version = 3
|
51
|
-
|
52
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
53
|
-
else
|
54
|
-
end
|
55
|
-
else
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
@@ -1,45 +0,0 @@
|
|
1
|
-
00 060620 BANKGIROT
|
2
|
-
10
|
3
|
-
20 9912346
|
4
|
-
30 9912346060620
|
5
|
-
40 39407150000000147700 5540020977
|
6
|
-
40 39407640000000198100 5511115706
|
7
|
-
40 39408300000000190700 5541008608
|
8
|
-
40 39408890000000073100 5540093777
|
9
|
-
40 39408890000000132100 5540006858
|
10
|
-
40 39409620000000087600 5540094494
|
11
|
-
40 39410690000000078500 5517551977
|
12
|
-
40 39410770000000094900 5540021183
|
13
|
-
40 39410850000000169300 5517035205
|
14
|
-
40 39410930000000084100 5547510501
|
15
|
-
40 39411010000000084900 5511100321
|
16
|
-
40 39411190000000074200 5540022584
|
17
|
-
40 39411350000000076900 5540025566
|
18
|
-
40 39411430000000229300 5517540398
|
19
|
-
40 39411500000000075500 5540097588
|
20
|
-
40 39411680000000082700 5540009276
|
21
|
-
40 39411760000000123900 5540021117
|
22
|
-
40 39411840000000248300 5511053245
|
23
|
-
40 39411840000000201100 5541008627
|
24
|
-
40 39412000000000147700 5517043623
|
25
|
-
40 39412180000000123000 5547510510
|
26
|
-
40 39412260000000082700 5540022386
|
27
|
-
40 39412340000000087700 5517003480
|
28
|
-
40 39412420000000153800 5517537838
|
29
|
-
40 39412590000000100000 5504092053
|
30
|
-
40 39412750000000034000 5514040512
|
31
|
-
40 39412750000000194000 5517061500
|
32
|
-
40 39412910000000200395 LB 0002582200
|
33
|
-
40 39413740000000113700 5517041901
|
34
|
-
40 39413740000000191300 5540043993
|
35
|
-
40 39413900000000113400 LB 0005550731
|
36
|
-
40 39414080000000158800 LB 0003334451
|
37
|
-
40 39414240000000201700 5540020428
|
38
|
-
40 39414570000000113400 5541008602
|
39
|
-
40 39416060000000119900 5540026099
|
40
|
-
40 39417050000000320800 5540011036
|
41
|
-
40 8841298000000009989N LB 0002582200
|
42
|
-
40 8841397000000010000- LB 0005550731
|
43
|
-
50 99123460606200000038000000004709300
|
44
|
-
90 0606200000038000000004709300
|
45
|
-
|
@@ -1,46 +0,0 @@
|
|
1
|
-
00 060620 BANKGIROT
|
2
|
-
10
|
3
|
-
20 99123465
|
4
|
-
30 99123465060620 9912346
|
5
|
-
40 49523470000000010000 5540020978
|
6
|
-
40 49524530000000797800 5540094949
|
7
|
-
50 991234650606200000002000000000807800 9912346
|
8
|
-
20 9912346
|
9
|
-
30 9912346060620
|
10
|
-
40 39407150000000147700 5540020977
|
11
|
-
40 39407640000000198100 5511115706
|
12
|
-
40 39408300000000190700 5541008608
|
13
|
-
40 39408890000000073100 5540093777
|
14
|
-
40 39408890000000132100 5540006858
|
15
|
-
40 39409620000000087600 5540094494
|
16
|
-
40 39410690000000078500 5517551977
|
17
|
-
40 39410770000000094900 5540021183
|
18
|
-
40 39410850000000169300 5517035205
|
19
|
-
40 39410930000000084100 5547510501
|
20
|
-
40 39411010000000084900 5511100321
|
21
|
-
40 39411190000000074200 5540022584
|
22
|
-
40 39411350000000076900 5540025566
|
23
|
-
40 39411430000000229300 5517540398
|
24
|
-
40 39411500000000075500 5540097588
|
25
|
-
40 39411680000000082700 5540009276
|
26
|
-
40 39411760000000123900 5540021117
|
27
|
-
40 39411840000000248300 5511053245
|
28
|
-
40 39411840000000201100 5541008627
|
29
|
-
40 39412000000000147700 5517043623
|
30
|
-
40 39412180000000123000 5547510510
|
31
|
-
40 39412260000000082700 5540022386
|
32
|
-
40 39412340000000087700 5517003480
|
33
|
-
40 39412420000000153800 5517537838
|
34
|
-
40 39412590000000100000 5504092053
|
35
|
-
40 39412750000000034000 5514040512
|
36
|
-
40 39412750000000194000 5517061500
|
37
|
-
40 39413740000000113700 5517041901
|
38
|
-
40 39413740000000191300 5540043993
|
39
|
-
40 39413900000000113400 LB 0005550731
|
40
|
-
40 39414080000000158800 LB 0003334451
|
41
|
-
40 39414240000000201700 5540020428
|
42
|
-
40 39414570000000113400 5541008602
|
43
|
-
40 39416060000000119900 5540026099
|
44
|
-
40 39417050000000320800 5540011036
|
45
|
-
50 99123460606200000035000000004708800
|
46
|
-
90 0606200000037000000005516600
|
@@ -1,45 +0,0 @@
|
|
1
|
-
00 060620 BANKGIROT
|
2
|
-
10
|
3
|
-
20 9912346
|
4
|
-
30 9912346060620
|
5
|
-
40 39407150000000147700 5540020977
|
6
|
-
40 39407640000000198100 5511115706
|
7
|
-
40 39408300000000190700 5541008608
|
8
|
-
40 39408890000000073100 5540093777
|
9
|
-
40 39408890000000132100 5540006858
|
10
|
-
40 39409620000000087600 5540094494
|
11
|
-
40 39410690000000078500 5517551977
|
12
|
-
40 39410770000000094900 5540021183
|
13
|
-
40 39410850000000169300 5517035205
|
14
|
-
40 39410930000000084100 5547510501
|
15
|
-
40 39411010000000084900 5511100321
|
16
|
-
40 39411190000000074200 5540022584
|
17
|
-
40 39411350000000076900 5540025566
|
18
|
-
40 39411430000000229300 5517540398
|
19
|
-
40 39411500000000075500 5540097588
|
20
|
-
40 39411680000000082700 5540009276
|
21
|
-
40 39411760000000123900 5540021117
|
22
|
-
40 39411840000000248300 5511053245
|
23
|
-
40 39411840000000201100 5541008627
|
24
|
-
40 39412000000000147700 5517043623
|
25
|
-
40 39412180000000123000 5547510510
|
26
|
-
40 39412260000000082700 5540022386
|
27
|
-
40 39412340000000087700 5517003480
|
28
|
-
40 39412420000000153800 5517537838
|
29
|
-
40 39412590000000100000 5504092053
|
30
|
-
40 39412750000000034000 5514040512
|
31
|
-
40 39412750000000194000 5517061500
|
32
|
-
40 39412910000000200395 LB 0002582200
|
33
|
-
40 39413740000000113700 5517041901
|
34
|
-
40 39413740000000191300 5540043993
|
35
|
-
40 39413900000000113400 LB 0005550731
|
36
|
-
40 39414080000000158800 LB 0003334451
|
37
|
-
40 39414240000000201700 5540020428
|
38
|
-
40 39414570000000113400 5541008602
|
39
|
-
40 39416060000000119900 5540026099
|
40
|
-
40 39417050000000320800 5540011036
|
41
|
-
40 8841298000000009989N 0002582200
|
42
|
-
40 8841397000000010000- LB 0005550731
|
43
|
-
50 99123460606200000038000000004709300
|
44
|
-
90 0606200000038000000004709300
|
45
|
-
|