sablon 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47a5aeb4ef473eea715114b4a32f0e2a5ab63711
4
- data.tar.gz: 2335675beefc2ff842609cf7be53c2146c6bb4cb
3
+ metadata.gz: e16970433666e2bf9e6b249f1b8d5a303cdbc3ea
4
+ data.tar.gz: 9f83b36343344a76cacc66281ac0a4d49b1a54e1
5
5
  SHA512:
6
- metadata.gz: a66e1e936397fbc66858216b2259c4665a52d32c754c416ad71705c36d2bf2e6deff152421ee67eebce4d643ee8ecf3d543746f00a921b0533ce44dcfe5bd5ab
7
- data.tar.gz: '0053920d8f9de09ab35885f68c79cc63f46f72b19874c2970c4e3b0655915c210af7f0c0836d8447c8a556955d937b9535a1abe426de4ed46444e3c3ba75a35b'
6
+ metadata.gz: d198d1253d723e102eed56dd83be87409678c1301631ee0fdd1587ad6716177afd27ffb8c7a5e1a5ee48955bedbb05a24fc7c5e1292c04dec8448c41e4140408
7
+ data.tar.gz: 2c6cf0df9b2d343e88bfbc7a5d262aa57198cc8a95311998111548d5f5efe0c35e629ab544bccb03a405746c07c40907b3b648a2eb8cdbd46e75abcb82d5439b
@@ -1,6 +1,12 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1
4
3
  - 2.2
5
4
  - 2.3
6
5
  - 2.4
6
+ - 2.5
7
+ - 2.6
8
+
9
+ before_install:
10
+ # This is a workaround for a problem with a specific version of bundler and
11
+ # rubygems
12
+ - gem update --system
@@ -1,19 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sablon (0.3.1)
5
- nokogiri (>= 1.6.0)
4
+ sablon (0.3.2)
5
+ nokogiri (>= 1.8.5)
6
6
  rubyzip (>= 1.1.1)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- mini_portile2 (2.3.0)
11
+ mini_portile2 (2.4.0)
12
12
  minitest (5.10.3)
13
- nokogiri (1.8.5)
14
- mini_portile2 (~> 2.3.0)
13
+ nokogiri (1.9.1)
14
+ mini_portile2 (~> 2.4.0)
15
15
  rake (12.3.0)
16
- rubyzip (1.2.2)
16
+ rubyzip (1.2.3)
17
17
  xml-simple (1.1.5)
18
18
 
19
19
  PLATFORMS
@@ -27,4 +27,4 @@ DEPENDENCIES
27
27
  xml-simple
28
28
 
29
29
  BUNDLED WITH
30
- 1.16.0
30
+ 1.16.1
data/README.md CHANGED
@@ -192,9 +192,10 @@ html_body = <<-HTML.strip
192
192
  </table>
193
193
  HTML
194
194
  context = {
195
- article: Sablon.content(:html, html_body) }
196
- # alternative method using special key format
197
- # 'html:article' => html_body
195
+ article: Sablon.content(:html, html_body) },
196
+ # Or use html: prefix to make sablon parse the value as HTML.
197
+ # Does the same as above.
198
+ 'html:article' => html_body
198
199
  }
199
200
  template.render_to_file File.expand_path("~/Desktop/output.docx"), context
200
201
  ```
@@ -256,10 +257,14 @@ sources such as file paths, URLs, or any object that exposes a `#read`
256
257
  method that returns image data. When using a "readable object" if the object
257
258
  doesn't have a `#filename` method then a `filename: '...'` option
258
259
  needs to be added to the `Sablon.content` method call.
260
+
261
+ By default the inserted image takes the dimensions of the placeholder. The size of an image can also be defined dynamically by specifying width and height with unit (cm or in) in a properties hash like `properties: {height: "2cm", width: "20cm"}`
262
+
259
263
  ```ruby
260
264
  context = {
261
265
  figure: Sablon.content(:image, 'fixtures/images/c3po.jpg'),
262
- figure2: Sablon.content(:image, string_io_obj, filename: 'test.png')
266
+ figure2: Sablon.content(:image, string_io_obj, filename: 'test.png'),
267
+ figure3: Sablon.content(:image, string_io_obj, filename: 'test.png', properties: {height: '2cm', width: '2cm'})
263
268
  # alternative method using special key format for simple paths and URLs
264
269
  # 'image:figure' => 'fixtures/images/c3po.jpg'
265
270
  }
@@ -1,3 +1,3 @@
1
1
  module Sablon
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -19,7 +19,9 @@ Gem::Specification.new do |spec|
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_runtime_dependency 'nokogiri', ">= 1.6.0"
22
+ spec.required_ruby_version = '>= 2.2'
23
+
24
+ spec.add_runtime_dependency 'nokogiri', ">= 1.8.5"
23
25
  spec.add_runtime_dependency 'rubyzip', ">= 1.1.1"
24
26
 
25
27
  spec.add_development_dependency "bundler", ">= 1.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sablon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yves Senn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-17 00:00:00.000000000 Z
11
+ date: 2019-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.6.0
19
+ version: 1.8.5
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.6.0
26
+ version: 1.8.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubyzip
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -235,7 +235,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
235
235
  requirements:
236
236
  - - ">="
237
237
  - !ruby/object:Gem::Version
238
- version: '0'
238
+ version: '2.2'
239
239
  required_rubygems_version: !ruby/object:Gem::Requirement
240
240
  requirements:
241
241
  - - ">="
@@ -243,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
243
243
  version: '0'
244
244
  requirements: []
245
245
  rubyforge_project:
246
- rubygems_version: 2.6.8
246
+ rubygems_version: 2.4.5.2
247
247
  signing_key:
248
248
  specification_version: 4
249
249
  summary: docx template processor