Support older Rails versions.

This commit is contained in:
Nathan Weizenbaum
2010-09-06 23:46:51 -07:00
parent 66f2c9f3db
commit 4b7992f12c
2 changed files with 19 additions and 0 deletions

18
init.rb Normal file
View File

@@ -0,0 +1,18 @@
begin
require File.join(File.dirname(__FILE__), 'lib', 'sass') # From here
rescue LoadError
begin
require 'sass' # 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') ||
Rake.application.top_level_tasks.include?('gems:install'))
end
end
# Load Sass.
# Sass may be undefined if we're running gems:install.
require 'sass/plugin' if defined?(Sass)

1
rails/init.rb Normal file
View File

@@ -0,0 +1 @@
Kernel.load File.join(File.dirname(__FILE__), '..', 'init.rb')