write_xlsx_rails 0.0.1 → 0.0.2

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.
data/README.md CHANGED
@@ -90,9 +90,11 @@ User.to_xlsx package: xlsx_package, (other options)
90
90
  Partials work as expected:
91
91
 
92
92
  ```ruby
93
- render partial: 'header', locals: { worksheet: worksheet }
93
+ render partial: 'header', locals: { workbook: workbook }
94
94
  ```
95
95
 
96
+ > NOTE: Every partial instantiate own _workbook_ variable. So, it can cause problems. To prevent this just pass workbook as local variable to the partial.
97
+
96
98
  ##Dependencies
97
99
 
98
100
  * [write\_xlsx](http://github.com/cxn03651/write_xlsx)
@@ -12,11 +12,13 @@ module WriteXlsxRails
12
12
  require 'stringio'
13
13
 
14
14
  __io = StringIO.new
15
- workbook = WriteXLSX.new(__io)
15
+
16
+ __workbook_defined = defined? workbook
17
+ workbook = WriteXLSX.new(__io) unless __workbook_defined
16
18
 
17
19
  #{template.source}
18
20
 
19
- workbook.close
21
+ workbook.close unless __workbook_defined
20
22
 
21
23
  __io.flush
22
24
  __io.string
@@ -1,3 +1,3 @@
1
1
  module WriteXlsxRails
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: write_xlsx_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
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-07-10 00:00:00.000000000 Z
12
+ date: 2013-07-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: write_xlsx