Give a better error message to users with an unsupported version of haml installed.
This commit is contained in:
parent
c8e07b4228
commit
911041f355
@ -1,5 +1,19 @@
|
|||||||
require 'rubygems'
|
require 'rubygems'
|
||||||
require 'sass'
|
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')
|
require File.join(File.dirname(__FILE__), 'sass_extensions')
|
||||||
|
|
||||||
['core_ext', 'version'].each do |file|
|
['core_ext', 'version'].each do |file|
|
||||||
|
Loading…
Reference in New Issue
Block a user