compass 1.0.0.alpha.15 → 1.0.0.alpha.16
Sign up to get free protection for your applications and to get access to all the features.
- data/RELEASE_VERSION +1 -1
- data/VERSION +1 -1
- data/lib/compass/commands/update_project.rb +5 -0
- data/lib/compass/compiler.rb +50 -11
- data/lib/compass/configuration/serialization.rb +4 -0
- data/lib/compass/sass_extensions/functions/sprites.rb +31 -29
- data/lib/compass/sass_extensions/sprites/image.rb +4 -3
- data/lib/compass/sass_extensions/sprites/image_methods.rb +2 -2
- data/lib/compass/sass_extensions/sprites/sprite_map.rb +6 -5
- data/lib/compass/stats.rb +1 -1
- data/lib/compass/watcher/compiler.rb +3 -2
- data/lib/compass/watcher/project_watcher.rb +4 -4
- data/test/fixtures/stylesheets/compass/config.rb +1 -0
- data/test/fixtures/stylesheets/compass/css/lists.css +4 -4
- data/test/fixtures/stylesheets/compass/css/vertical_rhythm.css +0 -169
- data/test/fixtures/stylesheets/compass/css/vertical_rhythm_with_ems.css +51 -0
- data/test/fixtures/stylesheets/compass/css/vertical_rhythm_with_px.css +50 -0
- data/test/fixtures/stylesheets/compass/css/vertical_rhythm_with_rems.css +65 -0
- data/test/fixtures/stylesheets/compass/sass/vertical_rhythm.scss +0 -157
- data/test/fixtures/stylesheets/compass/sass/vertical_rhythm_with_ems.scss +52 -0
- data/test/fixtures/stylesheets/compass/sass/vertical_rhythm_with_px.scss +50 -0
- data/test/fixtures/stylesheets/compass/sass/vertical_rhythm_with_rems.scss +50 -0
- data/test/fixtures/stylesheets/envtest/tmp/env.css +2 -2
- data/test/helpers/command_line.rb +1 -1
- data/test/units/configuration_test.rb +6 -0
- data/test/units/sass_extensions_test.rb +9 -3
- data/test/units/sass_extenstions/gradients_test.rb +8 -11
- metadata +41 -13
data/RELEASE_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.0.alpha.
|
1
|
+
1.0.0.alpha.16
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.0.alpha.
|
1
|
+
1.0.0.alpha.15
|
@@ -14,6 +14,10 @@ module Compass
|
|
14
14
|
Options:
|
15
15
|
}.split("\n").map{|l| l.gsub(/^ */,'')}.join("\n")
|
16
16
|
|
17
|
+
opts.on("--[no-]sourcemap", "Generate a sourcemap during compilation.") do |sm|
|
18
|
+
self.options[:sourcemap] = sm
|
19
|
+
end
|
20
|
+
|
17
21
|
opts.on("--time", "Display compilation times.") do
|
18
22
|
self.options[:time] = true
|
19
23
|
end
|
@@ -64,6 +68,7 @@ module Compass
|
|
64
68
|
compiler_opts.merge!(options)
|
65
69
|
compiler_opts[:sass_files] = explicit_sass_files
|
66
70
|
compiler_opts[:cache_location] = determine_cache_location
|
71
|
+
compiler_opts[:sourcemap] = Compass.configuration.sourcemap if compiler_opts[:sourcemap].nil?
|
67
72
|
if options.include?(:debug_info) && options[:debug_info]
|
68
73
|
compiler_opts[:sass][:debug_info] = options.delete(:debug_info)
|
69
74
|
end
|
data/lib/compass/compiler.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
|
1
3
|
module Compass
|
2
4
|
class Compiler
|
3
5
|
|
@@ -55,10 +57,18 @@ module Compass
|
|
55
57
|
@css_files ||= sass_files.map{|sass_file| corresponding_css_file(sass_file)}
|
56
58
|
end
|
57
59
|
|
60
|
+
def sourcemap_files
|
61
|
+
@sourcemap_files ||= sass_files.map{|sass_file| corresponding_sourcemap_file(sass_file)}
|
62
|
+
end
|
63
|
+
|
58
64
|
def corresponding_css_file(sass_file)
|
59
65
|
"#{to}/#{stylesheet_name(sass_file)}.css"
|
60
66
|
end
|
61
67
|
|
68
|
+
def corresponding_sourcemap_file(sass_file)
|
69
|
+
"#{to}/#{stylesheet_name(sass_file)}.map"
|
70
|
+
end
|
71
|
+
|
62
72
|
def target_directories
|
63
73
|
css_files.map{|css_file| File.dirname(css_file)}.uniq.sort.sort_by{|d| d.length }
|
64
74
|
end
|
@@ -86,10 +96,18 @@ module Compass
|
|
86
96
|
nil
|
87
97
|
end
|
88
98
|
|
99
|
+
def reset!
|
100
|
+
reset_staleness_checker!
|
101
|
+
@sass_files = nil
|
102
|
+
@css_files = nil
|
103
|
+
@sourcemap_files = nil
|
104
|
+
end
|
105
|
+
|
89
106
|
def clean!
|
90
107
|
remove options[:cache_location]
|
91
|
-
css_files.each do |css_file|
|
108
|
+
css_files.zip(sourcemap_files).each do |css_file, sourcemap_file|
|
92
109
|
remove css_file
|
110
|
+
remove sourcemap_file
|
93
111
|
end
|
94
112
|
end
|
95
113
|
|
@@ -106,9 +124,9 @@ module Compass
|
|
106
124
|
|
107
125
|
# Compile each sass file.
|
108
126
|
result = timed do
|
109
|
-
sass_files.zip(css_files).each do |sass_filename, css_filename|
|
127
|
+
sass_files.zip(css_files, sourcemap_files).each do |sass_filename, css_filename, sourcemap_filename|
|
110
128
|
begin
|
111
|
-
compile_if_required sass_filename, css_filename
|
129
|
+
compile_if_required sass_filename, css_filename, sourcemap_filename
|
112
130
|
rescue Sass::SyntaxError => e
|
113
131
|
failure_count += 1
|
114
132
|
handle_exception(sass_filename, css_filename, e)
|
@@ -121,11 +139,12 @@ module Compass
|
|
121
139
|
return failure_count
|
122
140
|
end
|
123
141
|
|
124
|
-
def compile_if_required(sass_filename, css_filename)
|
125
|
-
if should_compile?(sass_filename, css_filename)
|
126
|
-
compile sass_filename, css_filename
|
142
|
+
def compile_if_required(sass_filename, css_filename, sourcemap_filename = nil)
|
143
|
+
if should_compile?(sass_filename, css_filename, sourcemap_filename)
|
144
|
+
compile sass_filename, css_filename, sourcemap_filename
|
127
145
|
else
|
128
146
|
logger.record :unchanged, basename(sass_filename) unless options[:quiet]
|
147
|
+
remove(sourcemap_filename) if sourcemap_filename && !options[:sourcemap]
|
129
148
|
end
|
130
149
|
end
|
131
150
|
|
@@ -141,20 +160,40 @@ module Compass
|
|
141
160
|
end
|
142
161
|
|
143
162
|
# Compile one Sass file
|
144
|
-
def compile(sass_filename, css_filename)
|
163
|
+
def compile(sass_filename, css_filename, sourcemap_filename = nil)
|
145
164
|
start_time = end_time = nil
|
146
|
-
css_content = logger.red do
|
165
|
+
css_content, sourcemap = logger.red do
|
147
166
|
timed do
|
148
|
-
engine(sass_filename, css_filename)
|
167
|
+
engine = engine(sass_filename, css_filename)
|
168
|
+
if sourcemap_filename && options[:sourcemap]
|
169
|
+
engine.render_with_sourcemap(relative_path(css_filename, sourcemap_filename))
|
170
|
+
else
|
171
|
+
[engine.render, nil]
|
172
|
+
end
|
149
173
|
end
|
150
174
|
end
|
151
175
|
duration = options[:time] ? "(#{(css_content.__duration * 1000).round / 1000.0}s)" : ""
|
152
176
|
write_file(css_filename, css_content, options.merge(:force => true, :extra => duration), sass_options[:unix_newlines])
|
177
|
+
if sourcemap
|
178
|
+
sourcemap_content = sourcemap.to_json(:css_path => css_filename,
|
179
|
+
:sourcemap_path => sourcemap_filename)
|
180
|
+
write_file(sourcemap_filename, sourcemap_content, options.merge(:force => true), sass_options[:unix_newlines])
|
181
|
+
elsif File.exist?(sourcemap_filename)
|
182
|
+
remove sourcemap_filename
|
183
|
+
end
|
153
184
|
Compass.configuration.run_stylesheet_saved(css_filename)
|
154
185
|
end
|
155
186
|
|
156
|
-
def
|
157
|
-
|
187
|
+
def relative_path(from_path, to_path)
|
188
|
+
Pathname.new(to_path).relative_path_from(Pathname.new(from_path).dirname).to_s
|
189
|
+
end
|
190
|
+
|
191
|
+
def should_compile?(sass_filename, css_filename, sourcemap_filename = nil)
|
192
|
+
return true if css_filename && !File.exist?(css_filename)
|
193
|
+
return true if sourcemap_filename && options[:sourcemap] && !File.exist?(sourcemap_filename)
|
194
|
+
options[:force] ||
|
195
|
+
needs_update?(css_filename, sass_filename) ||
|
196
|
+
(options[:sourcemap] && needs_update?(sourcemap_filename, sass_filename))
|
158
197
|
end
|
159
198
|
|
160
199
|
# A sass engine for compiling a single file.
|
@@ -43,6 +43,10 @@ module Compass
|
|
43
43
|
(required_libraries || []).each do |lib|
|
44
44
|
contents << %Q{require '#{lib}'\n}
|
45
45
|
end
|
46
|
+
unless (required_libraries || []).include?("compass/import-once/activate") ||
|
47
|
+
(required_libraries || []).include?("compass/import-once")
|
48
|
+
contents << "require 'compass/import-once/activate'\n"
|
49
|
+
end
|
46
50
|
(loaded_frameworks || []).each do |lib|
|
47
51
|
contents << %Q{load '#{lib}'\n}
|
48
52
|
end
|
@@ -1,10 +1,13 @@
|
|
1
1
|
module Compass::SassExtensions::Functions::Sprites
|
2
2
|
|
3
3
|
extend Compass::SassExtensions::Functions::SassDeclarationHelper
|
4
|
+
extend Sass::Script::Value::Helpers
|
5
|
+
include Sass::Script::Value::Helpers
|
4
6
|
|
5
|
-
ZERO =
|
6
|
-
BOOL_FALSE =
|
7
|
+
ZERO = number(0)
|
8
|
+
BOOL_FALSE = bool(false)
|
7
9
|
VALID_SELECTORS = %w(hover active target focus)
|
10
|
+
|
8
11
|
# Provides a consistent interface for getting a variable in ruby
|
9
12
|
# from a keyword argument hash that accounts for underscores/dash equivalence
|
10
13
|
# and allows the caller to pass a symbol instead of a string.
|
@@ -19,7 +22,7 @@ module Compass::SassExtensions::Functions::Sprites
|
|
19
22
|
verify_map(map, 'sprite-width')
|
20
23
|
file = get_sprite_file(map, sprite)
|
21
24
|
width, _ = image_dimensions(file)
|
22
|
-
|
25
|
+
number(width, "px")
|
23
26
|
end
|
24
27
|
declare :sprite_width, [:map]
|
25
28
|
declare :sprite_width, [:map, :sprite]
|
@@ -29,7 +32,7 @@ module Compass::SassExtensions::Functions::Sprites
|
|
29
32
|
verify_map(map, 'sprite-height')
|
30
33
|
file = get_sprite_file(map, sprite)
|
31
34
|
_, height = image_dimensions(file)
|
32
|
-
|
35
|
+
number(height, "px")
|
33
36
|
end
|
34
37
|
declare :sprite_height, [:map]
|
35
38
|
declare :sprite_height, [:map, :sprite]
|
@@ -37,14 +40,14 @@ module Compass::SassExtensions::Functions::Sprites
|
|
37
40
|
# Returns a list of all sprite names
|
38
41
|
def sprite_names(map)
|
39
42
|
verify_map(map, 'sprite-names')
|
40
|
-
|
43
|
+
list(map.sprite_names.map { |f| identifier(f) }, :comma)
|
41
44
|
end
|
42
45
|
declare :sprite_names, [:map]
|
43
46
|
|
44
47
|
# Returns the system path of the sprite file
|
45
48
|
def sprite_path(map)
|
46
49
|
verify_map(map, 'sprite-path')
|
47
|
-
|
50
|
+
identifier(map.filename)
|
48
51
|
end
|
49
52
|
declare :sprite_path, [:map]
|
50
53
|
|
@@ -96,7 +99,7 @@ module Compass::SassExtensions::Functions::Sprites
|
|
96
99
|
verify_sprite(sprite)
|
97
100
|
url = sprite_url(map)
|
98
101
|
position = sprite_position(map, sprite, offset_x, offset_y, use_percentages)
|
99
|
-
|
102
|
+
list([url] + position.value, :space)
|
100
103
|
end
|
101
104
|
declare :sprite, [:map, :sprite]
|
102
105
|
declare :sprite, [:map, :sprite, :offset_x]
|
@@ -107,7 +110,7 @@ module Compass::SassExtensions::Functions::Sprites
|
|
107
110
|
# The name is derived from the folder than contains the sprites.
|
108
111
|
def sprite_map_name(map)
|
109
112
|
verify_map(map, "sprite-map-name")
|
110
|
-
|
113
|
+
identifier(map.name)
|
111
114
|
end
|
112
115
|
declare :sprite_name, [:sprite]
|
113
116
|
|
@@ -117,7 +120,7 @@ module Compass::SassExtensions::Functions::Sprites
|
|
117
120
|
verify_map(map, "sprite")
|
118
121
|
verify_sprite(sprite)
|
119
122
|
if image = map.image_for(sprite.value)
|
120
|
-
|
123
|
+
identifier(image.file)
|
121
124
|
else
|
122
125
|
missing_image!(map, sprite)
|
123
126
|
end
|
@@ -129,9 +132,8 @@ module Compass::SassExtensions::Functions::Sprites
|
|
129
132
|
sprite = convert_sprite_name(sprite)
|
130
133
|
verify_map map
|
131
134
|
verify_sprite sprite
|
132
|
-
|
135
|
+
bool(map.image_for(sprite.value).parent.nil?)
|
133
136
|
end
|
134
|
-
|
135
137
|
declare :sprite_does_not_have_parent, [:map, :sprite]
|
136
138
|
|
137
139
|
#return the name of the selector file
|
@@ -139,7 +141,7 @@ module Compass::SassExtensions::Functions::Sprites
|
|
139
141
|
sprite = convert_sprite_name(sprite)
|
140
142
|
image = map.image_for(sprite)
|
141
143
|
if map.send(:"has_#{selector.value}?", sprite.value)
|
142
|
-
return
|
144
|
+
return identifier(image.send(selector.value).name)
|
143
145
|
end
|
144
146
|
|
145
147
|
raise Sass::SyntaxError, "Sprite: #{sprite.value} does not have a #{selector} state"
|
@@ -155,7 +157,7 @@ module Compass::SassExtensions::Functions::Sprites
|
|
155
157
|
unless VALID_SELECTORS.include?(selector.value)
|
156
158
|
raise Sass::SyntaxError, "Invalid Selctor did you mean one of: #{VALID_SELECTORS.join(', ')}"
|
157
159
|
end
|
158
|
-
|
160
|
+
bool map.send(:"has_#{selector.value}?", sprite.value)
|
159
161
|
end
|
160
162
|
|
161
163
|
declare :sprite_has_selector, [:map, :sprite, :selector]
|
@@ -166,14 +168,14 @@ module Compass::SassExtensions::Functions::Sprites
|
|
166
168
|
unless selector.value =~ IDENTIFIER_RX
|
167
169
|
raise Sass::SyntaxError, "#{selector} must be a legal css identifier"
|
168
170
|
end
|
169
|
-
|
171
|
+
bool true
|
170
172
|
end
|
171
173
|
|
172
174
|
# Returns a url to the sprite image.
|
173
175
|
def sprite_url(map)
|
174
176
|
verify_map(map, "sprite-url")
|
175
177
|
map.generate
|
176
|
-
generated_image_url(
|
178
|
+
generated_image_url(identifier("#{map.path}-s#{map.uniqueness_hash}.png"))
|
177
179
|
end
|
178
180
|
declare :sprite_url, [:map]
|
179
181
|
|
@@ -211,7 +213,7 @@ module Compass::SassExtensions::Functions::Sprites
|
|
211
213
|
assert_type offset_y, :Number
|
212
214
|
sprite = convert_sprite_name(sprite)
|
213
215
|
verify_map(map, "sprite-position")
|
214
|
-
unless sprite.is_a?(Sass::Script::String) || sprite.is_a?(Sass::Script::Number)
|
216
|
+
unless sprite.is_a?(Sass::Script::Value::String) || sprite.is_a?(Sass::Script::Value::Number)
|
215
217
|
raise Sass::SyntaxError, %Q(The second argument to sprite-position must be a sprite name. See http://beta.compass-style.org/help/tutorials/spriting/ for more information.)
|
216
218
|
end
|
217
219
|
image = map.image_for(sprite.value)
|
@@ -221,21 +223,21 @@ module Compass::SassExtensions::Functions::Sprites
|
|
221
223
|
if use_percentages.value
|
222
224
|
xdivis = map.width - image.width;
|
223
225
|
x = (offset_x.value + image.left.to_f) / (xdivis.nonzero? || 1) * 100
|
224
|
-
x =
|
226
|
+
x = x == 0 ? number(x) : number(x, "%")
|
225
227
|
ydivis = map.height - image.height;
|
226
228
|
y = (offset_y.value + image.top.to_f) / (ydivis.nonzero? || 1) * 100
|
227
|
-
y =
|
229
|
+
y = y == 0 ? number(y) : number(y, "%")
|
228
230
|
else
|
229
231
|
if offset_x.unit_str == "%"
|
230
232
|
x = offset_x # CE: Shouldn't this be a percentage of the total width?
|
231
233
|
else
|
232
234
|
x = offset_x.value - image.left
|
233
|
-
x =
|
235
|
+
x = x == 0 ? number(x) : number(x, "px")
|
234
236
|
end
|
235
237
|
y = offset_y.value - image.top
|
236
|
-
y =
|
238
|
+
y = y == 0 ? number(y) : number(y, "px")
|
237
239
|
end
|
238
|
-
|
240
|
+
list(x, y, :space)
|
239
241
|
end
|
240
242
|
declare :sprite_position, [:map]
|
241
243
|
declare :sprite_position, [:map, :sprite]
|
@@ -254,25 +256,25 @@ protected
|
|
254
256
|
end
|
255
257
|
|
256
258
|
def reversed_color_names
|
257
|
-
if Sass::Script::Color.const_defined?(:HTML4_COLORS_REVERSE)
|
258
|
-
Sass::Script::Color::HTML4_COLORS_REVERSE
|
259
|
+
if Sass::Script::Value::Color.const_defined?(:HTML4_COLORS_REVERSE)
|
260
|
+
Sass::Script::Value::Color::HTML4_COLORS_REVERSE
|
259
261
|
else
|
260
|
-
Sass::Script::Color::COLOR_NAMES_REVERSE
|
262
|
+
Sass::Script::Value::Color::COLOR_NAMES_REVERSE
|
261
263
|
end
|
262
264
|
end
|
263
265
|
|
264
266
|
def convert_sprite_name(sprite)
|
265
267
|
case sprite
|
266
|
-
when Sass::Script::Color
|
268
|
+
when Sass::Script::Value::Color
|
267
269
|
rgb = if reversed_color_names.keys.first.size == 3
|
268
270
|
sprite.rgb
|
269
271
|
else
|
270
272
|
# Sass 3.3 includes the alpha channel
|
271
273
|
sprite.rgba
|
272
274
|
end
|
273
|
-
|
274
|
-
when Sass::Script::Bool
|
275
|
-
|
275
|
+
identifier(reversed_color_names[rgb])
|
276
|
+
when Sass::Script::Value::Bool
|
277
|
+
identifier(sprite.to_s)
|
276
278
|
else
|
277
279
|
sprite
|
278
280
|
end
|
@@ -285,7 +287,7 @@ protected
|
|
285
287
|
end
|
286
288
|
|
287
289
|
def verify_sprite(sprite)
|
288
|
-
unless sprite.is_a?(Sass::Script::String) || sprite.is_a?(Sass::Script::Number)
|
290
|
+
unless sprite.is_a?(Sass::Script::Value::String) || sprite.is_a?(Sass::Script::Value::Number)
|
289
291
|
raise Sass::SyntaxError, %Q(The second argument to sprite() must be a sprite name. See http://beta.compass-style.org/help/tutorials/spriting/ for more information.)
|
290
292
|
end
|
291
293
|
end
|
@@ -2,6 +2,7 @@ module Compass
|
|
2
2
|
module SassExtensions
|
3
3
|
module Sprites
|
4
4
|
class Image
|
5
|
+
include Sass::Script::Value::Helpers
|
5
6
|
ACTIVE = %r{[_-]active$}
|
6
7
|
TARGET = %r{[_-]target$}
|
7
8
|
HOVER = %r{[_-]hover$}
|
@@ -58,7 +59,7 @@ module Compass
|
|
58
59
|
# Value of <tt> $#{name}-repeat </tt> or <tt> $repeat </tt>
|
59
60
|
def repeat
|
60
61
|
@repeat ||= begin
|
61
|
-
rep = (get_var_file("repeat") || options.get_var("repeat") ||
|
62
|
+
rep = (get_var_file("repeat") || options.get_var("repeat") || identifier(NO_REPEAT)).value
|
62
63
|
unless VALID_REPEATS.include? rep
|
63
64
|
raise SpriteException, "Invalid option for repeat \"#{rep}\" - valid options are #{VALID_REPEATS.join(', ')}"
|
64
65
|
end
|
@@ -81,7 +82,7 @@ module Compass
|
|
81
82
|
|
82
83
|
# Value of <tt> $#{name}-position </tt> or <tt> $position </tt> defaults to <tt>0px</tt>
|
83
84
|
def position
|
84
|
-
@position ||= get_var_file("position") || options.get_var("position") ||
|
85
|
+
@position ||= get_var_file("position") || options.get_var("position") || number(0, "px")
|
85
86
|
end
|
86
87
|
|
87
88
|
# Offset within the sprite
|
@@ -91,7 +92,7 @@ module Compass
|
|
91
92
|
|
92
93
|
# Spacing between this image and the next
|
93
94
|
def spacing
|
94
|
-
@spacing ||= (get_var_file("spacing") || options.get_var("spacing") ||
|
95
|
+
@spacing ||= (get_var_file("spacing") || options.get_var("spacing") || number(0, 'px')).value
|
95
96
|
end
|
96
97
|
|
97
98
|
# MD5 hash of this file
|
@@ -4,7 +4,7 @@ module Compass
|
|
4
4
|
module ImageMethods
|
5
5
|
# Fetches the Sprite::Image object for the supplied name
|
6
6
|
def image_for(name)
|
7
|
-
if name.is_a?(Sass::Script::String)
|
7
|
+
if name.is_a?(Sass::Script::Value::String)
|
8
8
|
name = name.value
|
9
9
|
end
|
10
10
|
name = name.to_s
|
@@ -49,4 +49,4 @@ module Compass
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
52
|
-
end
|
52
|
+
end
|
@@ -1,13 +1,14 @@
|
|
1
1
|
module Compass
|
2
2
|
module SassExtensions
|
3
3
|
module Sprites
|
4
|
-
class SpriteMap < Sass::Script::
|
4
|
+
class SpriteMap < Sass::Script::Value::Base
|
5
5
|
attr_accessor :image_names, :path, :name, :map, :kwargs
|
6
6
|
attr_accessor :images, :width, :height, :engine
|
7
7
|
|
8
8
|
include SpriteMethods
|
9
9
|
include ImageMethods
|
10
10
|
include LayoutMethods
|
11
|
+
include Sass::Script::Value::Helpers
|
11
12
|
|
12
13
|
|
13
14
|
# Initialize a new sprite object from a relative file path
|
@@ -38,9 +39,9 @@ module Compass
|
|
38
39
|
@path = path
|
39
40
|
@name = name
|
40
41
|
@kwargs = kwargs
|
41
|
-
@kwargs['cleanup'] ||=
|
42
|
-
@kwargs['layout'] ||=
|
43
|
-
@kwargs['sort_by'] ||=
|
42
|
+
@kwargs['cleanup'] ||= bool(true)
|
43
|
+
@kwargs['layout'] ||= identifier('vertical')
|
44
|
+
@kwargs['sort_by'] ||= identifier('none')
|
44
45
|
@images = nil
|
45
46
|
@width = nil
|
46
47
|
@height = nil
|
@@ -89,4 +90,4 @@ module Compass
|
|
89
90
|
end
|
90
91
|
end
|
91
92
|
end
|
92
|
-
end
|
93
|
+
end
|
data/lib/compass/stats.rb
CHANGED
@@ -11,7 +11,7 @@ module Compass
|
|
11
11
|
def visit(node)
|
12
12
|
self.prop_count += 1 if node.is_a?(Sass::Tree::PropNode) && !node.children.any?
|
13
13
|
if node.is_a?(Sass::Tree::RuleNode)
|
14
|
-
self.rule_count += node.rule.reject{|r| r.is_a?(Sass::Script::Node)}.map{|r| r.split(/,/)}.flatten.compact.size
|
14
|
+
self.rule_count += node.rule.reject{|r| r.is_a?(Sass::Script::Tree::Node)}.map{|r| r.split(/,/)}.flatten.compact.size
|
15
15
|
end
|
16
16
|
self.mixin_def_count += 1 if node.is_a?(Sass::Tree::MixinDefNode)
|
17
17
|
self.mixin_count += 1 if node.is_a?(Sass::Tree::MixinNode)
|
@@ -16,7 +16,7 @@ module Compass
|
|
16
16
|
|
17
17
|
def compile
|
18
18
|
@memory_cache.reset! if @memory_cache
|
19
|
-
compiler.
|
19
|
+
compiler.reset!
|
20
20
|
if file = compiler.out_of_date?
|
21
21
|
begin
|
22
22
|
time = Time.now.strftime("%T")
|
@@ -34,6 +34,7 @@ module Compass
|
|
34
34
|
def create_compiler_options(additional_options)
|
35
35
|
compiler_opts = {:sass => Compass.sass_engine_options, :cache_store => @cache_store, :quiet => true, :loud => [:identical, :overwrite, :create]}.merge(additional_options)
|
36
36
|
compiler_opts[:cache_location] ||= determine_cache_location
|
37
|
+
compiler_opts[:sourcemap] = Compass.configuration.sourcemap if compiler_opts[:sourcemap].nil?
|
37
38
|
if compiler_opts.include?(:debug_info)
|
38
39
|
compiler_opts[:sass][:debug_info] = compiler_opts.delete(:debug_info)
|
39
40
|
end
|
@@ -56,4 +57,4 @@ module Compass
|
|
56
57
|
end
|
57
58
|
end
|
58
59
|
end
|
59
|
-
end
|
60
|
+
end
|