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 +4 -4
- data/CHANGELOG.md +4 -0
- data/docs/TEMPLATES.md +2 -2
- data/lib/tilt.rb +1 -1
- data/lib/tilt/builder.rb +9 -2
- data/test/tilt_buildertemplate_test.rb +8 -0
- data/tilt.gemspec +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69824d0f8d59718a45a289673dbbc34b6e083c83
|
4
|
+
data.tar.gz: a655207744e9fa92153589e77587d8593cbbd005
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c5c9bfae55c46fb9cb82e0ba9612a649d6a3283fcf8b9a1bcc20b115299f0c34619b751420b8b77c94d65e76ab53a6d88b8f83cb77c5a1abcc87088e3a5bcda
|
7
|
+
data.tar.gz: ef8c85a45a30d284d8fb61b7480cc223bca9254fba2d5a026106aeb52024133f629dcab8bcf6f90606a1c211dcc41a2fa0ff6908b164f70f6325fd34dda2b5f3
|
data/CHANGELOG.md
CHANGED
data/docs/TEMPLATES.md
CHANGED
@@ -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
|
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
|
479
|
+
Kramdown and Maruku don't support this option.
|
480
480
|
|
481
481
|
### See also
|
482
482
|
|
data/lib/tilt.rb
CHANGED
data/lib/tilt/builder.rb
CHANGED
@@ -12,8 +12,15 @@ module Tilt
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def evaluate(scope, locals, &block)
|
15
|
-
xml = (locals[:xml]
|
16
|
-
|
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 }" }
|
data/tilt.gemspec
CHANGED
@@ -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.
|
7
|
-
s.date = '2016-05-
|
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.
|
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-
|
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
|