compass/lib/compass.rb
Michael Schubert & Sam Obukwelu 2d4e0e400f Fix for Compass.shared_extension_paths when HOME is a relative path.
This should fully resolve https://github.com/chriseppstein/compass/issues/364 for when HOME is not just nil but also "." (or any other relative path). Added a complete set of unit tests around the method as well.
2012-03-08 12:05:56 -05:00

35 lines
847 B
Ruby

module Compass
end
%w(dependencies util browser_support sass_extensions version errors quick_cache logger).each do |lib|
require "compass/#{lib}"
end
require 'sass/callbacks'
module Compass
def base_directory
File.expand_path(File.join(File.dirname(__FILE__), '..'))
end
def lib_directory
File.expand_path(File.join(File.dirname(__FILE__)))
end
def shared_extension_paths
@shared_extension_paths ||= begin
if ENV["HOME"] && File.directory?(ENV["HOME"])
[File.expand_path("~/.compass/extensions")]
else
[]
end
rescue ArgumentError # If HOME is relative
[]
end
end
module_function :base_directory, :lib_directory, :shared_extension_paths
extend QuickCache
end
%w(configuration frameworks app_integration actions compiler).each do |lib|
require "compass/#{lib}"
end