haml 4.0.5 → 4.0.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of haml might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/lib/haml/parser.rb +1 -1
- data/lib/haml/version.rb +1 -1
- data/test/helper_test.rb +10 -11
- data/test/test_helper.rb +0 -4
- metadata +3 -5
- data/lib/haml/temple.rb +0 -85
- data/test/gemfiles/Gemfile.rails-4.0.x.lock +0 -101
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00b001616cbcf722d8dd8f3e4a99d7895d1ce34b
|
4
|
+
data.tar.gz: b87d0bfe9067818b38abf03b6c0d3128cb9f4fb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0872b7e36195c11d167e066ab51c8006d9c4f50130caa2947f058897c57b2960d619ecee6379782fbbd1a4c908d588c3895ad5a4a24bf5ba90f216272005b14
|
7
|
+
data.tar.gz: 2271653d27a61a75e130fed6dad51e02ebed14e61123448731c910b21e679fc8bb64d3fa5ea55604a1354c7b66dd907ba5e03a8fe6c53dcb484fb79ab1a607b6
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# Haml Changelog
|
2
2
|
|
3
|
-
|
3
|
+
## 4.0.6
|
4
|
+
|
5
|
+
Released on Dec 1, 2014 ([diff](https://github.com/haml/haml/compare/4.0.5...4.0.6)).
|
6
|
+
|
7
|
+
|
8
|
+
* Fix warning on Ruby 1.8.7 "regexp has invalid interval" (thanks [Elia Schito](https://github.com/elia)).
|
9
|
+
|
4
10
|
## 4.0.5
|
5
11
|
|
6
12
|
Released on Jan 7, 2014 ([diff](https://github.com/haml/haml/compare/4.0.4...4.0.5)).
|
data/lib/haml/parser.rb
CHANGED
@@ -83,7 +83,7 @@ module Haml
|
|
83
83
|
DOCTYPE_REGEX = /(\d(?:\.\d)?)?[\s]*([a-z]*)\s*([^ ]+)?/i
|
84
84
|
|
85
85
|
# The Regex that matches a literal string or symbol value
|
86
|
-
LITERAL_VALUE_REGEX = /:(\w*)|(["'])((
|
86
|
+
LITERAL_VALUE_REGEX = /:(\w*)|(["'])((?!\\|\#\{|\#@|\#\$|\2).|\\.)*\2/
|
87
87
|
|
88
88
|
def initialize(template, options)
|
89
89
|
# :eod is a special end-of-document marker
|
data/lib/haml/version.rb
CHANGED
data/test/helper_test.rb
CHANGED
@@ -140,16 +140,16 @@ HAML
|
|
140
140
|
def test_form_tag
|
141
141
|
# This is usually provided by ActionController::Base.
|
142
142
|
def @base.protect_against_forgery?; false; end
|
143
|
-
|
144
|
-
|
145
|
-
<p>bar</p>
|
146
|
-
<strong>baz</strong>
|
147
|
-
</form>
|
148
|
-
HTML
|
143
|
+
|
144
|
+
rendered = render(<<HAML, :action_view)
|
149
145
|
= form_tag 'foo' do
|
150
146
|
%p bar
|
151
147
|
%strong baz
|
152
148
|
HAML
|
149
|
+
fragment = Nokogiri::HTML.fragment(rendered)
|
150
|
+
assert_equal 'foo', fragment.css('form').first.attributes['action'].to_s
|
151
|
+
assert_equal 'bar', fragment.css('form p').first.text.strip
|
152
|
+
assert_equal 'baz', fragment.css('form strong').first.text.strip
|
153
153
|
end
|
154
154
|
|
155
155
|
def test_pre
|
@@ -244,11 +244,10 @@ HAML
|
|
244
244
|
|
245
245
|
def test_form_tag_in_helper_with_string_block
|
246
246
|
def @base.protect_against_forgery?; false; end
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
HAML
|
247
|
+
rendered = render('= wacky_form', :action_view)
|
248
|
+
fragment = Nokogiri::HTML.fragment(rendered)
|
249
|
+
assert_equal 'bar', fragment.text.strip
|
250
|
+
assert_equal '/foo', fragment.css('form').first.attributes['action'].to_s
|
252
251
|
end
|
253
252
|
|
254
253
|
def test_haml_tag_name_attribute_with_id
|
data/test/test_helper.rb
CHANGED
@@ -65,10 +65,6 @@ class MiniTest::Unit::TestCase
|
|
65
65
|
Haml::Util.silence_warnings(&block)
|
66
66
|
end
|
67
67
|
|
68
|
-
def rails_form_opener
|
69
|
-
'<div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /></div>'
|
70
|
-
end
|
71
|
-
|
72
68
|
def assert_raises_message(klass, message)
|
73
69
|
yield
|
74
70
|
rescue Exception => e
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Weizenbaum
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-01
|
13
|
+
date: 2014-12-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: tilt
|
@@ -124,7 +124,6 @@ files:
|
|
124
124
|
- lib/haml/template.rb
|
125
125
|
- lib/haml/template/options.rb
|
126
126
|
- lib/haml/template/plugin.rb
|
127
|
-
- lib/haml/temple.rb
|
128
127
|
- lib/haml/util.rb
|
129
128
|
- lib/haml/version.rb
|
130
129
|
- test/engine_test.rb
|
@@ -137,7 +136,6 @@ files:
|
|
137
136
|
- test/gemfiles/Gemfile.rails-3.1.x
|
138
137
|
- test/gemfiles/Gemfile.rails-3.2.x
|
139
138
|
- test/gemfiles/Gemfile.rails-4.0.x
|
140
|
-
- test/gemfiles/Gemfile.rails-4.0.x.lock
|
141
139
|
- test/helper_test.rb
|
142
140
|
- test/markaby/standard.mab
|
143
141
|
- test/mocks/article.rb
|
@@ -230,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
230
228
|
version: '0'
|
231
229
|
requirements: []
|
232
230
|
rubyforge_project:
|
233
|
-
rubygems_version: 2.
|
231
|
+
rubygems_version: 2.4.4
|
234
232
|
signing_key:
|
235
233
|
specification_version: 4
|
236
234
|
summary: An elegant, structured (X)HTML/XML templating engine.
|
data/lib/haml/temple.rb
DELETED
@@ -1,85 +0,0 @@
|
|
1
|
-
require 'haml'
|
2
|
-
require 'temple'
|
3
|
-
|
4
|
-
module Haml
|
5
|
-
|
6
|
-
module Temple
|
7
|
-
|
8
|
-
module Expressions
|
9
|
-
def on_plain
|
10
|
-
[:static, "\n" + value[:text]]
|
11
|
-
end
|
12
|
-
|
13
|
-
def on_root
|
14
|
-
[:multi]
|
15
|
-
end
|
16
|
-
|
17
|
-
def on_doctype
|
18
|
-
[:html, :doctype, value[:version] || 5]
|
19
|
-
end
|
20
|
-
|
21
|
-
def on_tag
|
22
|
-
exp = [:html, :tag, value[:name], [:html, :attrs]]
|
23
|
-
if value[:value] && value[:value] != ""
|
24
|
-
if value[:parse]
|
25
|
-
exp.push << [:dynamic, value[:value]]
|
26
|
-
else
|
27
|
-
exp.push << [:static, value[:value]]
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
if attribs = value[:attributes]
|
32
|
-
attribs.each do |key, value|
|
33
|
-
exp.last << [:html, :attr, key, [:static, value]]
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
exp
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
class Parser
|
42
|
-
def initialize(*args)
|
43
|
-
@options = Options.new
|
44
|
-
end
|
45
|
-
|
46
|
-
def call(haml)
|
47
|
-
parser = ::Haml::Parser.new(haml, @options)
|
48
|
-
tree = parser.parse.tap {|x| p x; puts '-' * 10}
|
49
|
-
compile(tree).tap {|x| p x; puts '-' * 10}
|
50
|
-
end
|
51
|
-
|
52
|
-
private
|
53
|
-
|
54
|
-
def compile(node)
|
55
|
-
exp = node.to_temple
|
56
|
-
return exp if node.children.empty?
|
57
|
-
if node.children.length == 1
|
58
|
-
exp.push compile(node.children[0])
|
59
|
-
else
|
60
|
-
exp.push [:multi, *node.children.map {|c| compile(c)}]
|
61
|
-
end
|
62
|
-
exp
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
class Engine < ::Temple::Engine
|
67
|
-
use ::Haml::Temple::Parser
|
68
|
-
html :Pretty
|
69
|
-
filter :ControlFlow
|
70
|
-
generator :ArrayBuffer
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
class Parser::ParseNode
|
75
|
-
include ::Haml::Temple::Expressions
|
76
|
-
|
77
|
-
def to_temple
|
78
|
-
begin
|
79
|
-
send "on_#{type}"
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
Haml::Temple::Template = Temple::Templates::Tilt(Haml::Temple::Engine, :register_as => :haml)
|
@@ -1,101 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: ../../..
|
3
|
-
specs:
|
4
|
-
rails (4.0.0.beta1)
|
5
|
-
actionmailer (= 4.0.0.beta1)
|
6
|
-
actionpack (= 4.0.0.beta1)
|
7
|
-
activerecord (= 4.0.0.beta1)
|
8
|
-
activesupport (= 4.0.0.beta1)
|
9
|
-
bundler (>= 1.3.0, < 2.0)
|
10
|
-
railties (= 4.0.0.beta1)
|
11
|
-
sprockets-rails (~> 2.0.0.rc4)
|
12
|
-
|
13
|
-
PATH
|
14
|
-
remote: /Users/norman/work/haml
|
15
|
-
specs:
|
16
|
-
haml (4.0.3)
|
17
|
-
tilt
|
18
|
-
|
19
|
-
GEM
|
20
|
-
remote: http://rubygems.org/
|
21
|
-
specs:
|
22
|
-
actionmailer (4.0.0.beta1)
|
23
|
-
actionpack (= 4.0.0.beta1)
|
24
|
-
mail (~> 2.5.3)
|
25
|
-
actionpack (4.0.0.beta1)
|
26
|
-
activesupport (= 4.0.0.beta1)
|
27
|
-
builder (~> 3.1.0)
|
28
|
-
erubis (~> 2.7.0)
|
29
|
-
rack (~> 1.5.2)
|
30
|
-
rack-test (~> 0.6.2)
|
31
|
-
activemodel (4.0.0.beta1)
|
32
|
-
activesupport (= 4.0.0.beta1)
|
33
|
-
builder (~> 3.1.0)
|
34
|
-
activerecord (4.0.0.beta1)
|
35
|
-
activemodel (= 4.0.0.beta1)
|
36
|
-
activerecord-deprecated_finders (~> 0.0.3)
|
37
|
-
activesupport (= 4.0.0.beta1)
|
38
|
-
arel (~> 4.0.0.beta1)
|
39
|
-
activerecord-deprecated_finders (0.0.3)
|
40
|
-
activesupport (4.0.0.beta1)
|
41
|
-
i18n (~> 0.6.2)
|
42
|
-
minitest (~> 4.2)
|
43
|
-
multi_json (~> 1.3)
|
44
|
-
thread_safe (~> 0.1)
|
45
|
-
tzinfo (~> 0.3.33)
|
46
|
-
arel (4.0.0)
|
47
|
-
atomic (1.1.9)
|
48
|
-
builder (3.1.4)
|
49
|
-
erubis (2.7.0)
|
50
|
-
hike (1.2.2)
|
51
|
-
i18n (0.6.4)
|
52
|
-
json (1.8.0)
|
53
|
-
mail (2.5.4)
|
54
|
-
mime-types (~> 1.16)
|
55
|
-
treetop (~> 1.4.8)
|
56
|
-
mime-types (1.23)
|
57
|
-
minitest (4.7.4)
|
58
|
-
multi_json (1.7.3)
|
59
|
-
nokogiri (1.5.9)
|
60
|
-
polyglot (0.3.3)
|
61
|
-
rack (1.5.2)
|
62
|
-
rack-test (0.6.2)
|
63
|
-
rack (>= 1.0)
|
64
|
-
railties (4.0.0.beta1)
|
65
|
-
actionpack (= 4.0.0.beta1)
|
66
|
-
activesupport (= 4.0.0.beta1)
|
67
|
-
rake (>= 0.8.7)
|
68
|
-
rdoc (~> 3.4)
|
69
|
-
thor (>= 0.17.0, < 2.0)
|
70
|
-
rake (10.0.4)
|
71
|
-
rbench (0.2.3)
|
72
|
-
rdoc (3.12.2)
|
73
|
-
json (~> 1.4)
|
74
|
-
sprockets (2.9.3)
|
75
|
-
hike (~> 1.2)
|
76
|
-
multi_json (~> 1.0)
|
77
|
-
rack (~> 1.0)
|
78
|
-
tilt (~> 1.1, != 1.3.0)
|
79
|
-
sprockets-rails (2.0.0.rc4)
|
80
|
-
actionpack (>= 3.0)
|
81
|
-
activesupport (>= 3.0)
|
82
|
-
sprockets (~> 2.8)
|
83
|
-
thor (0.18.1)
|
84
|
-
thread_safe (0.1.0)
|
85
|
-
atomic
|
86
|
-
tilt (1.4.1)
|
87
|
-
treetop (1.4.12)
|
88
|
-
polyglot
|
89
|
-
polyglot (>= 0.3.1)
|
90
|
-
tzinfo (0.3.37)
|
91
|
-
|
92
|
-
PLATFORMS
|
93
|
-
ruby
|
94
|
-
|
95
|
-
DEPENDENCIES
|
96
|
-
bundler (~> 1.3.0)
|
97
|
-
haml!
|
98
|
-
minitest
|
99
|
-
nokogiri
|
100
|
-
rails (~> 4.0.0.beta1)!
|
101
|
-
rbench
|