king_dtaus 1.0.2 → 2.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,105 @@
1
+ $:.unshift(File.dirname(__FILE__))
2
+ $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+
4
+ require 'rubygems'
5
+ require "king_dtaus"
6
+ require 'rspec'
7
+ require 'ostruct'
8
+ require 'date'
9
+
10
+ class Dtazv
11
+
12
+ def dudes_konto
13
+ opts = {
14
+ :account_number => '1326049634',
15
+ :bank_number => '37050299',
16
+ :bank_name => 'Kreissparkasse Köln',
17
+ :zweck => 'Monatsbeitrag',
18
+ :account_street => "Bank Eine Straße 2",
19
+ :account_city => "Bank Köln",
20
+ :account_zip_code => "51063",
21
+ :client_number => "",
22
+ :client_name =>'Jan Kus',
23
+ :client_street => "Meine Eine Straße 2",
24
+ :client_city => "Meine Köln",
25
+ :client_zip_code => "51063",
26
+ :bank_country_code => "DE",
27
+ :client_country_code => "DE"
28
+ }
29
+ TestKonto.new(opts)
30
+ end
31
+
32
+ def dalai_lamas_account
33
+ opts = {
34
+ :account_number => 'GR1601101250000000012300695',
35
+ :bank_number => 'MARKF1100',
36
+ :bank_name => 'Kuba National Bank',
37
+ :zweck => 'President-Fee',
38
+ :account_street => "5th avenue",
39
+ :account_city => "los angeles",
40
+ :account_zip_code => "55323",
41
+ :client_number => "",
42
+ :client_name =>'Fidel Castro',
43
+ :client_street => "Bush-Avenue 55",
44
+ :client_city => "Kuba",
45
+ :client_zip_code => "066600",
46
+ :client_zip_code => "445555",
47
+ :bank_country_code => "DE",
48
+ :client_country_code => "DE"
49
+ }
50
+ TestKonto.new(opts)
51
+ end
52
+
53
+ # The DTAVZ format as string. All data is appended to it during creation
54
+ def dta_string
55
+ @dta_string ||= ''
56
+ end
57
+
58
+ def create_dtazv
59
+ @date = Date.today
60
+ @dudes_dtazv_export = KingDta::Dtazv.new(@date)
61
+ @dudes_konto = self.dudes_konto
62
+ @dalai_lamas_account = self.dalai_lamas_account
63
+ @dudes_dtazv_export.account = KingDta::Account.new(
64
+ @dudes_konto.account_number,
65
+ @dudes_konto.bank_number,
66
+ @dudes_konto.client_name,
67
+ @dudes_konto.client_number,
68
+ @dudes_konto.account_street,
69
+ @dudes_konto.account_city,
70
+ @dudes_konto.account_zip_code,
71
+ @dudes_konto.bank_name,
72
+ @dudes_konto.client_street,
73
+ @dudes_konto.client_city,
74
+ @dudes_konto.client_zip_code,
75
+ @dudes_konto.bank_country_code,
76
+ @dudes_konto.client_country_code
77
+ )
78
+
79
+ @fidel_castros_booking = KingDta::Booking.new(KingDta::Account.new(
80
+ @dalai_lamas_account.account_number,
81
+ @dalai_lamas_account.bank_number,
82
+ @dalai_lamas_account.client_name,
83
+ @dalai_lamas_account.bank_name,
84
+ @dalai_lamas_account.account_street,
85
+ @dalai_lamas_account.account_city,
86
+ @dalai_lamas_account.account_zip_code,
87
+ @dalai_lamas_account.bank_name,
88
+ @dalai_lamas_account.client_street,
89
+ @dalai_lamas_account.client_city,
90
+ @dalai_lamas_account.client_zip_code,
91
+ @dalai_lamas_account.bank_country_code,
92
+ @dalai_lamas_account.client_country_code
93
+ ), 220.25)
94
+
95
+ @dudes_dtazv_export.add(@fidel_castros_booking)
96
+ @dudes_dtazv_export.create_file
97
+ end
98
+
99
+ # the test account responds to everything
100
+ class TestKonto < OpenStruct; end
101
+
102
+ end
103
+
104
+ d = Dtazv.new
105
+ d.create_dtazv
data/spec/helper_spec.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  # encoding: utf-8
2
-
3
- require "#{File.dirname(__FILE__)}/spec_helper"
2
+ require 'spec_helper'
4
3
 
5
4
  describe KingDta::Helper do
6
5
  include KingDta::Helper
@@ -12,11 +11,11 @@ describe KingDta::Helper do
12
11
  it "should remove invalid chars" do
13
12
  convert_text('@()"=<>!§').should == ''
14
13
  end
15
-
14
+
16
15
  it "should leave valid chars" do
17
16
  convert_text('abc-ABC-0123- .,&/+*$%').should == 'ABC-ABC-0123- .,&/+*$%'
18
17
  end
19
-
18
+
20
19
  it "should convert umlaute" do
21
20
  convert_text('üöäÜÖÄß').should == 'UEOEAEUEOEAESS'
22
21
  end
data/spec/spec_helper.rb CHANGED
@@ -1,8 +1,21 @@
1
1
  # encoding: utf-8
2
+ $:.unshift(File.dirname(__FILE__))
3
+ $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
4
+
5
+ require 'simplecov'
6
+ SimpleCov.start 'rails'
7
+ SimpleCov.coverage_dir 'coverage/rspec'
8
+
2
9
  require 'rubygems'
10
+ require "king_dtaus"
11
+ require 'rspec'
3
12
  require 'ostruct'
4
13
  require 'date'
5
- require "#{File.dirname(__FILE__)}/../lib/king_dtaus"
14
+ require 'mocha'
15
+
16
+ RSpec.configure do |config|
17
+ end
18
+
6
19
 
7
20
  #Filename der eigenen Kontodaten
8
21
  # Beispiel:
@@ -21,21 +34,81 @@ require "#{File.dirname(__FILE__)}/../lib/king_dtaus"
21
34
  # bankstrasse:Kieselweg 3
22
35
  # bankplz:0815
23
36
  # bankort:Felsblock
37
+
38
+ def dudes_konto
39
+ opts = {
40
+ :account_number => '1326049634',
41
+ :bank_number => '37050299',
42
+ :bank_name => 'Kreissparkasse Köln',
43
+ :zweck => 'Monatsbeitrag',
44
+ :account_street => "Bank Eine Straße 2",
45
+ :account_city => "Bank Köln",
46
+ :account_zip_code => "51063",
47
+ :client_number => "",
48
+ :client_name =>'Jan Kus',
49
+ :client_street => "Meine Eine Straße 2",
50
+ :client_city => "Meine Köln",
51
+ :client_zip_code => "51063",
52
+ :bank_country_code => "DE",
53
+ :client_country_code => "DE"
54
+ }
55
+ TestKonto.new(opts)
56
+ end
57
+
58
+ def dalai_lamas_account
59
+ opts = {
60
+ :account_number => 'GR1601101250000000012300695',
61
+ :bank_number => 'MARKF1100',
62
+ :bank_name => 'Kuba National Bank',
63
+ :zweck => 'President-Fee',
64
+ :account_street => "5th avenue",
65
+ :account_city => "los angeles",
66
+ :account_zip_code => "55323",
67
+ :client_number => "",
68
+ :client_name =>'Fidel Castro',
69
+ :client_street => "Bush-Avenue 55",
70
+ :client_city => "Kuba",
71
+ :client_zip_code => "066600",
72
+ :client_zip_code => "445555",
73
+ :bank_country_code => "DE",
74
+ :client_country_code => "DE"
75
+ }
76
+ TestKonto.new(opts)
77
+ end
78
+
24
79
  def test_kto1
25
- opts = { :nr => '7828970037', :blz => '37040044', :name =>'Gimme your Money AG',
26
- :bank => 'Commerzbank Köln', :zweck => 'Monatsbeitrag' }
80
+ opts = {
81
+ :account_number => '7828970037',
82
+ :bank_number => '37040044',
83
+ :client_name =>'Gimme your Money AG',
84
+ :bank_name => 'Commerzbank Köln',
85
+ :zweck => 'Monatsbeitrag',
86
+ :client_number => ""
87
+ }
27
88
  TestKonto.new(opts)
28
89
  end
29
90
 
30
91
  def test_kto2
31
- opts = { :nr => '2787777', :blz => '37040044', :name =>'Peter & May GmbH',
32
- :bank => 'Commerzbank Köln', :zweck => 'Monatsbeitrag' }
92
+ opts = {
93
+ :account_number => '2787777',
94
+ :bank_number => '37040044',
95
+ :client_name =>'Peter & May GmbH',
96
+ :bank_name => 'Commerzbank Köln',
97
+ :zweck => 'Monatsbeitrag',
98
+ :client_number => ""
99
+ }
33
100
  TestKonto.new(opts)
34
101
  end
35
102
 
36
103
  def test_kto3
37
- opts = { :nr => '2787777', :blz => '37040044', :name =>'Andrew Müller',
38
- :bank => 'Commerzbank Köln', :zweck => 'Monatsbeitrag' }
104
+ opts = {
105
+ :account_number => '2787777',
106
+ :bank_number => '37040044',
107
+ :client_name =>'Andrew Müller',
108
+ :bank_name => 'Commerzbank Köln',
109
+ :zweck => 'Monatsbeitrag',
110
+ :client_number => ""
111
+ }
39
112
  TestKonto.new(opts)
40
113
  end
41
114
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: king_dtaus
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
5
- prerelease:
4
+ prerelease: true
6
5
  segments:
7
- - 1
8
- - 0
9
6
  - 2
10
- version: 1.0.2
7
+ - 0
8
+ - 0
9
+ - pre
10
+ version: 2.0.0.pre
11
11
  platform: ruby
12
12
  authors:
13
13
  - Georg Leciejewski
@@ -16,10 +16,74 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-02-10 00:00:00 +01:00
19
+ date: 2011-06-15 00:00:00 +02:00
20
20
  default_executable:
21
- dependencies: []
22
-
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
23
+ name: king_dtaus
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ segments:
30
+ - 0
31
+ version: "0"
32
+ type: :runtime
33
+ prerelease: false
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: rspec
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ segments:
43
+ - 0
44
+ version: "0"
45
+ type: :development
46
+ prerelease: false
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: jeweler
50
+ requirement: &id003 !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ segments:
56
+ - 0
57
+ version: "0"
58
+ type: :development
59
+ prerelease: false
60
+ version_requirements: *id003
61
+ - !ruby/object:Gem::Dependency
62
+ name: simplecov
63
+ requirement: &id004 !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ segments:
69
+ - 0
70
+ version: "0"
71
+ type: :development
72
+ prerelease: false
73
+ version_requirements: *id004
74
+ - !ruby/object:Gem::Dependency
75
+ name: mocha
76
+ requirement: &id005 !ruby/object:Gem::Requirement
77
+ none: false
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ segments:
82
+ - 0
83
+ version: "0"
84
+ type: :development
85
+ prerelease: false
86
+ version_requirements: *id005
23
87
  description: DTAUS is a text-based format, to create bank transfers for german banks. This gem helps with the creation of those transfer files.
24
88
  email: gl@salesking.eu
25
89
  executables: []
@@ -29,20 +93,31 @@ extensions: []
29
93
  extra_rdoc_files:
30
94
  - README.rdoc
31
95
  files:
96
+ - .rvmrc
97
+ - DTAUS0.TXT
98
+ - Gemfile
99
+ - Gemfile.lock
32
100
  - MIT-LICENSE
33
101
  - README.rdoc
34
102
  - Rakefile
35
103
  - VERSION
104
+ - docs/dtazv.pdf
105
+ - docs/dtazv_bank_bbk.pdf
106
+ - example.output
36
107
  - king_dtaus.gemspec
37
108
  - lib/king_dta/account.rb
38
109
  - lib/king_dta/booking.rb
110
+ - lib/king_dta/dta.rb
39
111
  - lib/king_dta/dtaus.rb
112
+ - lib/king_dta/dtazv.rb
40
113
  - lib/king_dta/exception.rb
41
114
  - lib/king_dta/helper.rb
42
115
  - lib/king_dtaus.rb
43
116
  - spec/account_spec.rb
44
117
  - spec/booking_spec.rb
45
118
  - spec/dtaus_spec.rb
119
+ - spec/dtazv_spec.rb
120
+ - spec/dtazv_test.rb
46
121
  - spec/helper_spec.rb
47
122
  - spec/spec_helper.rb
48
123
  has_rdoc: true
@@ -59,29 +134,25 @@ required_ruby_version: !ruby/object:Gem::Requirement
59
134
  requirements:
60
135
  - - ">="
61
136
  - !ruby/object:Gem::Version
62
- hash: 3
63
137
  segments:
64
138
  - 0
65
139
  version: "0"
66
140
  required_rubygems_version: !ruby/object:Gem::Requirement
67
141
  none: false
68
142
  requirements:
69
- - - ">="
143
+ - - ">"
70
144
  - !ruby/object:Gem::Version
71
- hash: 3
72
145
  segments:
73
- - 0
74
- version: "0"
146
+ - 1
147
+ - 3
148
+ - 1
149
+ version: 1.3.1
75
150
  requirements: []
76
151
 
77
152
  rubyforge_project:
78
- rubygems_version: 1.4.1
153
+ rubygems_version: 1.3.7
79
154
  signing_key:
80
155
  specification_version: 3
81
156
  summary: Generate DTAUS strings and files
82
- test_files:
83
- - spec/account_spec.rb
84
- - spec/booking_spec.rb
85
- - spec/dtaus_spec.rb
86
- - spec/helper_spec.rb
87
- - spec/spec_helper.rb
157
+ test_files: []
158
+