Merge branch 'stable'

Conflicts:

	lib/haml/precompiler.rb
This commit is contained in:
Nathan Weizenbaum 2008-07-10 23:40:20 -04:00
commit f42e750f65
2 changed files with 10 additions and 7 deletions

View File

@ -270,13 +270,9 @@ END
# Adds +text+ to <tt>@buffer</tt> while flattening text.
def push_flat(line)
unless @options[:ugly]
text = line.full.dup
text = "" unless text.gsub!(/^#{@flat_spaces}/, '')
@filter_buffer << "#{text}\n"
else
@filter_buffer << "#{line.unstripped}\n"
end
text = line.full.dup
text = "" unless text.gsub!(/^#{@flat_spaces}/, '')
@filter_buffer << "#{text}\n"
end
# Causes <tt>text</tt> to be evaluated in the context of

View File

@ -500,6 +500,13 @@ SOURCE
END
end
def test_ugly_filter
assert_equal(<<END, render(":sass\n #foo\n bar: baz", :ugly => true))
#foo {
bar: baz; }
END
end
def test_local_assigns_dont_modify_class
assert_equal("bar\n", render("= foo", :locals => {:foo => 'bar'}))
assert_equal(nil, defined?(foo))