Factor out the css_path and sass_path methods for accessing the full path to respective compass project directories.
This commit is contained in:
parent
9a9b0b3d43
commit
2c7eede9fb
@ -105,6 +105,18 @@ module Compass
|
|||||||
environment == :development
|
environment == :development
|
||||||
end
|
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
|
def serialize
|
||||||
contents = ""
|
contents = ""
|
||||||
required_libraries.each do |lib|
|
required_libraries.each do |lib|
|
||||||
@ -131,15 +143,10 @@ module Compass
|
|||||||
end
|
end
|
||||||
|
|
||||||
def to_sass_plugin_options
|
def to_sass_plugin_options
|
||||||
if project_path && sass_dir && css_dir
|
locations = {}
|
||||||
proj_sass_path = File.join(project_path, sass_dir)
|
locations[sass_path] = css_path if sass_path && css_path
|
||||||
proj_css_path = File.join(project_path, css_dir)
|
|
||||||
locations = {proj_sass_path => proj_css_path}
|
|
||||||
else
|
|
||||||
locations = {}
|
|
||||||
end
|
|
||||||
Compass::Frameworks::ALL.each do |framework|
|
Compass::Frameworks::ALL.each do |framework|
|
||||||
locations[framework.stylesheets_directory] = proj_css_path || css_dir || "."
|
locations[framework.stylesheets_directory] = css_path || css_dir || "."
|
||||||
end
|
end
|
||||||
plugin_opts = {:template_location => locations}
|
plugin_opts = {:template_location => locations}
|
||||||
plugin_opts[:style] = output_style if output_style
|
plugin_opts[:style] = output_style if output_style
|
||||||
@ -156,9 +163,7 @@ module Compass
|
|||||||
|
|
||||||
def sass_load_paths
|
def sass_load_paths
|
||||||
load_paths = []
|
load_paths = []
|
||||||
if project_path && sass_dir
|
load_paths << sass_path if sass_path
|
||||||
load_paths << File.join(project_path, sass_dir)
|
|
||||||
end
|
|
||||||
Compass::Frameworks::ALL.each do |framework|
|
Compass::Frameworks::ALL.each do |framework|
|
||||||
load_paths << framework.stylesheets_directory
|
load_paths << framework.stylesheets_directory
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user