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:
commit
0e9d41b286
4 changed files with 31 additions and 10 deletions
|
@ -116,6 +116,14 @@ Several bug fixes and minor improvements have been made, including:
|
||||||
|
|
||||||
* Report the filename in warnings about selectors without properties.
|
* Report the filename in warnings about selectors without properties.
|
||||||
|
|
||||||
|
### Must Read!
|
||||||
|
|
||||||
|
* When `@import` is given a filename without an extension,
|
||||||
|
the behavior of rendering a CSS `@import` if no Sass file is found
|
||||||
|
is deprecated.
|
||||||
|
In future versions, `@import foo` will either import the template
|
||||||
|
or raise an error.
|
||||||
|
|
||||||
## [2.2.16](http://github.com/nex3/haml/commit/2.2.16)
|
## [2.2.16](http://github.com/nex3/haml/commit/2.2.16)
|
||||||
|
|
||||||
* Fixed a bug where modules containing user-defined Sass functions
|
* Fixed a bug where modules containing user-defined Sass functions
|
||||||
|
|
|
@ -449,13 +449,16 @@ using the [`:load_paths`](#load_paths-option) option.
|
||||||
|
|
||||||
`@import` takes a filename with or without an extension.
|
`@import` takes a filename with or without an extension.
|
||||||
If an extension isn't provided,
|
If an extension isn't provided,
|
||||||
Sass will try to find a Sass file with the given basename in the load paths,
|
Sass will try to find a Sass file with the given basename in the load paths.
|
||||||
and, failing that, will assume a relevant CSS file will be available.
|
|
||||||
|
|
||||||
For example,
|
For example,
|
||||||
|
|
||||||
@import foo.sass
|
@import foo.sass
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
@import foo
|
||||||
|
|
||||||
would compile to
|
would compile to
|
||||||
|
|
||||||
.foo {
|
.foo {
|
||||||
|
@ -469,13 +472,6 @@ would compile to
|
||||||
|
|
||||||
@import foo.css;
|
@import foo.css;
|
||||||
|
|
||||||
Finally,
|
|
||||||
|
|
||||||
@import foo
|
|
||||||
|
|
||||||
might compile to either,
|
|
||||||
depending on whether or not a file called "foo.sass" existed.
|
|
||||||
|
|
||||||
#### Partials {#partials}
|
#### Partials {#partials}
|
||||||
|
|
||||||
If you have a Sass file that you want to import
|
If you have a Sass file that you want to import
|
||||||
|
|
|
@ -71,7 +71,14 @@ module Sass
|
||||||
new_filename = find_full_path("#{filename}.sass", load_paths)
|
new_filename = find_full_path("#{filename}.sass", load_paths)
|
||||||
|
|
||||||
return new_filename if new_filename
|
return new_filename if new_filename
|
||||||
return filename + '.css' unless was_sass
|
unless was_sass
|
||||||
|
warn <<END
|
||||||
|
WARNING: #{filename}.sass not found. Using #{filename}.css instead.
|
||||||
|
This behavior is deprecated and will be removed in a future version.
|
||||||
|
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}.")
|
raise SyntaxError.new("File to import not found or unreadable: #{original_filename}.")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -424,6 +424,16 @@ CSS
|
||||||
assert File.exists?(sassc_path("importee"))
|
assert File.exists?(sassc_path("importee"))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_nonexistent_extensionless_import
|
||||||
|
assert_warning(<<WARN) do
|
||||||
|
WARNING: nonexistent.sass not found. Using nonexistent.css instead.
|
||||||
|
This behavior is deprecated and will be removed in a future version.
|
||||||
|
If you really need nonexistent.css, import it explicitly.
|
||||||
|
WARN
|
||||||
|
assert_equal("@import url(nonexistent.css);\n", render("@import nonexistent"))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_no_cache
|
def test_no_cache
|
||||||
assert !File.exists?(sassc_path("importee"))
|
assert !File.exists?(sassc_path("importee"))
|
||||||
renders_correctly("import", {
|
renders_correctly("import", {
|
||||||
|
|
Loading…
Add table
Reference in a new issue