2008-05-20 15:17:38 -04:00
|
|
|
begin
|
|
|
|
require File.join(File.dirname(__FILE__), 'lib', 'haml') # From here
|
|
|
|
rescue LoadError
|
2009-11-05 21:19:18 -05:00
|
|
|
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.
|
2010-03-23 06:52:20 -04:00
|
|
|
raise e unless defined?(Rake) &&
|
|
|
|
(Rake.application.top_level_tasks.include?('gems') ||
|
|
|
|
Rake.application.top_level_tasks.include?('gems:install'))
|
2009-11-05 21:19:18 -05:00
|
|
|
end
|
2008-05-20 15:17:38 -04:00
|
|
|
end
|
|
|
|
|
2009-11-05 21:19:18 -05:00
|
|
|
# Load Haml and Sass.
|
|
|
|
# Haml may be undefined if we're running gems:install.
|
|
|
|
Haml.init_rails(binding) if defined?(Haml)
|