sablon 0.0.12 → 0.0.13

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: 4991820c18dedea86463c1483ceff122a0589e55
4
- data.tar.gz: a7088be5440752ed3d9edfc180da8ccab48b32f1
3
+ metadata.gz: f2ac0ffd05db94be984b1526dfc131069ec6e1e9
4
+ data.tar.gz: 20c5be46b492e483ca80adb0ab2c12369b013e09
5
5
  SHA512:
6
- metadata.gz: 11e3e9c163b08f942c40de76243147ab4bd51330fa38e8aa2fd40cf96ab30333981c5dbe4658cdea9773db648fd723321d221e7f5b7b7f8346da6ada15c78236
7
- data.tar.gz: 26b73bab301e2f7a334a23d27e40420fb50ceed420fc026d9cbd3dc7dd8a655248c147171bee28343b5de4290ce9a4dd01b7af633c66d44263b85129637a77f5
6
+ metadata.gz: 8d2389d94d4a2e491b22409e2eb3c398dc8214396db5bc4021a799c741aa9fc1f38dec0d83a69cfc5ea470a53e6eb8b24f8470e146400a8cc273fd25d3379c63
7
+ data.tar.gz: 1e9b42b3cd443d3bcd33b2b64a3a16eaa959215972441ebf55e973b096bb86c9c3f6440da8dbc269eec289ea34e898fce852900e1d210f9536710361c2d386ad
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sablon (0.0.12)
4
+ sablon (0.0.13)
5
5
  nokogiri (>= 1.6.0)
6
6
  redcarpet (>= 3.2)
7
7
  rubyzip (>= 1.1)
@@ -10,7 +10,11 @@ module Sablon
10
10
 
11
11
  def self.transform_pair(key, value)
12
12
  if key =~ /\A([^:]+):(.+)\z/
13
- [$2, Sablon.content($1.to_sym, value)]
13
+ if value.nil?
14
+ [$2, value]
15
+ else
16
+ [$2, Sablon.content($1.to_sym, value)]
17
+ end
14
18
  else
15
19
  transform_standard_key(key, value)
16
20
  end
@@ -1,3 +1,3 @@
1
1
  module Sablon
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
data/test/context_test.rb CHANGED
@@ -12,4 +12,17 @@ class ContextTest < Sablon::TestCase
12
12
  assert_equal({ "mykey"=>Sablon.content(:word_ml, "<w:p><w:p>"),
13
13
  "otherkey"=>"<nope>"}, transformed)
14
14
  end
15
+
16
+ def test_recognizes_markdown_keys
17
+ transformed = Sablon::Context.transform({"markdown:mykey" => "**yay**", "otherkey" => "<nope>"})
18
+ assert_equal({ "mykey"=>Sablon.content(:markdown, "**yay**"),
19
+ "otherkey"=>"<nope>"}, transformed)
20
+ end
21
+
22
+ def test_does_not_wrap_markdown_and_wordml_with_nil_value
23
+ transformed = Sablon::Context.transform({"markdown:mykey" => nil, "word_ml:otherkey" => nil, "normalkey" => nil})
24
+ assert_equal({ "mykey" => nil,
25
+ "otherkey" => nil,
26
+ "normalkey" => nil}, transformed)
27
+ end
15
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sablon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yves Senn
@@ -194,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
194
194
  version: '0'
195
195
  requirements: []
196
196
  rubyforge_project:
197
- rubygems_version: 2.4.6
197
+ rubygems_version: 2.4.5
198
198
  signing_key:
199
199
  specification_version: 4
200
200
  summary: docx tempalte processor