docxgen 0.1.1 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d80781462b9c3b25ff045df729e4fbd380446c963ddbdd17d6659b88a49b2d4f
4
- data.tar.gz: cf933740d3abb47e582eda6bf852390fc8365f4509b0f72dd3fbfb19060cf24d
3
+ metadata.gz: 1cdadd0ab935d7e835fa26152123053ead15703550f13bf524e3fc13f56d9706
4
+ data.tar.gz: cbc622c589aa5654010088836e81a65eaaf515ada60d893685bb50441a4f1ba1
5
5
  SHA512:
6
- metadata.gz: 95cb3dc328b3a034b2cf2933a0ecbb33e9d595c83409eb64ee56da9f05eb775eead76f2ee52603c810468d2d1550fc9fabc617cd3907a7ed18ab41c5e8c80356
7
- data.tar.gz: 3946ca05b2859d2c28a51950ad4041f81cf9f798e4e53f7f4cd458c08dccaa3fcc470be72a126f3444c1a83c80610960e69ef57f15c2e3fba64e00b2fdfa4db9
6
+ metadata.gz: 3bb29dac2783200118c1efffe7016770c1634f623543556e1559ed97795f454a3930b6eed0dbcf6215a906186dab22c32de859cb08a2b5b15315894da2193f0f
7
+ data.tar.gz: 55dba3b5678308509ab2ea393bc25e4d35f4047126f8654a8b1d938b5ac61de021a1f6848e366b7ebaff51bbc24dd6ee4d0c2a2a80cf08322a3402d44ef5dbee
@@ -1,6 +1,14 @@
1
1
  # docxgen
2
2
 
3
- ## 1.0.0
3
+ ## 0.2.0
4
+
5
+ - Added `stream` method to the generation, which returns `StringIO` instead of the file
6
+
7
+ ## 0.1.1
8
+
9
+ - Fixed dependencies issue
10
+
11
+ ## 0.1.0
4
12
 
5
13
  - First release
6
14
  - Basic variables substitution support
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- docxgen (0.1.1)
4
+ docxgen (0.2.0)
5
5
  docx (~> 0.5)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -89,6 +89,12 @@ puts generator.errors # Returns array of the errors
89
89
  generator.save("result.docx")
90
90
  ```
91
91
 
92
+ Alternatively you can use `stream` method if you want to get result as `StringIO` (for example, for saving it in ActiveStorage):
93
+
94
+ ```ruby
95
+ io = generator.stream
96
+ ```
97
+
92
98
  ## Development
93
99
 
94
100
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -49,6 +49,12 @@ module Docxgen
49
49
  @doc.save(to)
50
50
  end
51
51
 
52
+ def stream
53
+ raise "Wasn't rendered" unless @rendered
54
+
55
+ @doc.stream
56
+ end
57
+
52
58
  private
53
59
 
54
60
  def collect_table_paragraphs
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Docxgen
4
- VERSION = "0.1.1"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docxgen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Viktorov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-22 00:00:00.000000000 Z
11
+ date: 2020-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docx