temple 0.1.7 → 0.1.8
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.
- data/lib/temple/filters/escape_html.rb +2 -2
- data/lib/temple/html/fast.rb +3 -0
- data/lib/temple/version.rb +1 -1
- data/temple.gemspec +1 -1
- data/test/html/test_fast.rb +1 -0
- metadata +8 -16
@@ -3,8 +3,8 @@ module Temple
|
|
3
3
|
class EscapeHTML < Filter
|
4
4
|
temple_dispatch :escape, :html
|
5
5
|
|
6
|
-
# Activate the usage of html_safe if it is available (for Rails 3 for example)
|
7
|
-
default_options[:use_html_safe] = ''.respond_to?(:html_safe)
|
6
|
+
# Activate the usage of html_safe? if it is available (for Rails 3 for example)
|
7
|
+
default_options[:use_html_safe] = ''.respond_to?(:html_safe?)
|
8
8
|
|
9
9
|
def on_escape_static(value)
|
10
10
|
[:static, options[:use_html_safe] ? escape_html_safe(value) : escape_html(value)]
|
data/lib/temple/html/fast.rb
CHANGED
@@ -6,6 +6,7 @@ module Temple
|
|
6
6
|
XHTML_DOCTYPES = {
|
7
7
|
'1.1' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
|
8
8
|
'5' => '<!DOCTYPE html>',
|
9
|
+
'html' => '<!DOCTYPE html>',
|
9
10
|
'strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
|
10
11
|
'frameset' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
|
11
12
|
'mobile' => '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">',
|
@@ -26,6 +27,8 @@ module Temple
|
|
26
27
|
|
27
28
|
def initialize(options = {})
|
28
29
|
super
|
30
|
+
# html5 is now called html only
|
31
|
+
@options[:format] = :html5 if @options[:format] == :html
|
29
32
|
unless [:xhtml, :html4, :html5].include?(@options[:format])
|
30
33
|
raise "Invalid format #{@options[:format].inspect}"
|
31
34
|
end
|
data/lib/temple/version.rb
CHANGED
data/temple.gemspec
CHANGED
data/test/html/test_fast.rb
CHANGED
@@ -7,6 +7,7 @@ describe Temple::HTML::Fast do
|
|
7
7
|
|
8
8
|
it 'should compile html doctype' do
|
9
9
|
@html.compile([:multi, [:html, :doctype, '5']]).should.equal [:multi, [:static, '<!DOCTYPE html>']]
|
10
|
+
@html.compile([:multi, [:html, :doctype, 'html']]).should.equal [:multi, [:static, '<!DOCTYPE html>']]
|
10
11
|
@html.compile([:multi, [:html, :doctype, '1.1']]).should.equal [:multi,
|
11
12
|
[:static, '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">']]
|
12
13
|
end
|
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: temple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 1
|
8
|
-
- 7
|
9
|
-
version: 0.1.7
|
4
|
+
prerelease:
|
5
|
+
version: 0.1.8
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Magnus Holm
|
@@ -14,18 +10,17 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date: 2011-
|
13
|
+
date: 2011-03-10 00:00:00 +01:00
|
18
14
|
default_executable:
|
19
15
|
dependencies:
|
20
16
|
- !ruby/object:Gem::Dependency
|
21
17
|
name: tilt
|
22
18
|
prerelease: false
|
23
19
|
requirement: &id001 !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
24
21
|
requirements:
|
25
22
|
- - ">="
|
26
23
|
- !ruby/object:Gem::Version
|
27
|
-
segments:
|
28
|
-
- 0
|
29
24
|
version: "0"
|
30
25
|
type: :development
|
31
26
|
version_requirements: *id001
|
@@ -33,11 +28,10 @@ dependencies:
|
|
33
28
|
name: bacon
|
34
29
|
prerelease: false
|
35
30
|
requirement: &id002 !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
36
32
|
requirements:
|
37
33
|
- - ">="
|
38
34
|
- !ruby/object:Gem::Version
|
39
|
-
segments:
|
40
|
-
- 0
|
41
35
|
version: "0"
|
42
36
|
type: :development
|
43
37
|
version_requirements: *id002
|
@@ -95,23 +89,21 @@ rdoc_options: []
|
|
95
89
|
require_paths:
|
96
90
|
- lib
|
97
91
|
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
+
none: false
|
98
93
|
requirements:
|
99
94
|
- - ">="
|
100
95
|
- !ruby/object:Gem::Version
|
101
|
-
segments:
|
102
|
-
- 0
|
103
96
|
version: "0"
|
104
97
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
105
99
|
requirements:
|
106
100
|
- - ">="
|
107
101
|
- !ruby/object:Gem::Version
|
108
|
-
segments:
|
109
|
-
- 0
|
110
102
|
version: "0"
|
111
103
|
requirements: []
|
112
104
|
|
113
105
|
rubyforge_project:
|
114
|
-
rubygems_version: 1.
|
106
|
+
rubygems_version: 1.5.1
|
115
107
|
signing_key:
|
116
108
|
specification_version: 3
|
117
109
|
summary: Template compilation framework in Ruby
|