riif 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## NEXT (unreleased)
4
4
 
5
+ ## 0.6.0
6
+
7
+ * #10 Add option to pass an argument to `Riif.new`. [@ghiculescu](https://github.com/ghiculescu)
8
+
5
9
  ## 0.5.0
6
10
 
7
11
  * #9 Implement TIMERHDR. [@ghiculescu](https://github.com/ghiculescu)
data/README.md CHANGED
@@ -142,6 +142,22 @@ SPL 888
142
142
  ENDTRNS
143
143
  ```
144
144
 
145
+ If you prefer, you can pass an argument along with your block:
146
+
147
+ ```ruby
148
+ Riif::IIF.new do |riif|
149
+ riif.trns do |trns|
150
+ trns.row do |row|
151
+ row.trnsid 123
152
+ row.trnstype 'INVOICE'
153
+ row.date '8/31/1988'
154
+ row.accnt 'Accounts Receivable'
155
+ row.name 'Customer'
156
+ end
157
+ end
158
+ end
159
+ ```
160
+
145
161
  ## Editors
146
162
 
147
163
  ### Vim
@@ -26,7 +26,11 @@ module Riif
26
26
  def initialize(&block)
27
27
  @output = {}
28
28
  if block_given?
29
- instance_eval(&block)
29
+ if block.arity == 1
30
+ yield(self)
31
+ else
32
+ instance_eval(&block)
33
+ end
30
34
  end
31
35
  end
32
36
 
@@ -1,3 +1,3 @@
1
1
  module Riif
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riif
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-08 00:00:00.000000000 Z
12
+ date: 2013-06-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pry
@@ -238,15 +238,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
238
238
  - - ! '>='
239
239
  - !ruby/object:Gem::Version
240
240
  version: '0'
241
+ segments:
242
+ - 0
243
+ hash: -2664562977683222870
241
244
  required_rubygems_version: !ruby/object:Gem::Requirement
242
245
  none: false
243
246
  requirements:
244
247
  - - ! '>='
245
248
  - !ruby/object:Gem::Version
246
249
  version: '0'
250
+ segments:
251
+ - 0
252
+ hash: -2664562977683222870
247
253
  requirements: []
248
254
  rubyforge_project:
249
- rubygems_version: 1.8.23
255
+ rubygems_version: 1.8.25
250
256
  signing_key:
251
257
  specification_version: 3
252
258
  summary: A simple DSL to generate QuickBooks IIF file