Module: Compass::Configuration::Defaults
- Defined in:
- lib/compass/configuration/defaults.rb
Instance Method Summary collapse
- #default_cache ⇒ Object
- #default_cache_path ⇒ Object
- #default_chunky_png_options ⇒ Object
- #default_color_output ⇒ 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_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_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
147 148 149 |
# File 'lib/compass/configuration/defaults.rb', line 147 def default_cache true end |
#default_cache_path ⇒ Object
89 90 91 92 93 |
# File 'lib/compass/configuration/defaults.rb', line 89 def default_cache_path if (pp = top_level.project_path) && (dir = top_level.cache_dir) Compass.projectize(dir, pp) end end |
#default_chunky_png_options ⇒ Object
159 160 161 |
# File 'lib/compass/configuration/defaults.rb', line 159 def {:compression => Zlib::BEST_COMPRESSION} end |
#default_color_output ⇒ Object
41 42 43 |
# File 'lib/compass/configuration/defaults.rb', line 41 def default_color_output true end |
#default_css_path ⇒ Object
51 52 53 54 55 |
# File 'lib/compass/configuration/defaults.rb', line 51 def default_css_path if (pp = top_level.project_path) && (dir = top_level.css_dir) Compass.projectize(dir, pp) end end |
#default_environment ⇒ Object
25 26 27 |
# File 'lib/compass/configuration/defaults.rb', line 25 def default_environment :development end |
#default_extensions_dir ⇒ Object
17 18 19 |
# File 'lib/compass/configuration/defaults.rb', line 17 def default_extensions_dir "extensions" end |
#default_extensions_path ⇒ Object
77 78 79 80 81 |
# File 'lib/compass/configuration/defaults.rb', line 77 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
21 22 23 |
# File 'lib/compass/configuration/defaults.rb', line 21 def default_fonts_dir File.join(top_level.css_dir, "fonts") end |
#default_fonts_path ⇒ Object
83 84 85 86 87 |
# File 'lib/compass/configuration/defaults.rb', line 83 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
95 96 97 |
# File 'lib/compass/configuration/defaults.rb', line 95 def default_generated_images_dir top_level.images_dir end |
#default_generated_images_path ⇒ Object
63 64 65 66 67 68 69 |
# File 'lib/compass/configuration/defaults.rb', line 63 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
127 128 129 130 131 132 133 |
# File 'lib/compass/configuration/defaults.rb', line 127 def default_http_fonts_dir if fd = top_level.fonts_dir_without_default fd else "#{top_level.http_stylesheets_dir}/fonts" end end |
#default_http_fonts_path ⇒ Object
135 136 137 |
# File 'lib/compass/configuration/defaults.rb', line 135 def default_http_fonts_path http_root_relative top_level.http_fonts_dir end |
#default_http_generated_images_dir ⇒ Object
99 100 101 |
# File 'lib/compass/configuration/defaults.rb', line 99 def default_http_generated_images_dir top_level.http_images_dir end |
#default_http_generated_images_path ⇒ Object
123 124 125 |
# File 'lib/compass/configuration/defaults.rb', line 123 def default_http_generated_images_path http_root_relative top_level.http_generated_images_dir end |
#default_http_images_dir ⇒ Object
103 104 105 |
# File 'lib/compass/configuration/defaults.rb', line 103 def default_http_images_dir top_level.images_dir end |
#default_http_images_path ⇒ Object
111 112 113 |
# File 'lib/compass/configuration/defaults.rb', line 111 def default_http_images_path http_root_relative top_level.http_images_dir end |
#default_http_javascripts_dir ⇒ Object
139 140 141 |
# File 'lib/compass/configuration/defaults.rb', line 139 def default_http_javascripts_dir top_level.javascripts_dir end |
#default_http_javascripts_path ⇒ Object
143 144 145 |
# File 'lib/compass/configuration/defaults.rb', line 143 def default_http_javascripts_path http_root_relative top_level.http_javascripts_dir end |
#default_http_path ⇒ Object
13 14 15 |
# File 'lib/compass/configuration/defaults.rb', line 13 def default_http_path "/" end |
#default_http_stylesheets_dir ⇒ Object
115 116 117 |
# File 'lib/compass/configuration/defaults.rb', line 115 def default_http_stylesheets_dir top_level.css_dir end |
#default_http_stylesheets_path ⇒ Object
119 120 121 |
# File 'lib/compass/configuration/defaults.rb', line 119 def default_http_stylesheets_path http_root_relative top_level.http_stylesheets_dir end |
#default_images_path ⇒ Object
57 58 59 60 61 |
# File 'lib/compass/configuration/defaults.rb', line 57 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
71 72 73 74 75 |
# File 'lib/compass/configuration/defaults.rb', line 71 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
37 38 39 |
# File 'lib/compass/configuration/defaults.rb', line 37 def default_line_comments top_level.environment == :development end |
#default_output_style ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/compass/configuration/defaults.rb', line 29 def default_output_style if top_level.environment == :development :expanded else :compressed end end |
#default_preferred_syntax ⇒ Object
151 152 153 |
# File 'lib/compass/configuration/defaults.rb', line 151 def default_preferred_syntax :scss end |
#default_project_path ⇒ Object
5 6 7 |
# File 'lib/compass/configuration/defaults.rb', line 5 def default_project_path "." end |
#default_project_type ⇒ Object
9 10 11 |
# File 'lib/compass/configuration/defaults.rb', line 9 def default_project_type :stand_alone end |
#default_sass_path ⇒ Object
45 46 47 48 49 |
# File 'lib/compass/configuration/defaults.rb', line 45 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
155 156 157 |
# File 'lib/compass/configuration/defaults.rb', line 155 def default_sprite_engine :chunky_png end |
#default_sprite_load_path ⇒ Object
107 108 109 |
# File 'lib/compass/configuration/defaults.rb', line 107 def default_sprite_load_path [top_level.images_path] end |
#http_join(*segments) ⇒ Object
helper functions
165 166 167 168 169 170 171 |
# File 'lib/compass/configuration/defaults.rb', line 165 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
173 174 175 176 177 178 179 |
# File 'lib/compass/configuration/defaults.rb', line 173 def http_pathify(path) if File::SEPARATOR == "/" path else path.gsub(File::SEPARATOR, "/") end end |
#http_root_relative(path) ⇒ Object
181 182 183 |
# File 'lib/compass/configuration/defaults.rb', line 181 def http_root_relative(path) http_join top_level.http_path, path end |