iif 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +7 -0
  2. data/.coveralls.yml +2 -0
  3. data/.gitignore +22 -0
  4. data/.rspec +3 -0
  5. data/.travis.yml +7 -0
  6. data/CHANGELOG.md +48 -0
  7. data/Gemfile +4 -0
  8. data/LICENSE.txt +22 -0
  9. data/README.md +189 -0
  10. data/Rakefile +6 -0
  11. data/bin/rake +16 -0
  12. data/config.ru +9 -0
  13. data/lib/riif.rb +6 -0
  14. data/lib/riif/dsl/accnt.rb +15 -0
  15. data/lib/riif/dsl/base.rb +51 -0
  16. data/lib/riif/dsl/bud.rb +14 -0
  17. data/lib/riif/dsl/ctype.rb +9 -0
  18. data/lib/riif/dsl/cust.rb +51 -0
  19. data/lib/riif/dsl/emp.rb +31 -0
  20. data/lib/riif/dsl/invitem.rb +32 -0
  21. data/lib/riif/dsl/invmemo.rb +9 -0
  22. data/lib/riif/dsl/klass.rb +9 -0
  23. data/lib/riif/dsl/othername.rb +25 -0
  24. data/lib/riif/dsl/paymeth.rb +9 -0
  25. data/lib/riif/dsl/shipmeth.rb +10 -0
  26. data/lib/riif/dsl/spl.rb +29 -0
  27. data/lib/riif/dsl/terms.rb +13 -0
  28. data/lib/riif/dsl/timeact.rb +17 -0
  29. data/lib/riif/dsl/timerhdr.rb +14 -0
  30. data/lib/riif/dsl/trns.rb +56 -0
  31. data/lib/riif/dsl/vend.rb +39 -0
  32. data/lib/riif/dsl/vtype.rb +9 -0
  33. data/lib/riif/iif.rb +60 -0
  34. data/lib/riif/rails/renderer.rb +15 -0
  35. data/lib/riif/rails/template_handler.rb +20 -0
  36. data/lib/riif/railtie.rb +17 -0
  37. data/lib/riif/version.rb +3 -0
  38. data/riif.gemspec +29 -0
  39. data/spec/controllers/invoices_controller_spec.rb +26 -0
  40. data/spec/fixtures/accnt.iif +2 -0
  41. data/spec/fixtures/bud.iif +2 -0
  42. data/spec/fixtures/ctype.iif +2 -0
  43. data/spec/fixtures/cust.iif +2 -0
  44. data/spec/fixtures/emp.iif +2 -0
  45. data/spec/fixtures/invitem.iif +2 -0
  46. data/spec/fixtures/invmemo.iif +2 -0
  47. data/spec/fixtures/klass.iif +2 -0
  48. data/spec/fixtures/mixed.iif +13 -0
  49. data/spec/fixtures/othername.iif +2 -0
  50. data/spec/fixtures/paymeth.iif +2 -0
  51. data/spec/fixtures/rails/invoices.iif +6 -0
  52. data/spec/fixtures/shipmeth.iif +2 -0
  53. data/spec/fixtures/terms.iif +2 -0
  54. data/spec/fixtures/timeact.iif +4 -0
  55. data/spec/fixtures/trns.iif +7 -0
  56. data/spec/fixtures/vend.iif +2 -0
  57. data/spec/fixtures/vtype.iif +2 -0
  58. data/spec/internal/app/controllers/invoices_controller.rb +10 -0
  59. data/spec/internal/app/views/invoices/index.iif.riif +27 -0
  60. data/spec/internal/config/database.yml +3 -0
  61. data/spec/internal/config/routes.rb +3 -0
  62. data/spec/internal/db/schema.rb +3 -0
  63. data/spec/internal/log/.gitignore +1 -0
  64. data/spec/internal/public/favicon.ico +0 -0
  65. data/spec/riif/dsl/accnt_spec.rb +22 -0
  66. data/spec/riif/dsl/bud_spec.rb +28 -0
  67. data/spec/riif/dsl/ctype_spec.rb +19 -0
  68. data/spec/riif/dsl/cust_spec.rb +20 -0
  69. data/spec/riif/dsl/emp_spec.rb +24 -0
  70. data/spec/riif/dsl/invitem_spec.rb +21 -0
  71. data/spec/riif/dsl/invmemo_spec.rb +19 -0
  72. data/spec/riif/dsl/klass_spec.rb +20 -0
  73. data/spec/riif/dsl/othername_spec.rb +23 -0
  74. data/spec/riif/dsl/paymeth_spec.rb +19 -0
  75. data/spec/riif/dsl/shipmeth_spec.rb +19 -0
  76. data/spec/riif/dsl/terms_spec.rb +23 -0
  77. data/spec/riif/dsl/timeact_spec.rb +35 -0
  78. data/spec/riif/dsl/trns_spec.rb +54 -0
  79. data/spec/riif/dsl/vend_spec.rb +21 -0
  80. data/spec/riif/dsl/vtype_spec.rb +19 -0
  81. data/spec/riif/iif_spec.rb +61 -0
  82. data/spec/spec_helper.rb +21 -0
  83. metadata +295 -0
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe Riif::DSL::Paymeth do
4
+ let(:expected) { File.read('spec/fixtures/paymeth.iif') }
5
+
6
+ let(:paymeth) {
7
+ Riif::IIF.new do
8
+ paymeth do
9
+ row do
10
+ name 'paymeth 1'
11
+ end
12
+ end
13
+ end
14
+ }
15
+
16
+ subject { paymeth }
17
+
18
+ its(:output) { should eq expected }
19
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe Riif::DSL::Shipmeth do
4
+ let(:expected) { File.read('spec/fixtures/shipmeth.iif') }
5
+
6
+ let(:shipmeth) {
7
+ Riif::IIF.new do
8
+ shipmeth do
9
+ row do
10
+ name 'shipmeth 1'
11
+ end
12
+ end
13
+ end
14
+ }
15
+
16
+ subject { shipmeth }
17
+
18
+ its(:output) { should eq expected }
19
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe Riif::DSL::Terms do
4
+ let(:expected) { File.read('spec/fixtures/terms.iif') }
5
+
6
+ let(:terms) {
7
+ Riif::IIF.new do
8
+ terms do
9
+ row do
10
+ name 'terms 1'
11
+ duedays 10
12
+ discper 0.3
13
+ discdays 1
14
+ termstype 0
15
+ end
16
+ end
17
+ end
18
+ }
19
+
20
+ subject { terms }
21
+
22
+ its(:output) { should eq expected }
23
+ end
@@ -0,0 +1,35 @@
1
+ require 'spec_helper'
2
+
3
+ describe Riif::DSL::Timeact do
4
+ let(:expected) { File.read('spec/fixtures/timeact.iif') }
5
+
6
+ let(:timeact) {
7
+ Riif::IIF.new do
8
+ timerhdr do
9
+ row do
10
+ ver 8
11
+ rel 0
12
+ companyname 'Import Test Company'
13
+ importedbefore 'N'
14
+ fromtimer 'Y'
15
+ companycreatetime '1208544781'
16
+ end
17
+ end
18
+ timeact do
19
+ row do
20
+ date '06/21/97'
21
+ job 'job 1'
22
+ emp 'Jun'
23
+ item 'item 1'
24
+ duration '13:40'
25
+ proj 'klass 1'
26
+ billingstatus 0
27
+ end
28
+ end
29
+ end
30
+ }
31
+
32
+ subject { timeact }
33
+
34
+ its(:output) { should eq expected }
35
+ end
@@ -0,0 +1,54 @@
1
+ require 'spec_helper'
2
+
3
+ describe Riif::DSL::Trns do
4
+
5
+ let(:expected) { File.read('spec/fixtures/trns.iif') }
6
+
7
+ let(:trns) {
8
+ Riif::IIF.new do
9
+ trns do
10
+ row do
11
+ trnsid 123
12
+ trnstype 'INVOICE'
13
+ date '8/31/1988'
14
+ accnt 'Accounts Receivable'
15
+ name 'Customer'
16
+ amount 20
17
+ docnum 1
18
+ clear 'N'
19
+ toprint 'N'
20
+ addr1 'Baker'
21
+ addr2 'Customer'
22
+ saddr1 'Watson'
23
+ saddr2 'Recipient'
24
+ rep 'BOB'
25
+ end
26
+
27
+ spl do
28
+ row do
29
+ splid '777'
30
+ trnstype 'INVOICE'
31
+ date '8/31/1988'
32
+ accnt 'Income Account'
33
+ amount '-20'
34
+ clear 'N'
35
+ qnty '-2'
36
+ price 10
37
+ invitem 'Sales Item'
38
+ taxable 'N'
39
+ end
40
+ end
41
+
42
+ spl do
43
+ row do
44
+ splid '888'
45
+ end
46
+ end
47
+ end
48
+ end
49
+ }
50
+
51
+ subject { trns }
52
+
53
+ its(:output) { should eq expected }
54
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe Riif::DSL::Vend do
4
+ let(:expected) { File.read('spec/fixtures/vend.iif') }
5
+
6
+ let(:vend) {
7
+ Riif::IIF.new do
8
+ vend do
9
+ row do
10
+ name 'Jun Lin'
11
+ phone1 '12312323242'
12
+ _1099 'Y'
13
+ end
14
+ end
15
+ end
16
+ }
17
+
18
+ subject { vend }
19
+
20
+ its(:output) { should eq expected }
21
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe Riif::DSL::Vtype do
4
+ let(:expected) { File.read('spec/fixtures/vtype.iif') }
5
+
6
+ let(:vtype) {
7
+ Riif::IIF.new do
8
+ vtype do
9
+ row do
10
+ name 'vtype 1'
11
+ end
12
+ end
13
+ end
14
+ }
15
+
16
+ subject { vtype }
17
+
18
+ its(:output) { should eq expected }
19
+ end
@@ -0,0 +1,61 @@
1
+ require 'spec_helper'
2
+
3
+ describe Riif::IIF do
4
+
5
+ context 'mixed document' do
6
+ let(:expected) { File.read('spec/fixtures/mixed.iif') }
7
+
8
+ let(:mixed) {
9
+ Riif::IIF.new do
10
+ cust do
11
+ row do
12
+ name 'Batman'
13
+ baddr1 'Amoy'
14
+ end
15
+ end
16
+
17
+ bud do
18
+ row do
19
+ accnt 'Accounts Receivable'
20
+ period 'MONTH'
21
+ amount 'foo'
22
+ startdate '3/14/12'
23
+ end
24
+ row do
25
+ accnt 'Accounts Payable'
26
+ period 'MONTH'
27
+ amount '123'
28
+ startdate '3/15/12'
29
+ end
30
+ end
31
+
32
+ trns do
33
+ row do
34
+ trnsid 'foo'
35
+ end
36
+ spl do
37
+ row do
38
+ splid 'joker'
39
+ end
40
+ end
41
+ spl do
42
+ row do
43
+ splid 'foobar'
44
+ end
45
+ end
46
+ end
47
+
48
+ cust do
49
+ row do
50
+ name 'Joker'
51
+ baddr1 'Amoy'
52
+ end
53
+ end
54
+ end
55
+ }
56
+
57
+ subject { mixed }
58
+
59
+ its(:output) { should eq expected }
60
+ end
61
+ end
@@ -0,0 +1,21 @@
1
+ require 'bundler'
2
+ Bundler.require(:development)
3
+
4
+ require 'coveralls'
5
+ Coveralls.wear!
6
+
7
+ require 'riif'
8
+
9
+ # This line has to before require 'rspec/rails'
10
+ Combustion.initialize! :action_controller, :action_view
11
+
12
+ require 'rspec/rails'
13
+
14
+ RSpec.configure do |config|
15
+ config.expect_with(:rspec) { |c| c.syntax = :should }
16
+ config.infer_spec_type_from_file_location!
17
+ config.run_all_when_everything_filtered = true
18
+ config.filter_run :focus
19
+ config.order = 'random'
20
+ config.infer_spec_type_from_file_location!
21
+ end
metadata ADDED
@@ -0,0 +1,295 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: iif
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.6.1
5
+ platform: ruby
6
+ authors:
7
+ - Jun Lin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-05-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pry
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '5.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '5.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.5'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.5'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.5'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec-its
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.2'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.2'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rails-controller-testing
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: combustion
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.3.1
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.3.1
111
+ - !ruby/object:Gem::Dependency
112
+ name: fuubar
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: coveralls
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ description: Clone of riif gem with latest updates
140
+ email:
141
+ - linjunpop@gmail.com
142
+ executables:
143
+ - rake
144
+ extensions: []
145
+ extra_rdoc_files: []
146
+ files:
147
+ - ".coveralls.yml"
148
+ - ".gitignore"
149
+ - ".rspec"
150
+ - ".travis.yml"
151
+ - CHANGELOG.md
152
+ - Gemfile
153
+ - LICENSE.txt
154
+ - README.md
155
+ - Rakefile
156
+ - bin/rake
157
+ - config.ru
158
+ - lib/riif.rb
159
+ - lib/riif/dsl/accnt.rb
160
+ - lib/riif/dsl/base.rb
161
+ - lib/riif/dsl/bud.rb
162
+ - lib/riif/dsl/ctype.rb
163
+ - lib/riif/dsl/cust.rb
164
+ - lib/riif/dsl/emp.rb
165
+ - lib/riif/dsl/invitem.rb
166
+ - lib/riif/dsl/invmemo.rb
167
+ - lib/riif/dsl/klass.rb
168
+ - lib/riif/dsl/othername.rb
169
+ - lib/riif/dsl/paymeth.rb
170
+ - lib/riif/dsl/shipmeth.rb
171
+ - lib/riif/dsl/spl.rb
172
+ - lib/riif/dsl/terms.rb
173
+ - lib/riif/dsl/timeact.rb
174
+ - lib/riif/dsl/timerhdr.rb
175
+ - lib/riif/dsl/trns.rb
176
+ - lib/riif/dsl/vend.rb
177
+ - lib/riif/dsl/vtype.rb
178
+ - lib/riif/iif.rb
179
+ - lib/riif/rails/renderer.rb
180
+ - lib/riif/rails/template_handler.rb
181
+ - lib/riif/railtie.rb
182
+ - lib/riif/version.rb
183
+ - riif.gemspec
184
+ - spec/controllers/invoices_controller_spec.rb
185
+ - spec/fixtures/accnt.iif
186
+ - spec/fixtures/bud.iif
187
+ - spec/fixtures/ctype.iif
188
+ - spec/fixtures/cust.iif
189
+ - spec/fixtures/emp.iif
190
+ - spec/fixtures/invitem.iif
191
+ - spec/fixtures/invmemo.iif
192
+ - spec/fixtures/klass.iif
193
+ - spec/fixtures/mixed.iif
194
+ - spec/fixtures/othername.iif
195
+ - spec/fixtures/paymeth.iif
196
+ - spec/fixtures/rails/invoices.iif
197
+ - spec/fixtures/shipmeth.iif
198
+ - spec/fixtures/terms.iif
199
+ - spec/fixtures/timeact.iif
200
+ - spec/fixtures/trns.iif
201
+ - spec/fixtures/vend.iif
202
+ - spec/fixtures/vtype.iif
203
+ - spec/internal/app/controllers/invoices_controller.rb
204
+ - spec/internal/app/views/invoices/index.iif.riif
205
+ - spec/internal/config/database.yml
206
+ - spec/internal/config/routes.rb
207
+ - spec/internal/db/schema.rb
208
+ - spec/internal/log/.gitignore
209
+ - spec/internal/public/favicon.ico
210
+ - spec/riif/dsl/accnt_spec.rb
211
+ - spec/riif/dsl/bud_spec.rb
212
+ - spec/riif/dsl/ctype_spec.rb
213
+ - spec/riif/dsl/cust_spec.rb
214
+ - spec/riif/dsl/emp_spec.rb
215
+ - spec/riif/dsl/invitem_spec.rb
216
+ - spec/riif/dsl/invmemo_spec.rb
217
+ - spec/riif/dsl/klass_spec.rb
218
+ - spec/riif/dsl/othername_spec.rb
219
+ - spec/riif/dsl/paymeth_spec.rb
220
+ - spec/riif/dsl/shipmeth_spec.rb
221
+ - spec/riif/dsl/terms_spec.rb
222
+ - spec/riif/dsl/timeact_spec.rb
223
+ - spec/riif/dsl/trns_spec.rb
224
+ - spec/riif/dsl/vend_spec.rb
225
+ - spec/riif/dsl/vtype_spec.rb
226
+ - spec/riif/iif_spec.rb
227
+ - spec/spec_helper.rb
228
+ homepage: https://github.com/linjunpop/riif
229
+ licenses: []
230
+ metadata: {}
231
+ post_install_message:
232
+ rdoc_options: []
233
+ require_paths:
234
+ - lib
235
+ required_ruby_version: !ruby/object:Gem::Requirement
236
+ requirements:
237
+ - - ">="
238
+ - !ruby/object:Gem::Version
239
+ version: '0'
240
+ required_rubygems_version: !ruby/object:Gem::Requirement
241
+ requirements:
242
+ - - ">="
243
+ - !ruby/object:Gem::Version
244
+ version: '0'
245
+ requirements: []
246
+ rubyforge_project:
247
+ rubygems_version: 2.6.11
248
+ signing_key:
249
+ specification_version: 4
250
+ summary: As soon as riif > 0.6.0 is released, stop using this
251
+ test_files:
252
+ - spec/controllers/invoices_controller_spec.rb
253
+ - spec/fixtures/accnt.iif
254
+ - spec/fixtures/bud.iif
255
+ - spec/fixtures/ctype.iif
256
+ - spec/fixtures/cust.iif
257
+ - spec/fixtures/emp.iif
258
+ - spec/fixtures/invitem.iif
259
+ - spec/fixtures/invmemo.iif
260
+ - spec/fixtures/klass.iif
261
+ - spec/fixtures/mixed.iif
262
+ - spec/fixtures/othername.iif
263
+ - spec/fixtures/paymeth.iif
264
+ - spec/fixtures/rails/invoices.iif
265
+ - spec/fixtures/shipmeth.iif
266
+ - spec/fixtures/terms.iif
267
+ - spec/fixtures/timeact.iif
268
+ - spec/fixtures/trns.iif
269
+ - spec/fixtures/vend.iif
270
+ - spec/fixtures/vtype.iif
271
+ - spec/internal/app/controllers/invoices_controller.rb
272
+ - spec/internal/app/views/invoices/index.iif.riif
273
+ - spec/internal/config/database.yml
274
+ - spec/internal/config/routes.rb
275
+ - spec/internal/db/schema.rb
276
+ - spec/internal/log/.gitignore
277
+ - spec/internal/public/favicon.ico
278
+ - spec/riif/dsl/accnt_spec.rb
279
+ - spec/riif/dsl/bud_spec.rb
280
+ - spec/riif/dsl/ctype_spec.rb
281
+ - spec/riif/dsl/cust_spec.rb
282
+ - spec/riif/dsl/emp_spec.rb
283
+ - spec/riif/dsl/invitem_spec.rb
284
+ - spec/riif/dsl/invmemo_spec.rb
285
+ - spec/riif/dsl/klass_spec.rb
286
+ - spec/riif/dsl/othername_spec.rb
287
+ - spec/riif/dsl/paymeth_spec.rb
288
+ - spec/riif/dsl/shipmeth_spec.rb
289
+ - spec/riif/dsl/terms_spec.rb
290
+ - spec/riif/dsl/timeact_spec.rb
291
+ - spec/riif/dsl/trns_spec.rb
292
+ - spec/riif/dsl/vend_spec.rb
293
+ - spec/riif/dsl/vtype_spec.rb
294
+ - spec/riif/iif_spec.rb
295
+ - spec/spec_helper.rb