diff --git a/doc-src/HAML_CHANGELOG.md b/doc-src/HAML_CHANGELOG.md index 0fff071e..b9d5c11e 100644 --- a/doc-src/HAML_CHANGELOG.md +++ b/doc-src/HAML_CHANGELOG.md @@ -28,6 +28,10 @@ of the many and varied [Haml implementations](http://en.wikipedia.org/wiki/Haml# * Made the error message when unable to load a dependency for html2haml respect the `--trace` option. +* Don't crash when the `__FILE__` constant of a Ruby file is a relative path, + as apparently happens sometimes in TextMate + (thanks to [Karl Varga](http://github.com/kjvarga). + ## [2.2.5](http://github.com/nex3/haml/commit/2.2.5) * Got rid of trailing whitespace produced when opening a conditional comment diff --git a/doc-src/SASS_CHANGELOG.md b/doc-src/SASS_CHANGELOG.md index 2df6b489..37858ad0 100644 --- a/doc-src/SASS_CHANGELOG.md +++ b/doc-src/SASS_CHANGELOG.md @@ -16,6 +16,12 @@ In addition, when the `sass` executable encounters an error, it now prints the filename where the error occurs, as well as a backtrace of Sass imports. +## 2.2.6 (Unreleased) + +* Don't crash when the `__FILE__` constant of a Ruby file is a relative path, + as apparently happens sometimes in TextMate + (thanks to [Karl Varga](http://github.com/kjvarga). + ## [2.2.5](http://github.com/nex3/haml/commit/2.2.5) There were no changes made to Sass between versions 2.2.4 and 2.2.5. diff --git a/lib/haml/util.rb b/lib/haml/util.rb index 56c4af50..42e2254d 100644 --- a/lib/haml/util.rb +++ b/lib/haml/util.rb @@ -15,7 +15,7 @@ module Haml # @param file [String] The filename relative to the Haml root # @return [String] The filename relative to the the working directory def scope(file) - File.join(File.dirname(File.dirname(File.dirname(__FILE__))), file) + File.join(File.dirname(File.dirname(File.dirname(File.expand_path(__FILE__)))), file) end # Converts an array of `[key, value]` pairs to a hash.