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

Merge branch 'stable'

Conflicts:
	lib/sass/files.rb
This commit is contained in:
Nathan Weizenbaum 2010-03-23 20:07:05 -07:00
commit f4b8707f01
4 changed files with 29 additions and 4 deletions

View file

@ -250,6 +250,13 @@ Several bug fixes and minor improvements have been made, including:
* Don't crash when `rake gems` is run in Rails with Sass installed.
Thanks to [Florian Frank](http://github.com/flori).
* When raising a file-not-found error,
add a list of load paths that were checked.
* If an import isn't found for a cached Sass file and the
{file:SASS_REFERENCE.md#full_exception `:full_exception option`} is enabled,
print the full exception rather than raising it.
## 2.2.22
[Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.22).

View file

@ -79,7 +79,15 @@ If you really need #{filename}.css, import it explicitly.
END
return filename + '.css'
end
raise SyntaxError.new("File to import not found or unreadable: #{original_filename}.")
message = "File to import not found or unreadable: #{original_filename}.\n"
if load_paths.size == 1
message << "Load path: #{load_paths.first}"
else
message << "Load paths:\n " << load_paths.join("\n ")
end
raise SyntaxError.new(message)
end
private

View file

@ -396,8 +396,13 @@ module Sass
def dependency_updated?(css_mtime)
lambda do |dep|
File.mtime(dep) > css_mtime ||
dependencies(dep).any?(&dependency_updated?(css_mtime))
begin
File.mtime(dep) > css_mtime ||
dependencies(dep).any?(&dependency_updated?(css_mtime))
rescue Sass::SyntaxError
# If there's an error finding depenencies, default to recompiling.
true
end
end
end

View file

@ -57,7 +57,12 @@ MSG
"a," => "Rules can\'t end in commas.",
"a,\n!b = 1" => ["Rules can\'t end in commas.", 1],
"!a = b\n :c d\n" => "Illegal nesting: Nothing may be nested beneath variable declarations.",
"@import foo.sass" => "File to import not found or unreadable: foo.sass.",
"@import foo.sass" => <<MSG,
File to import not found or unreadable: foo.sass.
Load paths:
test/sass
.
MSG
"@import templates/basic\n foo" => "Illegal nesting: Nothing may be nested beneath import directives.",
"foo\n @import templates/basic" => "Import directives may only be used at the root of a document.",
"foo\n @import #{File.dirname(__FILE__)}/templates/basic" => "Import directives may only be used at the root of a document.",