tilt 2.0.3 → 2.0.4

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: a8eb5c664834658aea7cbcd313c91143dc6cbcf5
4
- data.tar.gz: 445aed9e2cdf45b3ac7de7255df71730d82a6ee1
3
+ metadata.gz: 69824d0f8d59718a45a289673dbbc34b6e083c83
4
+ data.tar.gz: a655207744e9fa92153589e77587d8593cbbd005
5
5
  SHA512:
6
- metadata.gz: e5fb808cca6eb518ec297aee474872872ffc38da481a643787c72eb51227f75fea5aa067f6766921ff3cdc16bbdf9ad098ca552da51134b7ee591a330f8318cd
7
- data.tar.gz: b61b68cdf6c1fac47c7ef814afe4cc2c4445d345522d94248c54010237a6e439c0c835f64f40fd9412a5b65b9c90f660662c45acba48a868e060aaf74840d852
6
+ metadata.gz: 7c5c9bfae55c46fb9cb82e0ba9612a649d6a3283fcf8b9a1bcc20b115299f0c34619b751420b8b77c94d65e76ab53a6d88b8f83cb77c5a1abcc87088e3a5bcda
7
+ data.tar.gz: ef8c85a45a30d284d8fb61b7480cc223bca9254fba2d5a026106aeb52024133f629dcab8bcf6f90606a1c211dcc41a2fa0ff6908b164f70f6325fd34dda2b5f3
@@ -1,3 +1,7 @@
1
+ ## 2.0.4 (2016-05-16)
2
+
3
+ * Fix regression in BuilderTemplate (#283, judofyr)
4
+
1
5
  ## 2.0.3 (2016-05-12)
2
6
 
3
7
  * Add Pandoc support (#276, jmuheim)
@@ -460,7 +460,7 @@ To wrap a Markdown formatted document with a layout:
460
460
  ### Options
461
461
 
462
462
  Every implementation of Markdown *should* support these options, but there are
463
- some known problems with the Kramdown, Maruku and Pandoc engines.
463
+ some known problems with the Kramdown and Maruku engines.
464
464
 
465
465
  #### `:smartypants => true|false`
466
466
 
@@ -476,7 +476,7 @@ Maruku ignores this option and always applies smart quotes (and nothing else).
476
476
  Set `true` disallow raw HTML in Markdown contents. HTML is converted to
477
477
  literal text by escaping `<` characters.
478
478
 
479
- Kramdown, Maruku and Pandoc don't support this option.
479
+ Kramdown and Maruku don't support this option.
480
480
 
481
481
  ### See also
482
482
 
@@ -4,7 +4,7 @@ require 'tilt/template'
4
4
  # Namespace for Tilt. This module is not intended to be included anywhere.
5
5
  module Tilt
6
6
  # Current version.
7
- VERSION = '2.0.3'
7
+ VERSION = '2.0.4'
8
8
 
9
9
  @default_mapping = Mapping.new
10
10
 
@@ -12,8 +12,15 @@ module Tilt
12
12
  end
13
13
 
14
14
  def evaluate(scope, locals, &block)
15
- xml = (locals[:xml] ||= ::Builder::XmlMarkup.new(options))
16
- return super(scope, locals, &block) if data.respond_to?(:to_str)
15
+ xml = (locals[:xml] || ::Builder::XmlMarkup.new(options))
16
+
17
+ if data.respond_to?(:to_str)
18
+ if !locals[:xml]
19
+ locals = locals.merge(:xml => xml)
20
+ end
21
+ return super(scope, locals, &block)
22
+ end
23
+
17
24
  data.call(xml)
18
25
  xml.target!
19
26
  end
@@ -49,6 +49,14 @@ begin
49
49
  assert_equal "<div><em>Hey</em></div>", template.render
50
50
  end
51
51
 
52
+ test "can re-use locals for multiple calls" do
53
+ locals = { :name => "world" }
54
+ template = Tilt::BuilderTemplate.new(:indent => 0) { "xml.em name" }
55
+ 3.times do
56
+ assert_equal "<em>world</em>", template.render(self, locals)
57
+ end
58
+ end
59
+
52
60
  test "allows nesting raw XML" do
53
61
  subtemplate = Tilt::BuilderTemplate.new { "xml.em 'Hello World!'" }
54
62
  template = Tilt::BuilderTemplate.new { "xml.strong { xml << yield }" }
@@ -3,8 +3,8 @@ Gem::Specification.new do |s|
3
3
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
4
4
 
5
5
  s.name = 'tilt'
6
- s.version = '2.0.3'
7
- s.date = '2016-05-12'
6
+ s.version = '2.0.4'
7
+ s.date = '2016-05-16'
8
8
 
9
9
  s.description = "Generic interface to multiple Ruby template engines"
10
10
  s.summary = s.description
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tilt
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Tomayko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-12 00:00:00.000000000 Z
11
+ date: 2016-05-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Generic interface to multiple Ruby template engines
14
14
  email: r@tomayko.com