riif 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/.tool-versions +1 -0
- data/.travis.yml +4 -6
- data/CHANGELOG.md +5 -0
- data/LICENSE.txt +1 -1
- data/README.md +4 -5
- data/bin/rake +16 -0
- data/lib/riif.rb +5 -1
- data/lib/riif/dsl/base.rb +3 -0
- data/lib/riif/dsl/vend.rb +1 -1
- data/lib/riif/rails/renderer.rb +1 -1
- data/lib/riif/rails/template_handler.rb +1 -1
- data/lib/riif/version.rb +1 -1
- data/riif.gemspec +5 -4
- data/spec/fixtures/rails/invoices.iif +1 -1
- data/spec/fixtures/timeact.iif +1 -1
- data/spec/fixtures/trns.iif +1 -1
- data/spec/fixtures/vend.iif +1 -1
- data/spec/internal/app/controllers/invoices_controller.rb +4 -1
- data/spec/internal/app/views/invoices/index.iif.riif +1 -1
- data/spec/riif/dsl/timeact_spec.rb +1 -1
- data/spec/riif/dsl/trns_spec.rb +1 -0
- data/spec/spec_helper.rb +3 -1
- metadata +54 -61
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6d39578438343ae050542e1b4e27e7640aaa9775
|
4
|
+
data.tar.gz: 8f3a87719dc4091ed695c055d38a57c4111144b5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 118a854025d2d6ea66f1938285d7f226f8e8b94e61f72c0f857f6f35f7b6931c80eccb619f0931fe1caf94b9cb7ad502a89cd73fdc3bf7f0ef97cc82b48a114c
|
7
|
+
data.tar.gz: b64dc3dfea5bfdad37993f38e36469927798f294d2f2f5825974427dc1710d97aeaa8809e037d2c5d51ffef9bdee6481d13e92152b334c14f4f451b572e83e00
|
data/.gitignore
CHANGED
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 2.4.3
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
## NEXT (unreleased)
|
4
4
|
|
5
|
+
## 0.7.0
|
6
|
+
|
7
|
+
* #34 Resolved issues on Rails 2. [@newmedio](https://github.com/newmedio)
|
8
|
+
* #34 Fixes class & 1099 issues. [@newmedio](https://github.com/newmedio)
|
9
|
+
|
5
10
|
## 0.6.0
|
6
11
|
|
7
12
|
* #10 Add option to pass an argument to `Riif.new`. [@ghiculescu](https://github.com/ghiculescu)
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -2,11 +2,10 @@
|
|
2
2
|
|
3
3
|
A simple DSL to generate IIF file.
|
4
4
|
|
5
|
-
[![Build Status](https://travis-ci.org/linjunpop/riif.
|
6
|
-
[![Gem Version](https://badge.fury.io/rb/riif.
|
7
|
-
[![Code Climate](https://codeclimate.com/github/linjunpop/riif.
|
8
|
-
[![Coverage Status](https://coveralls.io/repos/linjunpop/riif/badge.
|
9
|
-
[![endorse](http://api.coderwall.com/linjunpop/endorsecount.png)](http://coderwall.com/linjunpop)
|
5
|
+
[![Build Status](https://travis-ci.org/linjunpop/riif.svg?branch=master)](https://travis-ci.org/linjunpop/riif)
|
6
|
+
[![Gem Version](https://badge.fury.io/rb/riif.svg)](http://badge.fury.io/rb/riif)
|
7
|
+
[![Code Climate](https://codeclimate.com/github/linjunpop/riif.svg)](https://codeclimate.com/github/linjunpop/riif)
|
8
|
+
[![Coverage Status](https://coveralls.io/repos/linjunpop/riif/badge.svg?branch=master)](https://coveralls.io/r/linjunpop/riif)
|
10
9
|
|
11
10
|
## Installation
|
12
11
|
|
data/bin/rake
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'rake' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('rake', 'rake')
|
data/lib/riif.rb
CHANGED
data/lib/riif/dsl/base.rb
CHANGED
@@ -41,6 +41,9 @@ module Riif::DSL
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def method_missing(method_name, *args, &block)
|
44
|
+
method_name = :class if method_name == :klass
|
45
|
+
method_name = "1099".to_sym if method_name == :_1099
|
46
|
+
|
44
47
|
if self.class::HEADER_COLUMNS.include?(method_name)
|
45
48
|
@current_row[self.class::HEADER_COLUMNS.index(method_name) + 1] = args[0]
|
46
49
|
else
|
data/lib/riif/dsl/vend.rb
CHANGED
data/lib/riif/rails/renderer.rb
CHANGED
data/lib/riif/version.rb
CHANGED
data/riif.gemspec
CHANGED
@@ -18,10 +18,11 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.require_paths = ["lib"]
|
19
19
|
|
20
20
|
gem.add_development_dependency 'pry'
|
21
|
-
gem.add_development_dependency 'rails'
|
22
|
-
gem.add_development_dependency 'rspec'
|
23
|
-
gem.add_development_dependency 'rspec-rails'
|
24
|
-
gem.add_development_dependency '
|
21
|
+
gem.add_development_dependency 'rails', '~> 5.0'
|
22
|
+
gem.add_development_dependency 'rspec', '~> 3.5'
|
23
|
+
gem.add_development_dependency 'rspec-rails', '~> 3.5'
|
24
|
+
gem.add_development_dependency 'rspec-its', '~> 1.2'
|
25
|
+
gem.add_development_dependency 'rails-controller-testing', '~> 1.0'
|
25
26
|
gem.add_development_dependency 'combustion', '~> 0.3.1'
|
26
27
|
gem.add_development_dependency 'fuubar'
|
27
28
|
gem.add_development_dependency 'coveralls'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
!TRNS TRNSID TRNSTYPE DATE ACCNT NAME CLASS AMOUNT DOCNUM MEMO CLEAR TOPRINT ADDR1 ADDR2 ADDR3 ADDR4 ADDR5 SADDR1 SADDR2 SADDR3 SADDR4 SADDR5 DUEDATE TERMS PAID PAYMETH SHIPDATE REP PONUM INVTITLE INVMEMO
|
2
2
|
!SPL SPLID TRNSTYPE DATE ACCNT NAME CLASS AMOUNT DOCNUM MEMO CLEAR QNTY PRICE INVITEM PAYMETH TAXABLE REIMBEXP EXTRA
|
3
3
|
!ENDTRNS
|
4
|
-
TRNS 12345 BILL 3/14/1984 Accounts Payable
|
4
|
+
TRNS 12345 BILL 3/14/1984 Accounts Payable Bender -300 12345 N
|
5
5
|
SPL 1 BILL 3/14/1984 Payable CMA 300 foo 3 150 Base Rate
|
6
6
|
ENDTRNS
|
data/spec/fixtures/timeact.iif
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
!TIMERHDR VER REL COMPANYNAME IMPORTEDBEFORE FROMTIMER COMPANYCREATETIME
|
2
2
|
TIMERHDR 8 0 Import Test Company N Y 1208544781
|
3
3
|
!TIMEACT DATE JOB EMP ITEM PITEM DURATION PROJ NOTE BILLINGSTATUS
|
4
|
-
TIMEACT 06/21/97 job 1 Jun item 1 13:40
|
4
|
+
TIMEACT 06/21/97 job 1 Jun item 1 13:40 class 1 0
|
data/spec/fixtures/trns.iif
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
!TRNS TRNSID TRNSTYPE DATE ACCNT NAME CLASS AMOUNT DOCNUM MEMO CLEAR TOPRINT ADDR1 ADDR2 ADDR3 ADDR4 ADDR5 SADDR1 SADDR2 SADDR3 SADDR4 SADDR5 DUEDATE TERMS PAID PAYMETH SHIPDATE REP PONUM INVTITLE INVMEMO
|
2
2
|
!SPL SPLID TRNSTYPE DATE ACCNT NAME CLASS AMOUNT DOCNUM MEMO CLEAR QNTY PRICE INVITEM PAYMETH TAXABLE REIMBEXP EXTRA
|
3
3
|
!ENDTRNS
|
4
|
-
TRNS 123 INVOICE 8/31/1988 Accounts Receivable Customer
|
4
|
+
TRNS 123 INVOICE 8/31/1988 Accounts Receivable Customer foobar 20 1 N N Baker Customer Watson Recipient BOB
|
5
5
|
SPL 777 INVOICE 8/31/1988 Income Account -20 N -2 10 Sales Item N
|
6
6
|
SPL 888
|
7
7
|
ENDTRNS
|
data/spec/fixtures/vend.iif
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
!VEND NAME PRINTAS ADDR1 ADDR2 ADDR3 ADDR4 ADDR5 VTYPE CONT1 PHONE1 PHONE2 FAXNUM NOTE TAXID LIMIT TERMS NOTEPAD SALUTATION COMPANYNAME FIRSTNAME MIDINIT LASTNAME CUSTFLD1 CUSTFLD2 CUSTFLD3 CUSTFLD4 CUSTFLD5 CUSTFLD6 CUSTFLD7
|
1
|
+
!VEND NAME PRINTAS ADDR1 ADDR2 ADDR3 ADDR4 ADDR5 VTYPE CONT1 PHONE1 PHONE2 FAXNUM NOTE TAXID LIMIT TERMS NOTEPAD SALUTATION COMPANYNAME FIRSTNAME MIDINIT LASTNAME CUSTFLD1 CUSTFLD2 CUSTFLD3 CUSTFLD4 CUSTFLD5 CUSTFLD6 CUSTFLD7 1099 NOTE
|
2
2
|
VEND Jun Lin 12312323242 Y
|
@@ -1,7 +1,10 @@
|
|
1
1
|
class InvoicesController < ActionController::Base
|
2
2
|
def index
|
3
3
|
respond_to do |format|
|
4
|
-
format.iif {
|
4
|
+
format.iif {
|
5
|
+
render iif: render_to_string(locals: {awesome: "Bender"}),
|
6
|
+
filename: 'batman'
|
7
|
+
}
|
5
8
|
end
|
6
9
|
end
|
7
10
|
end
|
data/spec/riif/dsl/trns_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -12,8 +12,10 @@ Combustion.initialize! :action_controller, :action_view
|
|
12
12
|
require 'rspec/rails'
|
13
13
|
|
14
14
|
RSpec.configure do |config|
|
15
|
-
config.
|
15
|
+
config.expect_with(:rspec) { |c| c.syntax = :should }
|
16
|
+
config.infer_spec_type_from_file_location!
|
16
17
|
config.run_all_when_everything_filtered = true
|
17
18
|
config.filter_run :focus
|
18
19
|
config.order = 'random'
|
20
|
+
config.infer_spec_type_from_file_location!
|
19
21
|
end
|
metadata
CHANGED
@@ -1,160 +1,160 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riif
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.7.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jun Lin
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2018-01-23 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: pry
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rails
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
33
|
+
version: '5.0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
40
|
+
version: '5.0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rspec
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
47
|
+
version: '3.5'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
54
|
+
version: '3.5'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: rspec-rails
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - "~>"
|
68
60
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
61
|
+
version: '3.5'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - "~>"
|
76
67
|
- !ruby/object:Gem::Version
|
77
|
-
version: '
|
68
|
+
version: '3.5'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
|
-
name:
|
70
|
+
name: rspec-its
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - "~>"
|
84
74
|
- !ruby/object:Gem::Version
|
85
|
-
version: '
|
75
|
+
version: '1.2'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - "~>"
|
92
81
|
- !ruby/object:Gem::Version
|
93
|
-
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'
|
94
97
|
- !ruby/object:Gem::Dependency
|
95
98
|
name: combustion
|
96
99
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
100
|
requirements:
|
99
|
-
- - ~>
|
101
|
+
- - "~>"
|
100
102
|
- !ruby/object:Gem::Version
|
101
103
|
version: 0.3.1
|
102
104
|
type: :development
|
103
105
|
prerelease: false
|
104
106
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
107
|
requirements:
|
107
|
-
- - ~>
|
108
|
+
- - "~>"
|
108
109
|
- !ruby/object:Gem::Version
|
109
110
|
version: 0.3.1
|
110
111
|
- !ruby/object:Gem::Dependency
|
111
112
|
name: fuubar
|
112
113
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
121
|
requirements:
|
123
|
-
- -
|
122
|
+
- - ">="
|
124
123
|
- !ruby/object:Gem::Version
|
125
124
|
version: '0'
|
126
125
|
- !ruby/object:Gem::Dependency
|
127
126
|
name: coveralls
|
128
127
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
128
|
requirements:
|
131
|
-
- -
|
129
|
+
- - ">="
|
132
130
|
- !ruby/object:Gem::Version
|
133
131
|
version: '0'
|
134
132
|
type: :development
|
135
133
|
prerelease: false
|
136
134
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
135
|
requirements:
|
139
|
-
- -
|
136
|
+
- - ">="
|
140
137
|
- !ruby/object:Gem::Version
|
141
138
|
version: '0'
|
142
139
|
description: A simple DSL to generate QuickBooks IIF file
|
143
140
|
email:
|
144
141
|
- linjunpop@gmail.com
|
145
|
-
executables:
|
142
|
+
executables:
|
143
|
+
- rake
|
146
144
|
extensions: []
|
147
145
|
extra_rdoc_files: []
|
148
146
|
files:
|
149
|
-
- .coveralls.yml
|
150
|
-
- .gitignore
|
151
|
-
- .rspec
|
152
|
-
- .
|
147
|
+
- ".coveralls.yml"
|
148
|
+
- ".gitignore"
|
149
|
+
- ".rspec"
|
150
|
+
- ".tool-versions"
|
151
|
+
- ".travis.yml"
|
153
152
|
- CHANGELOG.md
|
154
153
|
- Gemfile
|
155
154
|
- LICENSE.txt
|
156
155
|
- README.md
|
157
156
|
- Rakefile
|
157
|
+
- bin/rake
|
158
158
|
- config.ru
|
159
159
|
- lib/riif.rb
|
160
160
|
- lib/riif/dsl/accnt.rb
|
@@ -228,33 +228,26 @@ files:
|
|
228
228
|
- spec/spec_helper.rb
|
229
229
|
homepage: https://github.com/linjunpop/riif
|
230
230
|
licenses: []
|
231
|
+
metadata: {}
|
231
232
|
post_install_message:
|
232
233
|
rdoc_options: []
|
233
234
|
require_paths:
|
234
235
|
- lib
|
235
236
|
required_ruby_version: !ruby/object:Gem::Requirement
|
236
|
-
none: false
|
237
237
|
requirements:
|
238
|
-
- -
|
238
|
+
- - ">="
|
239
239
|
- !ruby/object:Gem::Version
|
240
240
|
version: '0'
|
241
|
-
segments:
|
242
|
-
- 0
|
243
|
-
hash: -2664562977683222870
|
244
241
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
245
|
-
none: false
|
246
242
|
requirements:
|
247
|
-
- -
|
243
|
+
- - ">="
|
248
244
|
- !ruby/object:Gem::Version
|
249
245
|
version: '0'
|
250
|
-
segments:
|
251
|
-
- 0
|
252
|
-
hash: -2664562977683222870
|
253
246
|
requirements: []
|
254
247
|
rubyforge_project:
|
255
|
-
rubygems_version:
|
248
|
+
rubygems_version: 2.6.14
|
256
249
|
signing_key:
|
257
|
-
specification_version:
|
250
|
+
specification_version: 4
|
258
251
|
summary: A simple DSL to generate QuickBooks IIF file
|
259
252
|
test_files:
|
260
253
|
- spec/controllers/invoices_controller_spec.rb
|