supplier_payments 0.0.2 → 0.0.3

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
2
  SHA256:
3
- metadata.gz: 813cbd012bead806a978feef2a8c647eb12bc6d8884631b4dc63dacac9216b20
4
- data.tar.gz: c0b6453b3ed89d2c6c2f14a5e1e3f9393f7c4a5ce4ff7496230abebdba52375a
3
+ metadata.gz: 04ff3cee936f9098084b55000054afe00d1fe203c41e4eda8e297de31de9c413
4
+ data.tar.gz: 05436f41f0ff3c26c3d035c255e45724ef140245f4b01b488fd5e72e5d7e4f68
5
5
  SHA512:
6
- metadata.gz: 424e8b77af02672e0a71940a8ea28aa17ca8d14bd83d85e5f09ed80be21d22eeb5156c01c4f07ed326f971f2b06ee43488c30682a778a9ed913904a570c2eae8
7
- data.tar.gz: 8e2130999d73019f3bd099cc963fcde2fa5fe0ec51b664c0bcd81f25eb6c361273aa14621df0f4eb37aa4720747c3e8fd6c803c28649994fc24d09e88bb20065
6
+ metadata.gz: f9b54e8a2da0c46aacbe644bb713c9c6e6f869b61a7a58ca6d53f21c015c2eaabbb933e4effc5d4f3faaf5b68935177dcb2f1d68deffefc820b153df37f0b508
7
+ data.tar.gz: 7220a009d5a050571dea1f46e084c498c4e29e8d49478869c1b9bdb9c0f84a5bad4b0bc99544a690bcd5a6dc2cf573e1f0673e2a65643f1ce89a48c4f12b342d
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Supplier Payments
2
2
 
3
- [![CircleCI](https://circleci.com/gh/barsoom/supplier_payments.svg?style=svg)](https://circleci.com/gh/barsoom/supplier_payments)
3
+ [![CI](https://github.com/barsoom/supplier_payments/actions/workflows/ci.yml/badge.svg)](https://github.com/barsoom/supplier_payments/actions/workflows/ci.yml)
4
4
 
5
5
  Library for making Bankgirot supplier payment files, _Leverantörsbetalningar_.
6
6
 
@@ -8,3 +8,5 @@ Library for making Bankgirot supplier payment files, _Leverantörsbetalningar_.
8
8
 
9
9
  * På svenska: ["Leverantörsbetalningar, teknisk manual"](http://www.bgc.se/globalassets/dokument/tekniska-manualer/leverantorsbetalningar_tekniskmanual_sv.pdf) (PDF)
10
10
  * In English: ["Supplier Payments (Leverantörsbetalningar), technical manual"](http://www.bgc.se/globalassets/dokument/tekniska-manualer/supplierpayments_leverantorsbetalningar_technicalmanual_en.pdf) (PDF)
11
+
12
+ [API documentation for this gem](https://www.rubydoc.info/gems/supplier_payments/)
@@ -1,160 +1,160 @@
1
1
  module SupplierPayments
2
2
  class PaymentFile
3
3
  class OpeningRecord < AbstractRecord
4
- self.transaction_code = '11'
4
+ self.transaction_code = "11"
5
5
  self.layout = [
6
- [ :transaction_code!, 2, 'N' ],
7
- [ :sender_bankgiro, 10, 'N', :right_align, :zerofill ],
8
- [ :date_written, 6, 'N' ],
9
- [ :product, 22, 'A' ],
10
- [ :payment_date, 6, 'N' ],
11
- [ :reserved!, 13, 'N' ],
12
- [ :currency_code, 3, 'A' ],
13
- [ :reserved!, 18, 'A' ],
6
+ [ :transaction_code!, 2, "N" ],
7
+ [ :sender_bankgiro, 10, "N", :right_align, :zerofill ],
8
+ [ :date_written, 6, "N" ],
9
+ [ :product, 22, "A" ],
10
+ [ :payment_date, 6, "N" ],
11
+ [ :reserved!, 13, "N" ],
12
+ [ :currency_code, 3, "A" ],
13
+ [ :reserved!, 18, "A" ],
14
14
  ]
15
15
  end
16
16
 
17
17
  class FixedInformationRecord < AbstractRecord
18
- self.transaction_code = '12'
18
+ self.transaction_code = "12"
19
19
  self.layout = [
20
- [ :transaction_code!, 2, 'N' ],
21
- [ :information_text, 50, 'A' ], # Information reported to recipients with bankgiro number in
20
+ [ :transaction_code!, 2, "N" ],
21
+ [ :information_text, 50, "A" ], # Information reported to recipients with bankgiro number in
22
22
  # all sections with the same forwarding bankgiro number
23
23
  # (For example: Merry Christmas, We have moved etc.) or blank.
24
- [ :end_date, 6, 'A' ],
25
- [ :reserved!, 22, 'A' ]
24
+ [ :end_date, 6, "A" ],
25
+ [ :reserved!, 22, "A" ],
26
26
  ]
27
27
  end
28
28
 
29
29
  class HeaderRecord < AbstractRecord
30
- self.transaction_code = '13'
30
+ self.transaction_code = "13"
31
31
  self.layout = [
32
- [ :transaction_code!, 2, 'N' ],
33
- [ :payment_specifications_header, 25, 'A' ],
34
- [ :net_amount_header, 12, 'A' ],
35
- [ :reserved!, 41, 'A' ]
32
+ [ :transaction_code!, 2, "N" ],
33
+ [ :payment_specifications_header, 25, "A" ],
34
+ [ :net_amount_header, 12, "A" ],
35
+ [ :reserved!, 41, "A" ],
36
36
  ]
37
37
  end
38
38
 
39
39
  class PaymentRecord < AbstractRecord
40
- self.transaction_code = '14'
40
+ self.transaction_code = "14"
41
41
  self.layout = [
42
- [ :transaction_code!, 2, 'N' ],
43
- [ :bankgiro_or_credit_transfer_number, 10, 'N', :right_align, :zerofill ],
44
- [ :ocr, 25, 'A' ],
45
- [ :amount, 12, 'N', :right_align, :zerofill ],
46
- [ :payment_date, 6, 'N' ], # YYMMDD or GENAST
47
- [ :reserved!, 5, 'A' ],
48
- [ :information_to_sender, 20, 'A' ]
42
+ [ :transaction_code!, 2, "N" ],
43
+ [ :bankgiro_or_credit_transfer_number, 10, "N", :right_align, :zerofill ],
44
+ [ :ocr, 25, "A" ],
45
+ [ :amount, 12, "N", :right_align, :zerofill ],
46
+ [ :payment_date, 6, "N" ], # YYMMDD or GENAST
47
+ [ :reserved!, 5, "A" ],
48
+ [ :information_to_sender, 20, "A" ],
49
49
  ]
50
50
  end
51
51
 
52
52
  class DeductionRecord < AbstractRecord
53
- self.transaction_code = '15'
53
+ self.transaction_code = "15"
54
54
  self.layout = [
55
- [ :transaction_code!, 2, 'N' ],
56
- [ :bankgiro_or_credit_transfer_number, 10, 'N', :right_align, :zerofill ],
57
- [ :ocr, 25, 'A' ],
58
- [ :deduction_amount, 12, 'N', :right_align, :zerofill ],
59
- [ :deduction_date, 6, 'N' ], # YYMMDD or GENAST
60
- [ :reserved!, 5, 'A' ],
61
- [ :information_to_sender, 20, 'A' ]
55
+ [ :transaction_code!, 2, "N" ],
56
+ [ :bankgiro_or_credit_transfer_number, 10, "N", :right_align, :zerofill ],
57
+ [ :ocr, 25, "A" ],
58
+ [ :deduction_amount, 12, "N", :right_align, :zerofill ],
59
+ [ :deduction_date, 6, "N" ], # YYMMDD or GENAST
60
+ [ :reserved!, 5, "A" ],
61
+ [ :information_to_sender, 20, "A" ],
62
62
  ]
63
63
  end
64
64
 
65
65
  class CreditInvoiceWithMonitoringRecord < AbstractRecord
66
- self.transaction_code = '16'
66
+ self.transaction_code = "16"
67
67
  self.layout = [
68
- [ :transaction_code!, 2, 'N' ],
69
- [ :bankgiro_or_credit_transfer_number, 10, 'N', :right_align, :zerofill ],
70
- [ :ocr, 25, 'A' ],
71
- [ :amount, 12, 'N', :right_align, :zerofill ],
72
- [ :last_monitoring_day, 6, 'A' ], # YYMMDD or GENAST
73
- [ :reserved!, 5, 'A' ],
74
- [ :information_to_sender, 20, 'N' ]
68
+ [ :transaction_code!, 2, "N" ],
69
+ [ :bankgiro_or_credit_transfer_number, 10, "N", :right_align, :zerofill ],
70
+ [ :ocr, 25, "A" ],
71
+ [ :amount, 12, "N", :right_align, :zerofill ],
72
+ [ :last_monitoring_day, 6, "A" ], # YYMMDD or GENAST
73
+ [ :reserved!, 5, "A" ],
74
+ [ :information_to_sender, 20, "N" ],
75
75
  ]
76
76
  end
77
77
 
78
78
  class InformationRecord < AbstractRecord
79
- self.transaction_code = '25'
79
+ self.transaction_code = "25"
80
80
  self.layout = [
81
- [ :transaction_code!, 2, 'N' ],
82
- [ :bankgiro_or_credit_transfer_number, 10, 'N', :right_align, :zerofill ],
83
- [ :information_text, 50, 'A' ],
84
- [ :reserved!, 18, 'A' ],
81
+ [ :transaction_code!, 2, "N" ],
82
+ [ :bankgiro_or_credit_transfer_number, 10, "N", :right_align, :zerofill ],
83
+ [ :information_text, 50, "A" ],
84
+ [ :reserved!, 18, "A" ],
85
85
  ]
86
86
  end
87
87
 
88
88
  class TotalAmountRecord < AbstractRecord
89
- self.transaction_code = '29'
89
+ self.transaction_code = "29"
90
90
  self.layout = [
91
- [ :transaction_code!, 2, 'N' ],
92
- [ :sender_bankgiro, 10, 'N', :right_align, :zerofill ],
93
- [ :number_of_payment_records, 8, 'N', :right_align, :zerofill ],
94
- [ :total_amount, 12, 'N', :right_align, :zerofill ],
95
- [ :negative_total_amount, 1, 'A' ], # Minus sign (if total amount is negative) or blank.
96
- [ :reserved!, 47, 'A' ]
91
+ [ :transaction_code!, 2, "N" ],
92
+ [ :sender_bankgiro, 10, "N", :right_align, :zerofill ],
93
+ [ :number_of_payment_records, 8, "N", :right_align, :zerofill ],
94
+ [ :total_amount, 12, "N", :right_align, :zerofill ],
95
+ [ :negative_total_amount, 1, "A" ], # Minus sign (if total amount is negative) or blank.
96
+ [ :reserved!, 47, "A" ],
97
97
  ]
98
98
  end
99
99
 
100
100
  class NameRecord < AbstractRecord
101
- self.transaction_code = '26'
101
+ self.transaction_code = "26"
102
102
  self.layout = [
103
- [ :transaction_code!, 2, 'N' ],
104
- [ :reserved!, 4, 'N', :zerofill ], # 0000
105
- [ :credit_transfer_number, 6, 'N', :right_align, :zerofill ], # Must be the same as in the payment record or account number record, to which it belongs.
106
- [ :payee_name, 35, 'A', :upcase ],
107
- [ :extra_information, 33, 'A' ], # Used, for example, for C/O addresses.
103
+ [ :transaction_code!, 2, "N" ],
104
+ [ :reserved!, 4, "N", :zerofill ], # 0000
105
+ [ :credit_transfer_number, 6, "N", :right_align, :zerofill ], # Must be the same as in the payment record or account number record, to which it belongs.
106
+ [ :payee_name, 35, "A", :upcase ],
107
+ [ :extra_information, 33, "A" ], # Used, for example, for C/O addresses.
108
108
  ]
109
109
  end
110
110
 
111
111
  class AddressRecord < AbstractRecord
112
- self.transaction_code = '27'
112
+ self.transaction_code = "27"
113
113
  self.layout = [
114
- [ :transaction_code!, 2, 'N' ],
115
- [ :reserved!, 4, 'N', :zerofill ],
116
- [ :credit_transfer_number, 6, 'N', :right_align, :zerofill ],
117
- [ :payee_address, 35, 'A', :upcase ],
118
- [ :post_code, 5, 'N' ], # No spaces
119
- [ :town, 20, 'A', :upcase ],
120
- [ :reserved!, 8, 'A' ]
114
+ [ :transaction_code!, 2, "N" ],
115
+ [ :reserved!, 4, "N", :zerofill ],
116
+ [ :credit_transfer_number, 6, "N", :right_align, :zerofill ],
117
+ [ :payee_address, 35, "A", :upcase ],
118
+ [ :post_code, 5, "N" ], # No spaces
119
+ [ :town, 20, "A", :upcase ],
120
+ [ :reserved!, 8, "A" ],
121
121
  ]
122
122
  end
123
123
 
124
124
  class AccountNumberRecord < AbstractRecord
125
- self.transaction_code = '40'
125
+ self.transaction_code = "40"
126
126
  self.layout = [
127
- [ :transaction_code!, 2, 'N' ],
128
- [ :reserved!, 4, 'N', :zerofill ], # 0000
129
- [ :credit_transfer_number, 6, 'N', :right_align, :zerofill ],
130
- [ :clearing_number, 4, 'N' ],
131
- [ :account_number, 12, 'N', :right_align, :zerofill ],
132
- [ :payment_identification, 12, 'A' ], # Information to the payee to identify the payment. Printed on the payee's bank statement.
133
- [ :code_for_salary, 1, 'A' ], # L for salary, else blank.
134
- [ :reserved!, 39, 'A' ]
127
+ [ :transaction_code!, 2, "N" ],
128
+ [ :reserved!, 4, "N", :zerofill ], # 0000
129
+ [ :credit_transfer_number, 6, "N", :right_align, :zerofill ],
130
+ [ :clearing_number, 4, "N" ],
131
+ [ :account_number, 12, "N", :right_align, :zerofill ],
132
+ [ :payment_identification, 12, "A" ], # Information to the payee to identify the payment. Printed on the payee's bank statement.
133
+ [ :code_for_salary, 1, "A" ], # L for salary, else blank.
134
+ [ :reserved!, 39, "A" ],
135
135
  ]
136
136
  end
137
137
 
138
138
  class PlusGiroPaymentRecord < AbstractRecord
139
- self.transaction_code = '54'
139
+ self.transaction_code = "54"
140
140
  self.layout = [
141
- [ :transaction_code!, 2, 'N' ],
142
- [ :plusgiro_account, 10, 'N', :right_align, :zerofill ],
143
- [ :ocr, 25, 'A' ],
144
- [ :amount, 12, 'N', :right_align, :zerofill ],
145
- [ :payment_date, 6, 'A' ], # YYMMDD or GENAST.
146
- [ :reserved!, 5, 'A' ],
147
- [ :information_to_sender, 20, 'A' ] # Optional text or blank.
141
+ [ :transaction_code!, 2, "N" ],
142
+ [ :plusgiro_account, 10, "N", :right_align, :zerofill ],
143
+ [ :ocr, 25, "A" ],
144
+ [ :amount, 12, "N", :right_align, :zerofill ],
145
+ [ :payment_date, 6, "A" ], # YYMMDD or GENAST.
146
+ [ :reserved!, 5, "A" ],
147
+ [ :information_to_sender, 20, "A" ], # Optional text or blank.
148
148
  ]
149
149
  end
150
150
 
151
151
  class PlusGiroInformationRecord < AbstractRecord
152
- self.transaction_code = '65'
152
+ self.transaction_code = "65"
153
153
  self.layout = [
154
- [ :transaction_code!, 2, 'N' ],
155
- [ :plusgiro_account, 10, 'N', :right_align, :zerofill ],
156
- [ :information_text, 35, 'A' ], # Optional text, printed on notifications and lists.
157
- [ :reserved!, 33, 'A' ]
154
+ [ :transaction_code!, 2, "N" ],
155
+ [ :plusgiro_account, 10, "N", :right_align, :zerofill ],
156
+ [ :information_text, 35, "A" ], # Optional text, printed on notifications and lists.
157
+ [ :reserved!, 33, "A" ],
158
158
  ]
159
159
  end
160
160
  end
@@ -12,10 +12,11 @@ module SupplierPayments
12
12
 
13
13
  def layout=(layout)
14
14
  length = layout_length(layout)
15
- raise LayoutError.new("Layout length #{ length } is not 80") unless length == 80
15
+ raise LayoutError.new("Layout length #{length} is not 80") unless length == 80
16
16
 
17
17
  layout.each do |field, length, format, *opts|
18
18
  next if field[-1] == "!"
19
+
19
20
  attr_accessor field
20
21
  end
21
22
 
@@ -41,7 +42,7 @@ module SupplierPayments
41
42
  if field[-1] == "!"
42
43
  io.seek(length, IO::SEEK_CUR)
43
44
  else
44
- record.send("#{ field }=", io.read(length))
45
+ record.send("#{field}=", io.read(length))
45
46
  end
46
47
  end
47
48
 
@@ -50,7 +51,7 @@ module SupplierPayments
50
51
 
51
52
  def initialize(attrs = {})
52
53
  attrs.each do |key, value|
53
- self.send("#{ key }=", value)
54
+ self.send("#{key}=", value)
54
55
  end
55
56
  end
56
57
 
@@ -63,9 +64,10 @@ module SupplierPayments
63
64
  def inspect
64
65
  str = self.class.layout.map { |field, length, format, *opts|
65
66
  next if field[-1] == "!"
66
- ":#{ field } => #{ send(field).inspect }"
67
+
68
+ ":#{field} => #{send(field).inspect}"
67
69
  }.compact.join(", ")
68
- "<#{ self.class.name }(#{ transaction_code }) #{ str }>"
70
+ "<#{self.class.name}(#{transaction_code}) #{str}>"
69
71
  end
70
72
 
71
73
  def transaction_code
@@ -20,7 +20,7 @@ module SupplierPayments
20
20
 
21
21
  def to_s
22
22
  records.map { |record|
23
- "#{ record.to_s.dup.force_encoding("ISO-8859-15") }\r\n"
23
+ "#{record.to_s.dup.force_encoding("ISO-8859-15")}\r\n"
24
24
  }.join
25
25
  end
26
26
 
@@ -28,6 +28,7 @@ module SupplierPayments
28
28
  records = data.lines.map do |line|
29
29
  line.strip!
30
30
  next if line.empty?
31
+
31
32
  record_class(line).parse(line)
32
33
  end
33
34
  new(records)
@@ -38,7 +39,7 @@ module SupplierPayments
38
39
  def self.record_class(line)
39
40
  record_classes.find do |record_class|
40
41
  line.match(/^#{record_class.transaction_code}/)
41
- end or raise "No record class found for line: #{ line.inspect }"
42
+ end or raise "No record class found for line: #{line.inspect}"
42
43
  end
43
44
  end
44
45
  end
@@ -1,3 +1,3 @@
1
1
  module SupplierPayments
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -1,8 +1,8 @@
1
- require './lib/supplier_payments'
1
+ require "./lib/supplier_payments"
2
2
 
3
3
  module FixtureHelper
4
4
  def fixture_path(filename)
5
- File.join(File.dirname(__FILE__), 'fixtures', filename)
5
+ File.join(File.dirname(__FILE__), "fixtures", filename)
6
6
  end
7
7
  end
8
8
 
@@ -1,20 +1,20 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  describe SupplierPayments::PaymentFile::AbstractRecord do
4
- context 'with a test record class' do
4
+ context "with a test record class" do
5
5
  class TestRecord < SupplierPayments::PaymentFile::AbstractRecord
6
- self.transaction_code = '99'
6
+ self.transaction_code = "99"
7
7
  self.layout = [
8
- [ :transaction_code!, 2, 'N' ],
9
- [ :foo, 14, 'N', :zerofill, :right_align ],
10
- [ :bar, 20, 'A' ],
11
- [ :reserved!, 5, 'N', :zerofill ],
12
- [ :baz, 10, 'A', :right_align, :upcase ],
13
- [ :reserved!, 29, 'A' ]
8
+ [ :transaction_code!, 2, "N" ],
9
+ [ :foo, 14, "N", :zerofill, :right_align ],
10
+ [ :bar, 20, "A" ],
11
+ [ :reserved!, 5, "N", :zerofill ],
12
+ [ :baz, 10, "A", :right_align, :upcase ],
13
+ [ :reserved!, 29, "A" ],
14
14
  ]
15
15
  end
16
16
 
17
- it 'should parse a line' do
17
+ it "should parse a line" do
18
18
  record = TestRecord.parse("9900000000054321BBBBBBBBBBBBBBBBBBBBxxxxx YYYYY ")
19
19
  expect(record.transaction_code).to eq("99")
20
20
  expect(record.foo).to eq("00000000054321")
@@ -22,7 +22,7 @@ describe SupplierPayments::PaymentFile::AbstractRecord do
22
22
  expect(record.baz).to eq(" YYYYY")
23
23
  end
24
24
 
25
- it 'should make a line' do
25
+ it "should make a line" do
26
26
  record = TestRecord.new
27
27
  record.foo = 1234
28
28
  record.bar = "ASDFG"
@@ -30,7 +30,7 @@ describe SupplierPayments::PaymentFile::AbstractRecord do
30
30
  expect(record.to_s).to eq("9900000000001234ASDFG 00000 GHIJK ")
31
31
  end
32
32
 
33
- it 'should strip long lines' do
33
+ it "should strip long lines" do
34
34
  record = TestRecord.new
35
35
  record.foo = 314159265358979323846
36
36
  expect(record.to_s.length).to eq(80)
@@ -43,7 +43,7 @@ describe SupplierPayments::PaymentFile::AbstractRecord do
43
43
  Class.new(SupplierPayments::PaymentFile::AbstractRecord) do
44
44
  self.transaction_code = "98"
45
45
  self.layout = [
46
- [ :transaction_code, 2, 'N' ]
46
+ [ :transaction_code, 2, "N" ],
47
47
  ]
48
48
  end
49
49
  }.to raise_error(SupplierPayments::PaymentFile::AbstractRecord::LayoutError)
@@ -1,14 +1,14 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  describe SupplierPayments::PaymentFile do
4
4
  describe ".load" do
5
- context 'with LBin-exempel1.txt' do
5
+ context "with LBin-exempel1.txt" do
6
6
  before do
7
- @raw_data = File.read(fixture_path('LBin-exempel1.txt'))
7
+ @raw_data = File.read(fixture_path("LBin-exempel1.txt"))
8
8
  @raw_data.force_encoding("iso-8859-15")
9
9
  end
10
10
 
11
- it 'should load a file' do
11
+ it "should load a file" do
12
12
  file = SupplierPayments::PaymentFile.load(@raw_data)
13
13
  @raw_data.lines.zip(file.to_s.lines).each do |line1, line2|
14
14
  expect(line1.strip).to eq(line2.force_encoding("iso-8859-15").strip)
@@ -16,13 +16,13 @@ describe SupplierPayments::PaymentFile do
16
16
  end
17
17
  end
18
18
 
19
- context 'with LBin-exempel2.txt' do
19
+ context "with LBin-exempel2.txt" do
20
20
  before do
21
- @raw_data = File.read(fixture_path('LBin-exempel2.txt'))
21
+ @raw_data = File.read(fixture_path("LBin-exempel2.txt"))
22
22
  @raw_data.force_encoding("iso-8859-15")
23
23
  end
24
24
 
25
- it 'should load a file' do
25
+ it "should load a file" do
26
26
  file = SupplierPayments::PaymentFile.load(@raw_data)
27
27
  @raw_data.lines.zip(file.to_s.lines).each do |line1, line2|
28
28
  expect(line1.strip).to eq(line2.force_encoding("iso-8859-15").strip)
@@ -33,14 +33,14 @@ describe SupplierPayments::PaymentFile do
33
33
 
34
34
  describe "#to_s" do
35
35
  class TestRecord < SupplierPayments::PaymentFile::AbstractRecord
36
- self.transaction_code = '99'
36
+ self.transaction_code = "99"
37
37
  self.layout = [
38
- [ :transaction_code!, 2, 'N' ],
39
- [ :foo, 14, 'N', :zerofill, :right_align ],
40
- [ :bar, 20, 'A' ],
41
- [ :reserved!, 5, 'N', :zerofill ],
42
- [ :baz, 10, 'A', :right_align, :upcase ],
43
- [ :reserved!, 29, 'A' ]
38
+ [ :transaction_code!, 2, "N" ],
39
+ [ :foo, 14, "N", :zerofill, :right_align ],
40
+ [ :bar, 20, "A" ],
41
+ [ :reserved!, 5, "N", :zerofill ],
42
+ [ :baz, 10, "A", :right_align, :upcase ],
43
+ [ :reserved!, 29, "A" ],
44
44
  ]
45
45
  end
46
46
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: supplier_payments
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Alin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-30 00:00:00.000000000 Z
11
+ date: 2021-11-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Parse and generate supplier payment files for "Leverantörsbetalningar"
14
14
  in Bankgirot.
@@ -18,11 +18,7 @@ executables: []
18
18
  extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
- - ".circleci/config.yml"
22
- - ".gitignore"
23
- - Gemfile
24
21
  - README.md
25
- - Rakefile
26
22
  - lib/supplier_payments.rb
27
23
  - lib/supplier_payments/payment_file.rb
28
24
  - lib/supplier_payments/payment_file/domestic_records.rb
@@ -33,10 +29,10 @@ files:
33
29
  - spec/spec_helper.rb
34
30
  - spec/supplier_payments/payment_file/records_spec.rb
35
31
  - spec/supplier_payments/payment_file_spec.rb
36
- - supplier_payments.gemspec
37
32
  homepage: https://github.com/barsoom/supplier_payments
38
33
  licenses: []
39
- metadata: {}
34
+ metadata:
35
+ rubygems_mfa_required: 'true'
40
36
  post_install_message:
41
37
  rdoc_options: []
42
38
  require_paths:
@@ -52,8 +48,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
52
48
  - !ruby/object:Gem::Version
53
49
  version: '0'
54
50
  requirements: []
55
- rubygems_version: 3.1.2
51
+ rubygems_version: 3.2.31
56
52
  signing_key:
57
53
  specification_version: 4
58
54
  summary: Parse and generate supplier payment files for Bankgirot.
59
- test_files: []
55
+ test_files:
56
+ - spec/fixtures/LBin-exempel1.txt
57
+ - spec/fixtures/LBin-exempel2.txt
58
+ - spec/spec_helper.rb
59
+ - spec/supplier_payments/payment_file/records_spec.rb
60
+ - spec/supplier_payments/payment_file_spec.rb
data/.circleci/config.yml DELETED
@@ -1,14 +0,0 @@
1
- version: 2.1
2
- orbs:
3
- ruby: circleci/ruby@0.2.2
4
-
5
- jobs:
6
- build:
7
- environment:
8
- BUNDLE_PATH: vendor/bundle
9
- executor: ruby/default
10
- steps:
11
- - checkout
12
- - ruby/install-deps
13
- - ruby/run-tests
14
-
data/.gitignore DELETED
@@ -1,5 +0,0 @@
1
- *.gem
2
- .bundle
3
- Gemfile.lock
4
- pkg/*
5
- tmp/
data/Gemfile DELETED
@@ -1,11 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec
4
-
5
- gem 'rake'
6
- gem 'rspec'
7
-
8
- group :test do
9
- gem 'rspec_junit_formatter'
10
- end
11
-
data/Rakefile DELETED
@@ -1,5 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
- RSpec::Core::RakeTask.new(:spec)
4
-
5
- task :default => :spec
@@ -1,17 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "supplier_payments/version"
4
-
5
- Gem::Specification.new do |s|
6
- s.name = "supplier_payments"
7
- s.version = SupplierPayments::VERSION
8
- s.authors = ["Andreas Alin"]
9
- s.email = ["andreas.alin@gmail.com"]
10
- s.homepage = "https://github.com/barsoom/supplier_payments"
11
- s.summary = %q{Parse and generate supplier payment files for Bankgirot.}
12
- s.description = %q{Parse and generate supplier payment files for "Leverantörsbetalningar" in Bankgirot.}
13
-
14
- s.files = `git ls-files`.split("\n")
15
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
- s.require_paths = ["lib"]
17
- end