1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Merge branch 'master' into scss

Conflicts:
	lib/sass/engine.rb
	test/test_helper.rb
This commit is contained in:
Nathan Weizenbaum 2009-12-28 01:57:08 -08:00
commit 7fe854df79
5 changed files with 15 additions and 6 deletions

View file

@ -103,6 +103,10 @@ Several bug fixes and minor improvements have been made, including:
and `tealbang(12)` now renders as `tealbang(12)`
rather than `teal bang(12)`.
## 2.2.17 (Unreleased)
* Report the filename in warnings about selectors without properties.
## [2.2.16](http://github.com/nex3/haml/commit/2.2.16)
* When the {file:SASS_REFERENCE.md#full_exception-option `:full_exception` option}

View file

@ -310,13 +310,13 @@ END
return unless node.is_a?(Tree::RuleNode) && node.children.empty?
warning = (node.rule.include?("\n")) ? <<LONG : <<SHORT
WARNING on line #{node.line}:
WARNING on line #{node.line}#{" of #{node.filename}" if node.filename}:
Selector
#{node.rule.gsub("\n", "\n ")}
doesn't have any properties and will not be rendered.
LONG
WARNING on line #{node.line}:
WARNING on line #{node.line}#{" of #{node.filename}" if node.filename}:
Selector #{node.rule.inspect} doesn't have any properties and will not be rendered.
SHORT

View file

@ -66,7 +66,7 @@ module Sass
#
# @return [String]
def filename
@filename || @options[:filename]
@filename || (@options && @options[:filename])
end
# Appends a child to the node.

View file

@ -965,12 +965,12 @@ SASS
def test_empty_selector_warning
assert_warning(<<END) {render("foo bar")}
WARNING on line 1:
WARNING on line 1 of test_empty_selector_warning_inline.sass:
Selector "foo bar" doesn't have any properties and will not be rendered.
END
assert_warning(<<END) {render(<<SASS)}
WARNING on line 3:
WARNING on line 3 of test_empty_selector_warning_inline.sass:
Selector
foo, bar, baz,
bang, bip, bop
@ -981,6 +981,11 @@ END
foo, bar, baz,
bang, bip, bop
SASS
assert_warning(<<END) {render("foo bar", :filename => nil)}
WARNING on line 1:
Selector "foo bar" doesn't have any properties and will not be rendered.
END
end
def test_root_level_pseudo_class_with_new_properties

View file

@ -16,7 +16,7 @@ end
class Test::Unit::TestCase
def munge_filename(opts = {})
return if opts[:filename]
return if opts.has_key?(:filename)
opts[:filename] = filename_for_test
end