[Haml] Don't kill rake gems:install if only the plugin skeleton is installed.

Closes gh-55
This commit is contained in:
Nathan Weizenbaum 2009-11-05 18:19:18 -08:00
parent 18db0f6338
commit add68bb641
3 changed files with 15 additions and 3 deletions

View File

@ -27,6 +27,8 @@
This is consistent with the behavior of multiple ids
when one is specified as a standard attribute.
* Don't crash if the plugin skeleton is installed and `rake gems:install` is run.
## [2.2.10](http://github.com/nex3/haml/commit/2.2.10)
* Fixed a bug where elements with dynamic attributes and no content

View File

@ -14,6 +14,8 @@
* Fixed `css2sass`'s generation of pseudo-classes so that they're backslash-escaped.
* Don't crash if the Haml plugin skeleton is installed and `rake gems:install` is run.
## [2.2.10](http://github.com/nex3/haml/commit/2.2.10)
* Add support for attribute selectors with spaces around the `=`.

14
init.rb
View File

@ -1,8 +1,16 @@
begin
require File.join(File.dirname(__FILE__), 'lib', 'haml') # From here
rescue LoadError
require 'haml' # From gem
begin
require 'haml' # From gem
rescue LoadError => e
# gems:install may be run to install Haml with the skeleton plugin
# but not the gem itself installed.
# Don't die if this is the case.
raise e unless defined?(Rake) && Rake.application.top_level_tasks.include?('gems:install')
end
end
# Load Haml and Sass
Haml.init_rails(binding)
# Load Haml and Sass.
# Haml may be undefined if we're running gems:install.
Haml.init_rails(binding) if defined?(Haml)