2009-08-25 21:18:58 +00:00
|
|
|
module Compass
|
|
|
|
module Configuration
|
|
|
|
module Defaults
|
|
|
|
|
2010-02-13 19:40:02 +00:00
|
|
|
def default_project_path
|
|
|
|
"."
|
|
|
|
end
|
|
|
|
|
2009-08-29 19:09:32 +00:00
|
|
|
def default_project_type
|
|
|
|
:stand_alone
|
|
|
|
end
|
|
|
|
|
2009-08-25 21:18:58 +00:00
|
|
|
def http_path_without_default
|
|
|
|
"/"
|
|
|
|
end
|
|
|
|
|
2009-07-27 05:47:59 +00:00
|
|
|
def default_extensions_dir
|
|
|
|
"extensions"
|
|
|
|
end
|
|
|
|
|
2009-11-28 01:10:48 +00:00
|
|
|
def default_fonts_dir
|
|
|
|
File.join(top_level.css_dir, "fonts")
|
|
|
|
end
|
|
|
|
|
2009-11-30 03:05:40 +00:00
|
|
|
def default_environment
|
|
|
|
:development
|
|
|
|
end
|
|
|
|
|
2009-08-25 21:18:58 +00:00
|
|
|
def default_output_style
|
|
|
|
if top_level.environment == :development
|
|
|
|
:expanded
|
|
|
|
else
|
2011-04-25 02:57:45 +00:00
|
|
|
:compressed
|
2009-08-25 21:18:58 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def default_line_comments
|
|
|
|
top_level.environment == :development
|
|
|
|
end
|
|
|
|
|
2009-11-30 04:17:30 +00:00
|
|
|
def default_color_output
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
2009-08-25 21:18:58 +00:00
|
|
|
def default_sass_path
|
|
|
|
if (pp = top_level.project_path) && (dir = top_level.sass_dir)
|
2010-08-25 15:39:59 +00:00
|
|
|
Compass.projectize(dir, pp)
|
2009-08-25 21:18:58 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def default_css_path
|
|
|
|
if (pp = top_level.project_path) && (dir = top_level.css_dir)
|
2010-08-25 15:39:59 +00:00
|
|
|
Compass.projectize(dir, pp)
|
2009-08-25 21:18:58 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def default_images_path
|
|
|
|
if (pp = top_level.project_path) && (dir = top_level.images_dir)
|
2010-08-25 15:39:59 +00:00
|
|
|
Compass.projectize(dir, pp)
|
2009-08-25 21:18:58 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def default_javascripts_path
|
|
|
|
if (pp = top_level.project_path) && (dir = top_level.javascripts_dir)
|
2010-08-25 15:39:59 +00:00
|
|
|
Compass.projectize(dir, pp)
|
2009-08-25 21:18:58 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2009-07-27 05:47:59 +00:00
|
|
|
def default_extensions_path
|
|
|
|
if (pp = top_level.project_path) && (dir = top_level.extensions_dir)
|
2010-08-25 15:39:59 +00:00
|
|
|
Compass.projectize(dir, pp)
|
2009-07-27 05:47:59 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2009-11-28 01:10:48 +00:00
|
|
|
def default_fonts_path
|
|
|
|
if (pp = top_level.project_path) && (dir = top_level.fonts_dir)
|
2010-08-25 15:39:59 +00:00
|
|
|
Compass.projectize(dir, pp)
|
2009-11-28 01:10:48 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2009-12-01 17:57:49 +00:00
|
|
|
def default_cache_path
|
|
|
|
if (pp = top_level.project_path) && (dir = top_level.cache_dir)
|
2010-08-25 15:39:59 +00:00
|
|
|
Compass.projectize(dir, pp)
|
2009-12-01 17:57:49 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2009-07-27 05:47:59 +00:00
|
|
|
|
2009-08-25 21:18:58 +00:00
|
|
|
def default_http_images_dir
|
|
|
|
top_level.images_dir
|
|
|
|
end
|
|
|
|
|
|
|
|
def default_http_images_path
|
|
|
|
http_root_relative top_level.http_images_dir
|
|
|
|
end
|
|
|
|
|
|
|
|
def default_http_stylesheets_dir
|
|
|
|
top_level.css_dir
|
|
|
|
end
|
|
|
|
|
|
|
|
def default_http_stylesheets_path
|
|
|
|
http_root_relative top_level.http_stylesheets_dir
|
|
|
|
end
|
|
|
|
|
2009-11-28 01:10:48 +00:00
|
|
|
def default_http_fonts_dir
|
|
|
|
if fd = top_level.fonts_dir_without_default
|
|
|
|
fd
|
|
|
|
else
|
|
|
|
"#{top_level.http_stylesheets_dir}/fonts"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def default_http_fonts_path
|
|
|
|
http_root_relative top_level.http_fonts_dir
|
|
|
|
end
|
|
|
|
|
2009-08-25 21:18:58 +00:00
|
|
|
def default_http_javascripts_dir
|
|
|
|
top_level.javascripts_dir
|
|
|
|
end
|
|
|
|
|
|
|
|
def default_http_javascripts_path
|
|
|
|
http_root_relative top_level.http_javascripts_dir
|
|
|
|
end
|
|
|
|
|
2009-12-01 17:57:49 +00:00
|
|
|
def default_cache
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
2010-04-12 03:14:52 +00:00
|
|
|
def default_preferred_syntax
|
|
|
|
:scss
|
|
|
|
end
|
2011-03-02 18:55:25 +00:00
|
|
|
|
|
|
|
def default_sprite_engine
|
|
|
|
:chunky_png
|
|
|
|
end
|
|
|
|
|
2009-08-25 21:18:58 +00:00
|
|
|
# helper functions
|
|
|
|
|
|
|
|
def http_join(*segments)
|
|
|
|
segments.map do |segment|
|
2009-11-14 17:42:37 +00:00
|
|
|
next unless segment
|
2009-08-25 21:18:58 +00:00
|
|
|
segment = http_pathify(segment)
|
|
|
|
segment[-1..-1] == "/" ? segment[0..-2] : segment
|
|
|
|
end.join("/")
|
|
|
|
end
|
|
|
|
|
|
|
|
def http_pathify(path)
|
|
|
|
if File::SEPARATOR == "/"
|
|
|
|
path
|
|
|
|
else
|
|
|
|
path.gsub(File::SEPARATOR, "/")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def http_root_relative(path)
|
|
|
|
http_join top_level.http_path, path
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
2009-11-14 17:42:37 +00:00
|
|
|
end
|