Give a better error message to users with an unsupported version of haml installed.

This commit is contained in:
Chris Eppstein 2009-01-25 11:28:11 -08:00
parent c8e07b4228
commit 911041f355

View File

@ -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|