temple 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -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)]
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Temple
2
- VERSION = '0.1.7'
2
+ VERSION = '0.1.8'
3
3
  end
data/temple.gemspec CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
6
6
  s.version = Temple::VERSION
7
7
 
8
8
  s.authors = ["Magnus Holm"]
9
- s.date = %q{2011-01-19}
9
+ s.date = %q{2011-03-10}
10
10
  s.email = %q{judofyr@gmail.com}
11
11
  s.homepage = %q{http://dojo.rubyforge.org/}
12
12
  s.require_paths = ["lib"]
@@ -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: false
5
- segments:
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-01-19 00:00:00 +01:00
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.3.6
106
+ rubygems_version: 1.5.1
115
107
  signing_key:
116
108
  specification_version: 3
117
109
  summary: Template compilation framework in Ruby