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 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
@@ -3,6 +3,7 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
+ .rbenv-gemsets
6
7
  Gemfile.lock
7
8
  InstalledFiles
8
9
  _yardoc
@@ -19,3 +20,5 @@ tmp
19
20
  spec/dummy/log/*.log
20
21
  spec/dummy/tmp/
21
22
  spec/dummy/.sass-cache
23
+
24
+ .vscode
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 2.4.3
data/.travis.yml CHANGED
@@ -1,9 +1,7 @@
1
1
  language: ruby
2
2
  script: "bundle exec rspec spec"
3
3
  rvm:
4
- - 1.9.3
5
- - 1.9.2
6
- - rbx-19mode
7
- - jruby-19mode
8
- - 2.0.0
9
- - ruby-head
4
+ - 2.2.9
5
+ - 2.3.6
6
+ - 2.4.3
7
+ - 2.5.0
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
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013 Jun Lin
1
+ Copyright (c) 2012-2018 Jun Lin
2
2
 
3
3
  MIT License
4
4
 
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.png?branch=master)](https://travis-ci.org/linjunpop/riif)
6
- [![Gem Version](https://badge.fury.io/rb/riif.png)](http://badge.fury.io/rb/riif)
7
- [![Code Climate](https://codeclimate.com/github/linjunpop/riif.png)](https://codeclimate.com/github/linjunpop/riif)
8
- [![Coverage Status](https://coveralls.io/repos/linjunpop/riif/badge.png?branch=master)](https://coveralls.io/r/linjunpop/riif)
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
@@ -1,6 +1,10 @@
1
1
  require 'riif/version'
2
2
  require 'riif/iif'
3
- require 'riif/railtie' if defined?(Rails)
3
+ if defined?(Rails)
4
+ if Rails::VERSION::MAJOR > 2
5
+ require 'riif/railtie'
6
+ end
7
+ end
4
8
 
5
9
  module Riif
6
10
  end
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
@@ -30,7 +30,7 @@ module Riif::DSL
30
30
  :custfld5,
31
31
  :custfld6,
32
32
  :custfld7,
33
- :_1099,
33
+ :"1099",
34
34
  :note
35
35
  ]
36
36
  START_COLUMN = 'VEND'
@@ -6,7 +6,7 @@ module Riif
6
6
  send_data(
7
7
  iif_string,
8
8
  filename: "#{filename}.iif",
9
- type: Mime::IIF,
9
+ type: Mime[:iif],
10
10
  disposition: 'attachment'
11
11
  )
12
12
  end
@@ -2,7 +2,7 @@ module Riif
2
2
  module Rails
3
3
  class TemplateHandler
4
4
  cattr_accessor :default_format
5
- self.default_format = Mime::IIF
5
+ self.default_format = Mime[:iif]
6
6
 
7
7
  def self.call(template)
8
8
  <<-RUBY
data/lib/riif/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Riif
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
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 'awesome_print'
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 EZ -300 12345 N
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
@@ -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 klass 1 0
4
+ TIMEACT 06/21/97 job 1 Jun item 1 13:40 class 1 0
@@ -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 20 1 N N Baker Customer Watson Recipient BOB
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
@@ -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 _1099 NOTE
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 { render iif: render_to_string, filename: 'batman'}
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
@@ -4,7 +4,7 @@ iif.trns do
4
4
  trnstype 'BILL'
5
5
  date '3/14/1984'
6
6
  accnt 'Accounts Payable'
7
- name 'EZ'
7
+ name awesome
8
8
  amount -300
9
9
  docnum 12345
10
10
  clear 'N'
@@ -22,7 +22,7 @@ describe Riif::DSL::Timeact do
22
22
  emp 'Jun'
23
23
  item 'item 1'
24
24
  duration '13:40'
25
- proj 'klass 1'
25
+ proj 'class 1'
26
26
  billingstatus 0
27
27
  end
28
28
  end
@@ -16,6 +16,7 @@ describe Riif::DSL::Trns do
16
16
  amount 20
17
17
  docnum 1
18
18
  clear 'N'
19
+ klass "foobar"
19
20
  toprint 'N'
20
21
  addr1 'Baker'
21
22
  addr2 'Customer'
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.treat_symbols_as_metadata_keys_with_true_values = true
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.6.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: 2013-06-14 00:00:00.000000000 Z
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: '0'
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: '0'
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: '0'
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: '0'
68
+ version: '3.5'
78
69
  - !ruby/object:Gem::Dependency
79
- name: awesome_print
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: '0'
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: '0'
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
- - .travis.yml
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: 1.8.25
248
+ rubygems_version: 2.6.14
256
249
  signing_key:
257
- specification_version: 3
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