Module: Compass::Configuration::Defaults
- Defined in:
- lib/compass/configuration/defaults.rb
Instance Method Summary collapse
- #default_cache ⇒ Object
- #default_cache_dir ⇒ Object
- #default_cache_path ⇒ Object
- #default_chunky_png_options ⇒ Object
- #default_color_output ⇒ Object
- #default_css_dir ⇒ Object
- #default_css_path ⇒ Object
- #default_environment ⇒ Object
- #default_extensions_dir ⇒ Object
- #default_extensions_path ⇒ Object
- #default_fonts_dir ⇒ Object
- #default_fonts_path ⇒ Object
- #default_generated_images_dir ⇒ Object
- #default_generated_images_path ⇒ Object
- #default_http_fonts_dir ⇒ Object
- #default_http_fonts_path ⇒ Object
- #default_http_generated_images_dir ⇒ Object
- #default_http_generated_images_path ⇒ Object
- #default_http_images_dir ⇒ Object
- #default_http_images_path ⇒ Object
- #default_http_javascripts_dir ⇒ Object
- #default_http_javascripts_path ⇒ Object
- #default_http_path ⇒ Object
- #default_http_stylesheets_dir ⇒ Object
- #default_http_stylesheets_path ⇒ Object
- #default_images_dir ⇒ Object
- #default_images_path ⇒ Object
- #default_javascripts_path ⇒ Object
- #default_line_comments ⇒ Object
- #default_output_style ⇒ Object
- #default_preferred_syntax ⇒ Object
- #default_project_path ⇒ Object
- #default_project_type ⇒ Object
- #default_sass_dir ⇒ Object
- #default_sass_path ⇒ Object
- #default_sprite_engine ⇒ Object
- #default_sprite_load_path ⇒ Object
-
#http_join(*segments) ⇒ Object
helper functions.
- #http_pathify(path) ⇒ Object
- #http_root_relative(path) ⇒ Object
Instance Method Details
#default_cache ⇒ Object
164 165 166 |
# File 'lib/compass/configuration/defaults.rb', line 164 def default_cache true end |
#default_cache_dir ⇒ Object
100 101 102 |
# File 'lib/compass/configuration/defaults.rb', line 100 def default_cache_dir ".sass-cache" end |
#default_cache_path ⇒ Object
104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/compass/configuration/defaults.rb', line 104 def default_cache_path if (pp = top_level.project_path) && (dir = top_level.cache_dir_without_default) Compass.projectize(dir, pp) # TODO We should make Sass::Plugin.options a configuration source instead of # TODO one-offing it like this. elsif defined?(Sass::Plugin) && Sass::Plugin.[:cache_location] File.(Sass::Plugin.[:cache_location]) elsif (pp = top_level.project_path) && (dir = top_level.cache_dir) Compass.projectize(dir, pp) end end |
#default_chunky_png_options ⇒ Object
176 177 178 179 180 181 182 |
# File 'lib/compass/configuration/defaults.rb', line 176 def if defined?(::Zlib) {:compression => Zlib::BEST_COMPRESSION} else {} end end |
#default_color_output ⇒ Object
52 53 54 |
# File 'lib/compass/configuration/defaults.rb', line 52 def default_color_output true end |
#default_css_dir ⇒ Object
20 21 22 |
# File 'lib/compass/configuration/defaults.rb', line 20 def default_css_dir "stylesheets" end |
#default_css_path ⇒ Object
62 63 64 65 66 |
# File 'lib/compass/configuration/defaults.rb', line 62 def default_css_path if (pp = top_level.project_path) && (dir = top_level.css_dir) Compass.projectize(dir, pp) end end |
#default_environment ⇒ Object
36 37 38 |
# File 'lib/compass/configuration/defaults.rb', line 36 def default_environment :development end |
#default_extensions_dir ⇒ Object
16 17 18 |
# File 'lib/compass/configuration/defaults.rb', line 16 def default_extensions_dir "extensions" end |
#default_extensions_path ⇒ Object
88 89 90 91 92 |
# File 'lib/compass/configuration/defaults.rb', line 88 def default_extensions_path if (pp = top_level.project_path) && (dir = top_level.extensions_dir) Compass.projectize(dir, pp) end end |
#default_fonts_dir ⇒ Object
28 29 30 |
# File 'lib/compass/configuration/defaults.rb', line 28 def default_fonts_dir "fonts" end |
#default_fonts_path ⇒ Object
94 95 96 97 98 |
# File 'lib/compass/configuration/defaults.rb', line 94 def default_fonts_path if (pp = top_level.project_path) && (dir = top_level.fonts_dir) Compass.projectize(dir, pp) end end |
#default_generated_images_dir ⇒ Object
116 117 118 |
# File 'lib/compass/configuration/defaults.rb', line 116 def default_generated_images_dir top_level.images_dir end |
#default_generated_images_path ⇒ Object
74 75 76 77 78 79 80 |
# File 'lib/compass/configuration/defaults.rb', line 74 def default_generated_images_path if (pp = top_level.project_path) && (dir = top_level.generated_images_dir) Compass.projectize(dir, pp) else top_level.images_path end end |
#default_http_fonts_dir ⇒ Object
148 149 150 |
# File 'lib/compass/configuration/defaults.rb', line 148 def default_http_fonts_dir top_level.fonts_dir end |
#default_http_fonts_path ⇒ Object
152 153 154 |
# File 'lib/compass/configuration/defaults.rb', line 152 def default_http_fonts_path http_root_relative top_level.http_fonts_dir end |
#default_http_generated_images_dir ⇒ Object
120 121 122 |
# File 'lib/compass/configuration/defaults.rb', line 120 def default_http_generated_images_dir top_level.http_images_dir end |
#default_http_generated_images_path ⇒ Object
144 145 146 |
# File 'lib/compass/configuration/defaults.rb', line 144 def default_http_generated_images_path http_root_relative top_level.http_generated_images_dir end |
#default_http_images_dir ⇒ Object
124 125 126 |
# File 'lib/compass/configuration/defaults.rb', line 124 def default_http_images_dir top_level.images_dir end |
#default_http_images_path ⇒ Object
132 133 134 |
# File 'lib/compass/configuration/defaults.rb', line 132 def default_http_images_path http_root_relative top_level.http_images_dir end |
#default_http_javascripts_dir ⇒ Object
156 157 158 |
# File 'lib/compass/configuration/defaults.rb', line 156 def default_http_javascripts_dir top_level.javascripts_dir end |
#default_http_javascripts_path ⇒ Object
160 161 162 |
# File 'lib/compass/configuration/defaults.rb', line 160 def default_http_javascripts_path http_root_relative top_level.http_javascripts_dir end |
#default_http_path ⇒ Object
12 13 14 |
# File 'lib/compass/configuration/defaults.rb', line 12 def default_http_path "/" end |
#default_http_stylesheets_dir ⇒ Object
136 137 138 |
# File 'lib/compass/configuration/defaults.rb', line 136 def default_http_stylesheets_dir top_level.css_dir end |
#default_http_stylesheets_path ⇒ Object
140 141 142 |
# File 'lib/compass/configuration/defaults.rb', line 140 def default_http_stylesheets_path http_root_relative top_level.http_stylesheets_dir end |
#default_images_dir ⇒ Object
32 33 34 |
# File 'lib/compass/configuration/defaults.rb', line 32 def default_images_dir "images" end |
#default_images_path ⇒ Object
68 69 70 71 72 |
# File 'lib/compass/configuration/defaults.rb', line 68 def default_images_path if (pp = top_level.project_path) && (dir = top_level.images_dir) Compass.projectize(dir, pp) end end |
#default_javascripts_path ⇒ Object
82 83 84 85 86 |
# File 'lib/compass/configuration/defaults.rb', line 82 def default_javascripts_path if (pp = top_level.project_path) && (dir = top_level.javascripts_dir) Compass.projectize(dir, pp) end end |
#default_line_comments ⇒ Object
48 49 50 |
# File 'lib/compass/configuration/defaults.rb', line 48 def default_line_comments top_level.environment == :development end |
#default_output_style ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/compass/configuration/defaults.rb', line 40 def default_output_style if top_level.environment == :development :expanded else :compressed end end |
#default_preferred_syntax ⇒ Object
168 169 170 |
# File 'lib/compass/configuration/defaults.rb', line 168 def default_preferred_syntax :scss end |
#default_project_path ⇒ Object
4 5 6 |
# File 'lib/compass/configuration/defaults.rb', line 4 def default_project_path "." end |
#default_project_type ⇒ Object
8 9 10 |
# File 'lib/compass/configuration/defaults.rb', line 8 def default_project_type :stand_alone end |
#default_sass_dir ⇒ Object
24 25 26 |
# File 'lib/compass/configuration/defaults.rb', line 24 def default_sass_dir "sass" end |
#default_sass_path ⇒ Object
56 57 58 59 60 |
# File 'lib/compass/configuration/defaults.rb', line 56 def default_sass_path if (pp = top_level.project_path) && (dir = top_level.sass_dir) Compass.projectize(dir, pp) end end |
#default_sprite_engine ⇒ Object
172 173 174 |
# File 'lib/compass/configuration/defaults.rb', line 172 def default_sprite_engine :chunky_png end |
#default_sprite_load_path ⇒ Object
128 129 130 |
# File 'lib/compass/configuration/defaults.rb', line 128 def default_sprite_load_path [top_level.images_path] end |
#http_join(*segments) ⇒ Object
helper functions
186 187 188 189 190 191 192 |
# File 'lib/compass/configuration/defaults.rb', line 186 def http_join(*segments) segments.map do |segment| next unless segment segment = http_pathify(segment) segment[-1..-1] == "/" ? segment[0..-2] : segment end.join("/") end |
#http_pathify(path) ⇒ Object
194 195 196 197 198 199 200 |
# File 'lib/compass/configuration/defaults.rb', line 194 def http_pathify(path) if File::SEPARATOR == "/" path else path.gsub(File::SEPARATOR, "/") end end |
#http_root_relative(path) ⇒ Object
202 203 204 |
# File 'lib/compass/configuration/defaults.rb', line 202 def http_root_relative(path) http_join top_level.http_path, path end |