diff --git a/lib/compass.rb b/lib/compass.rb index f9c638d8..12aca135 100644 --- a/lib/compass.rb +++ b/lib/compass.rb @@ -1,5 +1,19 @@ require 'rubygems' require 'sass' + +def assert_sass_version(obj) + unless obj.respond_to?(:version) && obj.version[:major] == 2 && obj.version[:minor] >= 1 + raise LoadError.new("Compass requires Haml version 2.1 or greater.") + end +end + +begin + assert_sass_version(Sass) +rescue LoadError + require 'haml' + assert_sass_version(Haml) +end + require File.join(File.dirname(__FILE__), 'sass_extensions') ['core_ext', 'version'].each do |file|