Module: Compass::Configuration::Defaults

Defined in:
lib/compass/configuration/defaults.rb

Instance Method Summary collapse

Instance Method Details

#default_cacheObject



164
165
166
# File 'lib/compass/configuration/defaults.rb', line 164

def default_cache
  true
end

#default_cache_dirObject



100
101
102
# File 'lib/compass/configuration/defaults.rb', line 100

def default_cache_dir
  ".sass-cache"
end

#default_cache_pathObject



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.options[:cache_location]
    File.expand_path(Sass::Plugin.options[:cache_location])
  elsif (pp = top_level.project_path) && (dir = top_level.cache_dir)
    Compass.projectize(dir, pp)
  end
end

#default_chunky_png_optionsObject



176
177
178
179
180
181
182
# File 'lib/compass/configuration/defaults.rb', line 176

def default_chunky_png_options
  if defined?(::Zlib)
    {:compression => Zlib::BEST_COMPRESSION}
  else
    {}
  end
end

#default_color_outputObject



52
53
54
# File 'lib/compass/configuration/defaults.rb', line 52

def default_color_output
  true
end

#default_css_dirObject



20
21
22
# File 'lib/compass/configuration/defaults.rb', line 20

def default_css_dir
  "stylesheets"
end

#default_css_pathObject



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_environmentObject



36
37
38
# File 'lib/compass/configuration/defaults.rb', line 36

def default_environment
  :development
end

#default_extensions_dirObject



16
17
18
# File 'lib/compass/configuration/defaults.rb', line 16

def default_extensions_dir
  "extensions"
end

#default_extensions_pathObject



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_dirObject



28
29
30
# File 'lib/compass/configuration/defaults.rb', line 28

def default_fonts_dir
  "fonts"
end

#default_fonts_pathObject



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_dirObject



116
117
118
# File 'lib/compass/configuration/defaults.rb', line 116

def default_generated_images_dir
  top_level.images_dir
end

#default_generated_images_pathObject



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_dirObject



148
149
150
# File 'lib/compass/configuration/defaults.rb', line 148

def default_http_fonts_dir
  top_level.fonts_dir
end

#default_http_fonts_pathObject



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_dirObject



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_pathObject



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_dirObject



124
125
126
# File 'lib/compass/configuration/defaults.rb', line 124

def default_http_images_dir
  top_level.images_dir
end

#default_http_images_pathObject



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_dirObject



156
157
158
# File 'lib/compass/configuration/defaults.rb', line 156

def default_http_javascripts_dir
  top_level.javascripts_dir
end

#default_http_javascripts_pathObject



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_pathObject



12
13
14
# File 'lib/compass/configuration/defaults.rb', line 12

def default_http_path
  "/"
end

#default_http_stylesheets_dirObject



136
137
138
# File 'lib/compass/configuration/defaults.rb', line 136

def default_http_stylesheets_dir
  top_level.css_dir
end

#default_http_stylesheets_pathObject



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_dirObject



32
33
34
# File 'lib/compass/configuration/defaults.rb', line 32

def default_images_dir
  "images"
end

#default_images_pathObject



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_pathObject



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_commentsObject



48
49
50
# File 'lib/compass/configuration/defaults.rb', line 48

def default_line_comments
  top_level.environment == :development
end

#default_output_styleObject



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_syntaxObject



168
169
170
# File 'lib/compass/configuration/defaults.rb', line 168

def default_preferred_syntax
  :scss
end

#default_project_pathObject



4
5
6
# File 'lib/compass/configuration/defaults.rb', line 4

def default_project_path
  "."
end

#default_project_typeObject



8
9
10
# File 'lib/compass/configuration/defaults.rb', line 8

def default_project_type
  :stand_alone
end

#default_sass_dirObject



24
25
26
# File 'lib/compass/configuration/defaults.rb', line 24

def default_sass_dir
  "sass"
end

#default_sass_pathObject



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_engineObject



172
173
174
# File 'lib/compass/configuration/defaults.rb', line 172

def default_sprite_engine
  :chunky_png
end

#default_sprite_load_pathObject



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