[Configuration] The sass cache location can now be set in the compass config file using the cache_dir property and the cache can be disabled by setting cache = false.

This commit is contained in:
Chris Eppstein 2009-12-01 09:57:49 -08:00
parent c60aca3d96
commit fd058fae04
5 changed files with 25 additions and 1 deletions

View File

@ -36,7 +36,11 @@ module Compass
end end
def default_extensions_dir def default_extensions_dir
"vendor/plugins/compass/extensions" File.join("vendor", "plugins", "compass", "extensions")
end
def default_cache_dir
File.join("tmp", "sass-cache")
end end
end end

View File

@ -21,6 +21,10 @@ module Compass
def images_dir_without_default def images_dir_without_default
"images" "images"
end end
def default_cache_dir
".sass-cache"
end
end end
end end

View File

@ -29,6 +29,8 @@ module Compass
:relative_assets, :relative_assets,
:additional_import_paths, :additional_import_paths,
:sass_options, :sass_options,
attributes_for_directory(:cache, nil),
:cache,
# Helper configuration # Helper configuration
:asset_host, :asset_host,
:asset_cache_buster, :asset_cache_buster,

View File

@ -19,6 +19,8 @@ module Compass
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
plugin_opts[:line_comments] = line_comments plugin_opts[:line_comments] = line_comments
plugin_opts[:cache] = cache
plugin_opts[:cache_location] = cache_path
plugin_opts.merge!(sass_options || {}) plugin_opts.merge!(sass_options || {})
plugin_opts plugin_opts
end end
@ -42,6 +44,8 @@ module Compass
engine_opts = {:load_paths => sass_load_paths} engine_opts = {:load_paths => sass_load_paths}
engine_opts[:style] = output_style if output_style engine_opts[:style] = output_style if output_style
engine_opts[:line_comments] = line_comments engine_opts[:line_comments] = line_comments
engine_opts[:cache] = cache
engine_opts[:cache_location] = cache_path
engine_opts.merge!(sass_options || {}) engine_opts.merge!(sass_options || {})
end end

View File

@ -74,6 +74,12 @@ module Compass
end end
end end
def default_cache_path
if (pp = top_level.project_path) && (dir = top_level.cache_dir)
File.join(pp, dir)
end
end
def default_http_images_dir def default_http_images_dir
top_level.images_dir top_level.images_dir
@ -111,6 +117,10 @@ module Compass
http_root_relative top_level.http_javascripts_dir http_root_relative top_level.http_javascripts_dir
end end
def default_cache
true
end
# helper functions # helper functions
def http_join(*segments) def http_join(*segments)