haml 2.2.10 → 2.2.11
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.
- data/VERSION +1 -1
- data/init.rb +11 -3
- data/lib/haml/engine.rb +2 -5
- data/lib/haml/helpers/xss_mods.rb +3 -2
- data/lib/haml/precompiler.rb +11 -6
- data/lib/haml/template.rb +3 -3
- data/lib/haml/util.rb +13 -0
- data/lib/sass/css.rb +3 -1
- data/lib/sass/engine.rb +8 -4
- data/lib/sass/plugin/rails.rb +20 -12
- data/lib/sass/tree/node.rb +3 -1
- data/lib/sass/tree/prop_node.rb +14 -2
- data/test/haml/engine_test.rb +39 -0
- data/test/haml/template_test.rb +19 -11
- data/test/linked_rails.rb +1 -2
- data/test/sass/css2sass_test.rb +13 -0
- data/test/sass/engine_test.rb +33 -4
- data/test/test_helper.rb +0 -6
- metadata +141 -141
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.
|
1
|
+
2.2.11
|
data/init.rb
CHANGED
@@ -1,8 +1,16 @@
|
|
1
1
|
begin
|
2
2
|
require File.join(File.dirname(__FILE__), 'lib', 'haml') # From here
|
3
3
|
rescue LoadError
|
4
|
-
|
4
|
+
begin
|
5
|
+
require 'haml' # From gem
|
6
|
+
rescue LoadError => e
|
7
|
+
# gems:install may be run to install Haml with the skeleton plugin
|
8
|
+
# but not the gem itself installed.
|
9
|
+
# Don't die if this is the case.
|
10
|
+
raise e unless defined?(Rake) && Rake.application.top_level_tasks.include?('gems:install')
|
11
|
+
end
|
5
12
|
end
|
6
13
|
|
7
|
-
# Load Haml and Sass
|
8
|
-
Haml.
|
14
|
+
# Load Haml and Sass.
|
15
|
+
# Haml may be undefined if we're running gems:install.
|
16
|
+
Haml.init_rails(binding) if defined?(Haml)
|
data/lib/haml/engine.rb
CHANGED
@@ -108,7 +108,6 @@ module Haml
|
|
108
108
|
@precompiled = ''
|
109
109
|
@to_merge = []
|
110
110
|
@tab_change = 0
|
111
|
-
@temp_count = 0
|
112
111
|
|
113
112
|
precompile
|
114
113
|
rescue Haml::Error => e
|
@@ -175,15 +174,13 @@ module Haml
|
|
175
174
|
@haml_buffer = buffer
|
176
175
|
end
|
177
176
|
|
178
|
-
|
177
|
+
eval(precompiled + ";" + precompiled_method_return_value,
|
179
178
|
scope, @options[:filename], @options[:line])
|
180
|
-
|
179
|
+
ensure
|
181
180
|
# Get rid of the current buffer
|
182
181
|
scope_object.instance_eval do
|
183
182
|
@haml_buffer = buffer.upper
|
184
183
|
end
|
185
|
-
|
186
|
-
str
|
187
184
|
end
|
188
185
|
alias_method :to_html, :render
|
189
186
|
|
@@ -17,8 +17,9 @@ module Haml
|
|
17
17
|
# Don't escape text that's already safe,
|
18
18
|
# output is always HTML safe
|
19
19
|
def html_escape_with_haml_xss(text)
|
20
|
-
|
21
|
-
|
20
|
+
str = text.to_s
|
21
|
+
return text if str.html_safe?
|
22
|
+
html_escape_without_haml_xss(str).html_safe!
|
22
23
|
end
|
23
24
|
|
24
25
|
# Output is always HTML safe
|
data/lib/haml/precompiler.rb
CHANGED
@@ -92,14 +92,17 @@ module Haml
|
|
92
92
|
# Returns the precompiled string with the preamble and postamble
|
93
93
|
def precompiled_with_ambles(local_names)
|
94
94
|
preamble = <<END.gsub("\n", ";")
|
95
|
+
begin
|
95
96
|
extend Haml::Helpers
|
96
97
|
_hamlout = @haml_buffer = Haml::Buffer.new(@haml_buffer, #{options_for_buffer.inspect})
|
97
98
|
_erbout = _hamlout.buffer
|
98
99
|
__in_erb_template = true
|
99
100
|
END
|
100
101
|
postamble = <<END.gsub("\n", ";")
|
101
|
-
@haml_buffer = @haml_buffer.upper
|
102
102
|
#{precompiled_method_return_value}
|
103
|
+
ensure
|
104
|
+
@haml_buffer = @haml_buffer.upper
|
105
|
+
end
|
103
106
|
END
|
104
107
|
preamble + locals_code(local_names) + precompiled + postamble
|
105
108
|
end
|
@@ -999,29 +1002,31 @@ END
|
|
999
1002
|
|
1000
1003
|
def resolve_newlines
|
1001
1004
|
return unless @newlines > 0
|
1005
|
+
flush_merged_text unless @to_merge.all? {|type, *_| type == :text}
|
1002
1006
|
@precompiled << "\n" * @newlines
|
1003
1007
|
@newlines = 0
|
1004
1008
|
end
|
1005
1009
|
|
1006
1010
|
# Get rid of and whitespace at the end of the buffer
|
1007
1011
|
# or the merged text
|
1008
|
-
def rstrip_buffer!
|
1009
|
-
|
1012
|
+
def rstrip_buffer!(index = -1)
|
1013
|
+
last = @to_merge[index]
|
1014
|
+
if last.nil?
|
1010
1015
|
push_silent("_hamlout.rstrip!", false)
|
1011
1016
|
@dont_tab_up_next_text = true
|
1012
1017
|
return
|
1013
1018
|
end
|
1014
1019
|
|
1015
|
-
last = @to_merge.last
|
1016
1020
|
case last.first
|
1017
1021
|
when :text
|
1018
1022
|
last[1].rstrip!
|
1019
1023
|
if last[1].empty?
|
1020
|
-
@to_merge.
|
1021
|
-
rstrip_buffer!
|
1024
|
+
@to_merge.slice! index
|
1025
|
+
rstrip_buffer! index
|
1022
1026
|
end
|
1023
1027
|
when :script
|
1024
1028
|
last[1].gsub!(/\(haml_temp, (.*?)\);$/, '(haml_temp.rstrip, \1);')
|
1029
|
+
rstrip_buffer! index - 1
|
1025
1030
|
else
|
1026
1031
|
raise SyntaxError.new("[HAML BUG] Undefined entry in Haml::Precompiler@to_merge.")
|
1027
1032
|
end
|
data/lib/haml/template.rb
CHANGED
@@ -61,14 +61,14 @@ else
|
|
61
61
|
Haml::Template.try_enabling_xss_integration
|
62
62
|
end
|
63
63
|
|
64
|
-
if
|
64
|
+
if Haml::Util.rails_root
|
65
65
|
# Update init.rb to the current version
|
66
66
|
# if it's out of date.
|
67
67
|
#
|
68
68
|
# We can probably remove this as of v1.9,
|
69
69
|
# because the new init file is sufficiently flexible
|
70
70
|
# to not need updating.
|
71
|
-
rails_init_file = File.join(
|
71
|
+
rails_init_file = File.join(Haml::Util.rails_root, 'vendor', 'plugins', 'haml', 'init.rb')
|
72
72
|
haml_init_file = Haml::Util.scope('init.rb')
|
73
73
|
begin
|
74
74
|
if File.exists?(rails_init_file)
|
@@ -79,7 +79,7 @@ if defined?(RAILS_ROOT)
|
|
79
79
|
warn <<END
|
80
80
|
HAML WARNING:
|
81
81
|
#{rails_init_file} is out of date and couldn't be automatically updated.
|
82
|
-
Please run `haml --rails #{File.expand_path(
|
82
|
+
Please run `haml --rails #{File.expand_path(Haml::Util.rails_root)}' to update it.
|
83
83
|
END
|
84
84
|
end
|
85
85
|
end
|
data/lib/haml/util.rb
CHANGED
@@ -122,6 +122,19 @@ module Haml
|
|
122
122
|
end
|
123
123
|
end
|
124
124
|
|
125
|
+
## Cross Rails Version Compatibility
|
126
|
+
|
127
|
+
# Returns the root of the Rails application,
|
128
|
+
# if this is running in a Rails context.
|
129
|
+
# Returns `nil` if no such root is defined.
|
130
|
+
#
|
131
|
+
# @return [String, nil]
|
132
|
+
def rails_root
|
133
|
+
return Rails.root.to_s if defined?(Rails.root)
|
134
|
+
return RAILS_ROOT.to_s if defined?(RAILS_ROOT)
|
135
|
+
return nil
|
136
|
+
end
|
137
|
+
|
125
138
|
## Rails XSS Safety
|
126
139
|
|
127
140
|
# Whether or not ActionView's XSS protection is available and enabled,
|
data/lib/sass/css.rb
CHANGED
@@ -24,7 +24,9 @@ module Sass
|
|
24
24
|
class RuleNode
|
25
25
|
# @see Node#to_sass
|
26
26
|
def to_sass(tabs, opts = {})
|
27
|
-
|
27
|
+
name = rules.first
|
28
|
+
name = "\\" + name if name[0] == ?:
|
29
|
+
str = "\n#{' ' * tabs}#{name}#{children.any? { |c| c.is_a? PropNode } ? "\n" : ''}"
|
28
30
|
|
29
31
|
children.each do |child|
|
30
32
|
str << "#{child.to_sass(tabs + 1, opts)}"
|
data/lib/sass/engine.rb
CHANGED
@@ -314,12 +314,16 @@ LONG
|
|
314
314
|
def parse_line(parent, line, root)
|
315
315
|
case line.text[0]
|
316
316
|
when PROPERTY_CHAR
|
317
|
-
if line.text[1]
|
318
|
-
|
319
|
-
|
317
|
+
if line.text[1] == PROPERTY_CHAR ||
|
318
|
+
(@options[:property_syntax] == :new &&
|
319
|
+
line.text =~ PROPERTY_OLD && $3.empty?)
|
320
320
|
# Support CSS3-style pseudo-elements,
|
321
|
-
# which begin with
|
321
|
+
# which begin with ::,
|
322
|
+
# as well as pseudo-classes
|
323
|
+
# if we're using the new property syntax
|
322
324
|
Tree::RuleNode.new(line.text)
|
325
|
+
else
|
326
|
+
parse_property(line, PROPERTY_OLD)
|
323
327
|
end
|
324
328
|
when Script::VARIABLE_CHAR
|
325
329
|
parse_variable(line)
|
data/lib/sass/plugin/rails.rb
CHANGED
@@ -1,22 +1,30 @@
|
|
1
1
|
unless defined?(Sass::RAILS_LOADED)
|
2
2
|
Sass::RAILS_LOADED = true
|
3
3
|
|
4
|
-
Sass::Plugin.options.merge!(:template_location =>
|
5
|
-
:css_location =>
|
6
|
-
:cache_location =>
|
4
|
+
Sass::Plugin.options.merge!(:template_location => Haml::Util.rails_root + '/public/stylesheets/sass',
|
5
|
+
:css_location => Haml::Util.rails_root + '/public/stylesheets',
|
6
|
+
:cache_location => Haml::Util.rails_root + '/tmp/sass-cache',
|
7
7
|
:always_check => RAILS_ENV != "production",
|
8
8
|
:full_exception => RAILS_ENV != "production")
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
Sass::Plugin.update_stylesheets
|
17
|
-
end
|
10
|
+
check = lambda do
|
11
|
+
if !Sass::Plugin.checked_for_updates ||
|
12
|
+
Sass::Plugin.options[:always_update] || Sass::Plugin.options[:always_check]
|
13
|
+
Sass::Plugin.update_stylesheets
|
14
|
+
end
|
15
|
+
end
|
18
16
|
|
19
|
-
|
17
|
+
if defined?(ActionDispatch::Callbacks.to_prepare)
|
18
|
+
# Rails >= 3.0.0
|
19
|
+
ActionDispatch::Callbacks.to_prepare(&check)
|
20
|
+
else
|
21
|
+
module ActionController
|
22
|
+
class Base
|
23
|
+
alias_method :sass_old_process, :process
|
24
|
+
def process(*args)
|
25
|
+
check.call
|
26
|
+
sass_old_process(*args)
|
27
|
+
end
|
20
28
|
end
|
21
29
|
end
|
22
30
|
end
|
data/lib/sass/tree/node.rb
CHANGED
@@ -123,7 +123,9 @@ module Sass
|
|
123
123
|
result = String.new
|
124
124
|
children.each do |child|
|
125
125
|
if child.is_a? PropNode
|
126
|
-
|
126
|
+
message = "Properties aren't allowed at the root of a document." +
|
127
|
+
child.pseudo_class_selector_message
|
128
|
+
raise Sass::SyntaxError.new(message, child.line)
|
127
129
|
else
|
128
130
|
next if child.invisible?
|
129
131
|
child_str = child.to_s(1)
|
data/lib/sass/tree/prop_node.rb
CHANGED
@@ -54,7 +54,9 @@ module Sass::Tree
|
|
54
54
|
real_name = "#{parent_name}-#{real_name}" if parent_name
|
55
55
|
|
56
56
|
if value.empty? && children.empty?
|
57
|
-
|
57
|
+
message = "Invalid property: #{declaration.dump} (no value)." +
|
58
|
+
pseudo_class_selector_message
|
59
|
+
raise Sass::SyntaxError.new(message, @line)
|
58
60
|
end
|
59
61
|
|
60
62
|
join_string = case style
|
@@ -76,6 +78,16 @@ module Sass::Tree
|
|
76
78
|
(style == :compressed && parent_name) ? to_return : to_return[0...-1]
|
77
79
|
end
|
78
80
|
|
81
|
+
# Returns a appropriate message indicating how to escape pseudo-class selectors.
|
82
|
+
# This only applies for old-style properties with no value,
|
83
|
+
# so returns the empty string if this is new-style.
|
84
|
+
#
|
85
|
+
# @return [String] The message
|
86
|
+
def pseudo_class_selector_message
|
87
|
+
return "" if @prop_syntax == :new || !value.empty?
|
88
|
+
"\nIf #{declaration.dump} should be a selector, use \"\\#{declaration}\" instead."
|
89
|
+
end
|
90
|
+
|
79
91
|
protected
|
80
92
|
|
81
93
|
# Runs any SassScript that may be embedded in the property.
|
@@ -103,7 +115,7 @@ module Sass::Tree
|
|
103
115
|
private
|
104
116
|
|
105
117
|
def declaration
|
106
|
-
@prop_syntax == :new ? "#{name}: #{value}" : ":#{name} #{value}"
|
118
|
+
(@prop_syntax == :new ? "#{name}: #{value}" : ":#{name} #{value}").strip
|
107
119
|
end
|
108
120
|
end
|
109
121
|
end
|
data/test/haml/engine_test.rb
CHANGED
@@ -72,6 +72,7 @@ class EngineTest < Test::Unit::TestCase
|
|
72
72
|
"/ foo\n\n bar" => ["Illegal nesting: nesting within a tag that already has content is illegal.", 3],
|
73
73
|
"!!!\n\n bar" => ["Illegal nesting: nesting within a header command is illegal.", 3],
|
74
74
|
"foo\n:ruby\n 1\n 2\n 3\n- raise 'foo'" => ["foo", 6],
|
75
|
+
"= raise 'foo'\nfoo\nbar\nbaz\nbang" => ["foo", 1],
|
75
76
|
}
|
76
77
|
|
77
78
|
User = Struct.new('User', :id)
|
@@ -321,6 +322,18 @@ HTML
|
|
321
322
|
HAML
|
322
323
|
end
|
323
324
|
|
325
|
+
def test_outer_whitespace_nuke_with_empty_script
|
326
|
+
assert_equal(<<HTML, render(<<HAML))
|
327
|
+
<p>
|
328
|
+
foo<a></a></p>
|
329
|
+
HTML
|
330
|
+
%p
|
331
|
+
foo
|
332
|
+
= " "
|
333
|
+
%a>
|
334
|
+
HAML
|
335
|
+
end
|
336
|
+
|
324
337
|
def test_both_case_indentation_work_with_deeply_nested_code
|
325
338
|
result = <<RESULT
|
326
339
|
<h2>
|
@@ -950,6 +963,32 @@ END
|
|
950
963
|
assert_equal("FOO\n", engine("= upcase").render_proc("foo".instance_eval{binding}).call)
|
951
964
|
end
|
952
965
|
|
966
|
+
def test_haml_buffer_gets_reset_even_with_exception
|
967
|
+
scope = Object.new
|
968
|
+
render("- raise Haml::Error", :scope => scope)
|
969
|
+
assert(false, "Expected exception")
|
970
|
+
rescue Exception
|
971
|
+
assert_nil(scope.send(:haml_buffer))
|
972
|
+
end
|
973
|
+
|
974
|
+
def test_def_method_haml_buffer_gets_reset_even_with_exception
|
975
|
+
scope = Object.new
|
976
|
+
engine("- raise Haml::Error").def_method(scope, :render)
|
977
|
+
scope.render
|
978
|
+
assert(false, "Expected exception")
|
979
|
+
rescue Exception
|
980
|
+
assert_nil(scope.send(:haml_buffer))
|
981
|
+
end
|
982
|
+
|
983
|
+
def test_render_proc_haml_buffer_gets_reset_even_with_exception
|
984
|
+
scope = Object.new
|
985
|
+
proc = engine("- raise Haml::Error").render_proc(scope)
|
986
|
+
proc.call
|
987
|
+
assert(false, "Expected exception")
|
988
|
+
rescue Exception
|
989
|
+
assert_nil(scope.send(:haml_buffer))
|
990
|
+
end
|
991
|
+
|
953
992
|
def test_ugly_true
|
954
993
|
assert_equal("<div id='outer'>\n<div id='inner'>\n<p>hello world</p>\n</div>\n</div>\n",
|
955
994
|
render("#outer\n #inner\n %p hello world", :ugly => true))
|
data/test/haml/template_test.rb
CHANGED
@@ -144,16 +144,20 @@ class TemplateTest < Test::Unit::TestCase
|
|
144
144
|
end
|
145
145
|
end
|
146
146
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
147
|
+
if ActionPack::VERSION::MAJOR < 3
|
148
|
+
# Rails 3.0.0 deprecates the use of yield with a layout
|
149
|
+
# for calls to render :file
|
150
|
+
def test_action_view_templates_render_correctly
|
151
|
+
proc = lambda do
|
152
|
+
@base.content_for(:layout) {'Lorem ipsum dolor sit amet'}
|
153
|
+
assert_renders_correctly 'content_for_layout'
|
154
|
+
end
|
155
|
+
|
156
|
+
if @base.respond_to?(:with_output_buffer)
|
157
|
+
@base.with_output_buffer("", &proc)
|
158
|
+
else
|
159
|
+
proc.call
|
160
|
+
end
|
157
161
|
end
|
158
162
|
end
|
159
163
|
|
@@ -203,7 +207,7 @@ HTML
|
|
203
207
|
- with_output_buffer do
|
204
208
|
bar
|
205
209
|
= "foo".gsub(/./) do |s|
|
206
|
-
-
|
210
|
+
- "flup"
|
207
211
|
baz
|
208
212
|
HAML
|
209
213
|
end
|
@@ -284,5 +288,9 @@ END
|
|
284
288
|
def test_rendered_string_is_html_safe_with_action_view
|
285
289
|
assert(render("Foo", :action_view).html_safe?)
|
286
290
|
end
|
291
|
+
|
292
|
+
def test_xss_html_escaping_with_non_strings
|
293
|
+
assert_equal("4\n", render("= html_escape(4)"))
|
294
|
+
end
|
287
295
|
end
|
288
296
|
end
|
data/test/linked_rails.rb
CHANGED
@@ -5,9 +5,8 @@ if File.exists?(linked_rails) && !$:.include?(linked_rails + '/activesupport/lib
|
|
5
5
|
puts "[ using linked Rails ]"
|
6
6
|
$:.unshift linked_rails + '/activesupport/lib'
|
7
7
|
$:.unshift linked_rails + '/actionpack/lib'
|
8
|
-
else
|
9
|
-
require 'rubygems'
|
10
8
|
end
|
9
|
+
require 'rubygems'
|
11
10
|
require 'action_controller'
|
12
11
|
require 'action_view'
|
13
12
|
|
data/test/sass/css2sass_test.rb
CHANGED
@@ -230,6 +230,19 @@ SASS
|
|
230
230
|
CSS
|
231
231
|
end
|
232
232
|
|
233
|
+
def test_pseudo_classes_are_escaped
|
234
|
+
assert_equal(<<SASS, css2sass(<<CSS))
|
235
|
+
\\:focus
|
236
|
+
a: b
|
237
|
+
|
238
|
+
\\:foo
|
239
|
+
bar: baz
|
240
|
+
SASS
|
241
|
+
:focus {a: b;}
|
242
|
+
:focus :foo {bar: baz;}
|
243
|
+
CSS
|
244
|
+
end
|
245
|
+
|
233
246
|
private
|
234
247
|
|
235
248
|
def css2sass(string, opts={})
|
data/test/sass/engine_test.rb
CHANGED
@@ -18,8 +18,11 @@ class SassEngineTest < Test::Unit::TestCase
|
|
18
18
|
":" => 'Invalid property: ":".',
|
19
19
|
": a" => 'Invalid property: ": a".',
|
20
20
|
":= a" => 'Invalid property: ":= a".',
|
21
|
-
"a\n :b" =>
|
22
|
-
|
21
|
+
"a\n :b" => <<MSG,
|
22
|
+
Invalid property: ":b" (no value).
|
23
|
+
If ":b" should be a selector, use "\\:b" instead.
|
24
|
+
MSG
|
25
|
+
"a\n b:" => 'Invalid property: "b:" (no value).',
|
23
26
|
"a\n :b: c" => 'Invalid property: ":b: c".',
|
24
27
|
"a\n :b:c d" => 'Invalid property: ":b:c d".',
|
25
28
|
"a\n :b=c d" => 'Invalid property: ":b=c d".',
|
@@ -27,7 +30,12 @@ class SassEngineTest < Test::Unit::TestCase
|
|
27
30
|
"a\n b: c;" => 'Invalid property: "b: c;" (no ";" required at end-of-line).',
|
28
31
|
"a\n b : c" => 'Invalid property: "b : c".',
|
29
32
|
"a\n b=c: d" => 'Invalid property: "b=c: d".',
|
30
|
-
":a" => 'Properties aren\'t allowed at the root of a document.',
|
33
|
+
":a b" => 'Properties aren\'t allowed at the root of a document.',
|
34
|
+
"a:" => 'Properties aren\'t allowed at the root of a document.',
|
35
|
+
":a" => <<MSG,
|
36
|
+
Properties aren't allowed at the root of a document.
|
37
|
+
If ":a" should be a selector, use "\\:a" instead.
|
38
|
+
MSG
|
31
39
|
"!" => 'Invalid variable: "!".',
|
32
40
|
"!a" => 'Invalid variable: "!a".',
|
33
41
|
"! a" => 'Invalid variable: "! a".',
|
@@ -134,7 +142,7 @@ class SassEngineTest < Test::Unit::TestCase
|
|
134
142
|
rescue Sass::SyntaxError => err
|
135
143
|
value = [value] unless value.is_a?(Array)
|
136
144
|
|
137
|
-
assert_equal(value.first, err.message, "Line: #{key}")
|
145
|
+
assert_equal(value.first.rstrip, err.message, "Line: #{key}")
|
138
146
|
assert_equal(__FILE__, err.sass_filename)
|
139
147
|
assert_equal((value[1] || key.split("\n").length) + line - 1, err.sass_line, "Line: #{key}")
|
140
148
|
assert_match(/#{Regexp.escape(__FILE__)}:[0-9]+/, err.backtrace[0], "Line: #{key}")
|
@@ -737,6 +745,27 @@ bang, bip, bop
|
|
737
745
|
SASS
|
738
746
|
end
|
739
747
|
|
748
|
+
def test_root_level_pseudo_class_with_new_properties
|
749
|
+
assert_equal(<<CSS, render(<<SASS, :property_syntax => :new))
|
750
|
+
:focus {
|
751
|
+
outline: 0; }
|
752
|
+
CSS
|
753
|
+
:focus
|
754
|
+
outline: 0
|
755
|
+
SASS
|
756
|
+
end
|
757
|
+
|
758
|
+
def test_pseudo_class_with_new_properties
|
759
|
+
assert_equal(<<CSS, render(<<SASS, :property_syntax => :new))
|
760
|
+
p :focus {
|
761
|
+
outline: 0; }
|
762
|
+
CSS
|
763
|
+
p
|
764
|
+
:focus
|
765
|
+
outline: 0
|
766
|
+
SASS
|
767
|
+
end
|
768
|
+
|
740
769
|
# Regression tests
|
741
770
|
|
742
771
|
def test_parens_in_mixins
|
data/test/test_helper.rb
CHANGED
@@ -9,12 +9,6 @@ require 'sass'
|
|
9
9
|
|
10
10
|
Sass::RAILS_LOADED = true unless defined?(Sass::RAILS_LOADED)
|
11
11
|
|
12
|
-
# required because of Sass::Plugin
|
13
|
-
unless defined? RAILS_ROOT
|
14
|
-
RAILS_ROOT = '.'
|
15
|
-
MERB_ENV = RAILS_ENV = 'testing'
|
16
|
-
end
|
17
|
-
|
18
12
|
class Test::Unit::TestCase
|
19
13
|
def munge_filename(opts)
|
20
14
|
return if opts[:filename]
|
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: 2.2.
|
4
|
+
version: 2.2.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Weizenbaum
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-
|
13
|
+
date: 2009-11-05 00:00:00 -08:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -43,200 +43,200 @@ executables:
|
|
43
43
|
extensions: []
|
44
44
|
|
45
45
|
extra_rdoc_files:
|
46
|
-
- VERSION_NAME
|
47
|
-
- CONTRIBUTING
|
48
|
-
- README.md
|
49
|
-
- MIT-LICENSE
|
50
46
|
- VERSION
|
47
|
+
- MIT-LICENSE
|
48
|
+
- README.md
|
49
|
+
- VERSION_NAME
|
51
50
|
- REVISION
|
51
|
+
- CONTRIBUTING
|
52
52
|
files:
|
53
53
|
- rails/init.rb
|
54
54
|
- lib/sass.rb
|
55
|
-
- lib/sass/
|
56
|
-
- lib/sass/
|
57
|
-
- lib/sass/script/number.rb
|
58
|
-
- lib/sass/script/operation.rb
|
59
|
-
- lib/sass/script/literal.rb
|
60
|
-
- lib/sass/script/functions.rb
|
61
|
-
- lib/sass/script/bool.rb
|
62
|
-
- lib/sass/script/color.rb
|
63
|
-
- lib/sass/script/lexer.rb
|
64
|
-
- lib/sass/script/parser.rb
|
65
|
-
- lib/sass/script/variable.rb
|
66
|
-
- lib/sass/script/string.rb
|
67
|
-
- lib/sass/script/funcall.rb
|
68
|
-
- lib/sass/script/unary_operation.rb
|
55
|
+
- lib/sass/plugin/rails.rb
|
56
|
+
- lib/sass/plugin/merb.rb
|
69
57
|
- lib/sass/script.rb
|
70
58
|
- lib/sass/error.rb
|
71
|
-
- lib/sass/repl.rb
|
72
|
-
- lib/sass/tree/comment_node.rb
|
73
|
-
- lib/sass/tree/node.rb
|
74
59
|
- lib/sass/tree/for_node.rb
|
75
|
-
- lib/sass/tree/debug_node.rb
|
76
|
-
- lib/sass/tree/import_node.rb
|
77
|
-
- lib/sass/tree/while_node.rb
|
78
|
-
- lib/sass/tree/mixin_def_node.rb
|
79
|
-
- lib/sass/tree/if_node.rb
|
80
60
|
- lib/sass/tree/mixin_node.rb
|
81
|
-
- lib/sass/tree/
|
82
|
-
- lib/sass/tree/rule_node.rb
|
61
|
+
- lib/sass/tree/if_node.rb
|
83
62
|
- lib/sass/tree/prop_node.rb
|
63
|
+
- lib/sass/tree/mixin_def_node.rb
|
84
64
|
- lib/sass/tree/variable_node.rb
|
85
|
-
- lib/sass/
|
86
|
-
- lib/sass/
|
87
|
-
- lib/sass/
|
65
|
+
- lib/sass/tree/debug_node.rb
|
66
|
+
- lib/sass/tree/directive_node.rb
|
67
|
+
- lib/sass/tree/node.rb
|
68
|
+
- lib/sass/tree/comment_node.rb
|
69
|
+
- lib/sass/tree/rule_node.rb
|
70
|
+
- lib/sass/tree/import_node.rb
|
71
|
+
- lib/sass/tree/while_node.rb
|
88
72
|
- lib/sass/files.rb
|
89
|
-
- lib/sass/engine.rb
|
90
73
|
- lib/sass/plugin.rb
|
91
|
-
- lib/
|
74
|
+
- lib/sass/script/parser.rb
|
75
|
+
- lib/sass/script/color.rb
|
76
|
+
- lib/sass/script/string.rb
|
77
|
+
- lib/sass/script/unary_operation.rb
|
78
|
+
- lib/sass/script/number.rb
|
79
|
+
- lib/sass/script/funcall.rb
|
80
|
+
- lib/sass/script/variable.rb
|
81
|
+
- lib/sass/script/functions.rb
|
82
|
+
- lib/sass/script/bool.rb
|
83
|
+
- lib/sass/script/lexer.rb
|
84
|
+
- lib/sass/script/operation.rb
|
85
|
+
- lib/sass/script/node.rb
|
86
|
+
- lib/sass/script/literal.rb
|
87
|
+
- lib/sass/css.rb
|
88
|
+
- lib/sass/engine.rb
|
89
|
+
- lib/sass/repl.rb
|
90
|
+
- lib/sass/environment.rb
|
91
|
+
- lib/haml/util.rb
|
92
92
|
- lib/haml/exec.rb
|
93
|
+
- lib/haml/html.rb
|
93
94
|
- lib/haml/error.rb
|
95
|
+
- lib/haml/buffer.rb
|
94
96
|
- lib/haml/template.rb
|
95
|
-
- lib/haml/shared.rb
|
96
|
-
- lib/haml/engine.rb
|
97
|
-
- lib/haml/version.rb
|
98
|
-
- lib/haml/template/patch.rb
|
99
97
|
- lib/haml/template/plugin.rb
|
98
|
+
- lib/haml/template/patch.rb
|
100
99
|
- lib/haml/helpers.rb
|
101
|
-
- lib/haml/
|
102
|
-
- lib/haml/
|
100
|
+
- lib/haml/version.rb
|
101
|
+
- lib/haml/filters.rb
|
102
|
+
- lib/haml/engine.rb
|
103
103
|
- lib/haml/precompiler.rb
|
104
|
-
- lib/haml/
|
104
|
+
- lib/haml/shared.rb
|
105
|
+
- lib/haml/helpers/action_view_extensions.rb
|
105
106
|
- lib/haml/helpers/action_view_mods.rb
|
106
107
|
- lib/haml/helpers/xss_mods.rb
|
107
|
-
- lib/haml/helpers/action_view_extensions.rb
|
108
108
|
- lib/haml.rb
|
109
|
-
- bin/sass
|
110
109
|
- bin/css2sass
|
111
|
-
- bin/
|
110
|
+
- bin/sass
|
112
111
|
- bin/haml
|
113
|
-
-
|
114
|
-
- test/benchmark.rb
|
112
|
+
- bin/html2haml
|
115
113
|
- test/sass/script_test.rb
|
116
|
-
- test/sass/css2sass_test.rb
|
117
|
-
- test/sass/results/units.css
|
118
|
-
- test/sass/results/parent_ref.css
|
119
|
-
- test/sass/results/compressed.css
|
120
|
-
- test/sass/results/complex.css
|
121
|
-
- test/sass/results/compact.css
|
122
|
-
- test/sass/results/mixins.css
|
123
|
-
- test/sass/results/line_numbers.css
|
124
|
-
- test/sass/results/alt.css
|
125
|
-
- test/sass/results/subdir/subdir.css
|
126
|
-
- test/sass/results/subdir/nested_subdir/nested_subdir.css
|
127
|
-
- test/sass/results/nested.css
|
128
|
-
- test/sass/results/import.css
|
129
|
-
- test/sass/results/multiline.css
|
130
|
-
- test/sass/results/script.css
|
131
|
-
- test/sass/results/basic.css
|
132
|
-
- test/sass/results/expanded.css
|
133
|
-
- test/sass/more_results/more_import.css
|
134
114
|
- test/sass/more_results/more1_with_line_comments.css
|
135
115
|
- test/sass/more_results/more1.css
|
136
|
-
- test/sass/
|
137
|
-
- test/sass/templates/
|
116
|
+
- test/sass/more_results/more_import.css
|
117
|
+
- test/sass/templates/bork2.sass
|
138
118
|
- test/sass/templates/compressed.sass
|
139
|
-
- test/sass/templates/import.sass
|
140
|
-
- test/sass/templates/script.sass
|
141
119
|
- test/sass/templates/expanded.sass
|
142
|
-
- test/sass/templates/
|
120
|
+
- test/sass/templates/import.sass
|
121
|
+
- test/sass/templates/subdir/subdir.sass
|
122
|
+
- test/sass/templates/subdir/nested_subdir/_nested_partial.sass
|
123
|
+
- test/sass/templates/subdir/nested_subdir/nested_subdir.sass
|
124
|
+
- test/sass/templates/basic.sass
|
143
125
|
- test/sass/templates/_partial.sass
|
126
|
+
- test/sass/templates/units.sass
|
127
|
+
- test/sass/templates/mixins.sass
|
128
|
+
- test/sass/templates/multiline.sass
|
144
129
|
- test/sass/templates/line_numbers.sass
|
130
|
+
- test/sass/templates/nested.sass
|
145
131
|
- test/sass/templates/compact.sass
|
146
|
-
- test/sass/templates/subdir/subdir.sass
|
147
|
-
- test/sass/templates/subdir/nested_subdir/nested_subdir.sass
|
148
|
-
- test/sass/templates/subdir/nested_subdir/_nested_partial.sass
|
149
|
-
- test/sass/templates/parent_ref.sass
|
150
132
|
- test/sass/templates/alt.sass
|
133
|
+
- test/sass/templates/script.sass
|
151
134
|
- test/sass/templates/importee.sass
|
152
|
-
- test/sass/templates/
|
153
|
-
- test/sass/templates/
|
154
|
-
- test/sass/templates/units.sass
|
135
|
+
- test/sass/templates/parent_ref.sass
|
136
|
+
- test/sass/templates/bork.sass
|
155
137
|
- test/sass/templates/complex.sass
|
156
|
-
- test/sass/
|
157
|
-
- test/sass/
|
138
|
+
- test/sass/css2sass_test.rb
|
139
|
+
- test/sass/plugin_test.rb
|
158
140
|
- test/sass/more_templates/more1.sass
|
159
141
|
- test/sass/more_templates/more_import.sass
|
142
|
+
- test/sass/more_templates/_more_partial.sass
|
160
143
|
- test/sass/functions_test.rb
|
144
|
+
- test/sass/results/nested.css
|
145
|
+
- test/sass/results/units.css
|
146
|
+
- test/sass/results/script.css
|
147
|
+
- test/sass/results/subdir/nested_subdir/nested_subdir.css
|
148
|
+
- test/sass/results/subdir/subdir.css
|
149
|
+
- test/sass/results/import.css
|
150
|
+
- test/sass/results/compact.css
|
151
|
+
- test/sass/results/expanded.css
|
152
|
+
- test/sass/results/alt.css
|
153
|
+
- test/sass/results/mixins.css
|
154
|
+
- test/sass/results/complex.css
|
155
|
+
- test/sass/results/compressed.css
|
156
|
+
- test/sass/results/parent_ref.css
|
157
|
+
- test/sass/results/line_numbers.css
|
158
|
+
- test/sass/results/multiline.css
|
159
|
+
- test/sass/results/basic.css
|
161
160
|
- test/sass/engine_test.rb
|
162
|
-
- test/sass/plugin_test.rb
|
163
161
|
- test/haml/mocks/article.rb
|
164
|
-
- test/haml/rhtml/_av_partial_2.rhtml
|
165
|
-
- test/haml/rhtml/standard.rhtml
|
166
|
-
- test/haml/rhtml/_av_partial_1.rhtml
|
167
|
-
- test/haml/rhtml/action_view.rhtml
|
168
162
|
- test/haml/util_test.rb
|
169
|
-
- test/haml/spec/ruby_haml_test.rb
|
170
|
-
- test/haml/spec/README.md
|
171
|
-
- test/haml/spec/lua_haml_spec.lua
|
172
|
-
- test/haml/spec/tests.json
|
173
|
-
- test/haml/html2haml_test.rb
|
174
163
|
- test/haml/template_test.rb
|
164
|
+
- test/haml/html2haml_test.rb
|
165
|
+
- test/haml/rhtml/_av_partial_1.rhtml
|
166
|
+
- test/haml/rhtml/standard.rhtml
|
167
|
+
- test/haml/rhtml/action_view.rhtml
|
168
|
+
- test/haml/rhtml/_av_partial_2.rhtml
|
175
169
|
- test/haml/helper_test.rb
|
176
|
-
- test/haml/
|
177
|
-
- test/haml/
|
178
|
-
- test/haml/
|
179
|
-
- test/haml/
|
180
|
-
- test/haml/
|
181
|
-
- test/haml/
|
182
|
-
- test/haml/
|
183
|
-
- test/haml/results/partials.xhtml
|
184
|
-
- test/haml/results/eval_suppressed.xhtml
|
185
|
-
- test/haml/results/nuke_inner_whitespace.xhtml
|
186
|
-
- test/haml/results/whitespace_handling.xhtml
|
187
|
-
- test/haml/results/render_layout.xhtml
|
188
|
-
- test/haml/results/silent_script.xhtml
|
189
|
-
- test/haml/results/standard.xhtml
|
190
|
-
- test/haml/results/just_stuff.xhtml
|
191
|
-
- test/haml/results/partial_layout.xhtml
|
192
|
-
- test/haml/results/filters.xhtml
|
193
|
-
- test/haml/results/nuke_outer_whitespace.xhtml
|
194
|
-
- test/haml/markaby/standard.mab
|
195
|
-
- test/haml/templates/tag_parsing.haml
|
196
|
-
- test/haml/templates/nuke_inner_whitespace.haml
|
170
|
+
- test/haml/templates/action_view_ugly.haml
|
171
|
+
- test/haml/templates/list.haml
|
172
|
+
- test/haml/templates/_text_area.haml
|
173
|
+
- test/haml/templates/_partial.haml
|
174
|
+
- test/haml/templates/nuke_outer_whitespace.haml
|
175
|
+
- test/haml/templates/render_layout.haml
|
176
|
+
- test/haml/templates/_av_partial_2.haml
|
197
177
|
- test/haml/templates/partial_layout.haml
|
198
|
-
- test/haml/templates/
|
178
|
+
- test/haml/templates/helpful.haml
|
179
|
+
- test/haml/templates/_av_partial_1_ugly.haml
|
180
|
+
- test/haml/templates/just_stuff.haml
|
181
|
+
- test/haml/templates/standard_ugly.haml
|
182
|
+
- test/haml/templates/silent_script.haml
|
183
|
+
- test/haml/templates/very_basic.haml
|
184
|
+
- test/haml/templates/nuke_inner_whitespace.haml
|
185
|
+
- test/haml/templates/eval_suppressed.haml
|
186
|
+
- test/haml/templates/tag_parsing.haml
|
187
|
+
- test/haml/templates/whitespace_handling.haml
|
199
188
|
- test/haml/templates/partials.haml
|
189
|
+
- test/haml/templates/standard.haml
|
190
|
+
- test/haml/templates/partialize.haml
|
200
191
|
- test/haml/templates/_layout_for_partial.haml
|
201
|
-
- test/haml/templates/
|
202
|
-
- test/haml/templates/
|
192
|
+
- test/haml/templates/_av_partial_1.haml
|
193
|
+
- test/haml/templates/filters.haml
|
203
194
|
- test/haml/templates/_layout.erb
|
204
|
-
- test/haml/templates/action_view_ugly.haml
|
205
195
|
- test/haml/templates/content_for_layout.haml
|
206
|
-
- test/haml/templates/
|
207
|
-
- test/haml/templates/
|
208
|
-
- test/haml/templates/
|
209
|
-
- test/haml/templates/filters.haml
|
210
|
-
- test/haml/templates/_av_partial_1.haml
|
211
|
-
- test/haml/templates/standard_ugly.haml
|
212
|
-
- test/haml/templates/_partial.haml
|
213
|
-
- test/haml/templates/nuke_outer_whitespace.haml
|
196
|
+
- test/haml/templates/_av_partial_2_ugly.haml
|
197
|
+
- test/haml/templates/helpers.haml
|
198
|
+
- test/haml/templates/original_engine.haml
|
214
199
|
- test/haml/templates/breakage.haml
|
215
|
-
- test/haml/templates/list.haml
|
216
|
-
- test/haml/templates/standard.haml
|
217
|
-
- test/haml/templates/whitespace_handling.haml
|
218
|
-
- test/haml/templates/eval_suppressed.haml
|
219
200
|
- test/haml/templates/action_view.haml
|
220
|
-
- test/haml/
|
221
|
-
- test/haml/
|
222
|
-
- test/haml/
|
223
|
-
- test/haml/
|
224
|
-
- test/haml/
|
225
|
-
- test/haml/
|
201
|
+
- test/haml/spec/tests.json
|
202
|
+
- test/haml/spec/lua_haml_spec.lua
|
203
|
+
- test/haml/spec/ruby_haml_test.rb
|
204
|
+
- test/haml/spec/README.md
|
205
|
+
- test/haml/results/content_for_layout.xhtml
|
206
|
+
- test/haml/results/just_stuff.xhtml
|
207
|
+
- test/haml/results/whitespace_handling.xhtml
|
208
|
+
- test/haml/results/nuke_outer_whitespace.xhtml
|
209
|
+
- test/haml/results/silent_script.xhtml
|
210
|
+
- test/haml/results/filters.xhtml
|
211
|
+
- test/haml/results/standard.xhtml
|
212
|
+
- test/haml/results/nuke_inner_whitespace.xhtml
|
213
|
+
- test/haml/results/helpful.xhtml
|
214
|
+
- test/haml/results/very_basic.xhtml
|
215
|
+
- test/haml/results/eval_suppressed.xhtml
|
216
|
+
- test/haml/results/partials.xhtml
|
217
|
+
- test/haml/results/render_layout.xhtml
|
218
|
+
- test/haml/results/original_engine.xhtml
|
219
|
+
- test/haml/results/helpers.xhtml
|
220
|
+
- test/haml/results/list.xhtml
|
221
|
+
- test/haml/results/partial_layout.xhtml
|
222
|
+
- test/haml/results/tag_parsing.xhtml
|
223
|
+
- test/haml/markaby/standard.mab
|
226
224
|
- test/haml/engine_test.rb
|
225
|
+
- test/linked_rails.rb
|
226
|
+
- test/benchmark.rb
|
227
227
|
- test/test_helper.rb
|
228
|
-
- extra/haml-mode.el
|
229
228
|
- extra/sass-mode.el
|
229
|
+
- extra/haml-mode.el
|
230
230
|
- extra/update_watch.rb
|
231
231
|
- Rakefile
|
232
232
|
- init.rb
|
233
233
|
- .yardopts
|
234
|
-
- VERSION_NAME
|
235
|
-
- CONTRIBUTING
|
236
|
-
- README.md
|
237
|
-
- MIT-LICENSE
|
238
234
|
- VERSION
|
235
|
+
- MIT-LICENSE
|
236
|
+
- README.md
|
237
|
+
- VERSION_NAME
|
239
238
|
- REVISION
|
239
|
+
- CONTRIBUTING
|
240
240
|
has_rdoc: true
|
241
241
|
homepage: http://haml.hamptoncatlin.com/
|
242
242
|
licenses: []
|
@@ -268,19 +268,19 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
268
268
|
requirements: []
|
269
269
|
|
270
270
|
rubyforge_project: haml
|
271
|
-
rubygems_version: 1.3.
|
271
|
+
rubygems_version: 1.3.5
|
272
272
|
signing_key:
|
273
273
|
specification_version: 3
|
274
274
|
summary: An elegant, structured XHTML/XML templating engine. Comes with Sass, a similar CSS templating engine.
|
275
275
|
test_files:
|
276
276
|
- test/sass/script_test.rb
|
277
277
|
- test/sass/css2sass_test.rb
|
278
|
+
- test/sass/plugin_test.rb
|
278
279
|
- test/sass/functions_test.rb
|
279
280
|
- test/sass/engine_test.rb
|
280
|
-
- test/sass/plugin_test.rb
|
281
281
|
- test/haml/util_test.rb
|
282
|
-
- test/haml/spec/ruby_haml_test.rb
|
283
|
-
- test/haml/html2haml_test.rb
|
284
282
|
- test/haml/template_test.rb
|
283
|
+
- test/haml/html2haml_test.rb
|
285
284
|
- test/haml/helper_test.rb
|
285
|
+
- test/haml/spec/ruby_haml_test.rb
|
286
286
|
- test/haml/engine_test.rb
|