Factor out the css_path and sass_path methods for accessing the full path to respective compass project directories.

This commit is contained in:
Chris Eppstein 2009-05-07 20:05:51 -07:00
parent 9a9b0b3d43
commit 2c7eede9fb

View File

@ -105,6 +105,18 @@ module Compass
environment == :development
end
def sass_path
if project_path && sass_dir
File.join(project_path, sass_dir)
end
end
def css_path
if project_path && css_dir
File.join(project_path, css_dir)
end
end
def serialize
contents = ""
required_libraries.each do |lib|
@ -131,15 +143,10 @@ module Compass
end
def to_sass_plugin_options
if project_path && sass_dir && css_dir
proj_sass_path = File.join(project_path, sass_dir)
proj_css_path = File.join(project_path, css_dir)
locations = {proj_sass_path => proj_css_path}
else
locations = {}
end
locations = {}
locations[sass_path] = css_path if sass_path && css_path
Compass::Frameworks::ALL.each do |framework|
locations[framework.stylesheets_directory] = proj_css_path || css_dir || "."
locations[framework.stylesheets_directory] = css_path || css_dir || "."
end
plugin_opts = {:template_location => locations}
plugin_opts[:style] = output_style if output_style
@ -156,9 +163,7 @@ module Compass
def sass_load_paths
load_paths = []
if project_path && sass_dir
load_paths << File.join(project_path, sass_dir)
end
load_paths << sass_path if sass_path
Compass::Frameworks::ALL.each do |framework|
load_paths << framework.stylesheets_directory
end