sass 3.3.0.alpha.9 → 3.3.0.alpha.11
Sign up to get free protection for your applications and to get access to all the features.
- data/REVISION +1 -1
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/lib/sass/exec.rb +7 -0
- data/lib/sass/plugin/compiler.rb +1 -0
- data/lib/sass/script/funcall.rb +6 -1
- data/lib/sass/tree/visitors/check_nesting.rb +2 -1
- data/lib/sass/tree/visitors/perform.rb +1 -3
- data/lib/sass/util.rb +3 -1
- data/test/sass/plugin_test.rb +0 -5
- data/test/sass/script_test.rb +4 -0
- data/test/sass/scss/scss_test.rb +20 -0
- data/test/sass/util_test.rb +12 -0
- metadata +4 -4
data/REVISION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
eb90864aa1f2b1c2e54e110670417e4de34b2dca
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.3.0.alpha.
|
1
|
+
3.3.0.alpha.11
|
data/VERSION_DATE
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
09 November 2012 22:20:10 GMT
|
data/lib/sass/exec.rb
CHANGED
@@ -407,6 +407,13 @@ MSG
|
|
407
407
|
::Sass::Plugin.on_creating_directory {|dirname| puts_action :directory, :green, dirname}
|
408
408
|
::Sass::Plugin.on_deleting_css {|filename| puts_action :delete, :yellow, filename}
|
409
409
|
::Sass::Plugin.on_compilation_error do |error, _, _|
|
410
|
+
if error.is_a?(SystemCallError) && !@options[:stop_on_error]
|
411
|
+
had_error = true
|
412
|
+
puts_action :error, :red, error.message
|
413
|
+
STDOUT.flush
|
414
|
+
next
|
415
|
+
end
|
416
|
+
|
410
417
|
raise error unless error.is_a?(::Sass::SyntaxError) && !@options[:stop_on_error]
|
411
418
|
had_error = true
|
412
419
|
puts_action :error, :red, "#{error.sass_filename} (Line #{error.sass_line}: #{error.message})"
|
data/lib/sass/plugin/compiler.rb
CHANGED
@@ -183,6 +183,7 @@ module Sass::Plugin
|
|
183
183
|
# The first string in each pair is the location of the Sass/SCSS file,
|
184
184
|
# the second is the location of the CSS file that it should be compiled to.
|
185
185
|
def update_stylesheets(individual_files = [])
|
186
|
+
individual_files = individual_files.dup
|
186
187
|
Sass::Plugin.checked_for_updates = true
|
187
188
|
staleness_checker = StalenessChecker.new(engine_options)
|
188
189
|
|
data/lib/sass/script/funcall.rb
CHANGED
@@ -109,7 +109,12 @@ module Sass
|
|
109
109
|
# If this is a legitimate Ruby-raised argument error, re-raise it.
|
110
110
|
# Otherwise, it's an error in the user's stylesheet, so wrap it.
|
111
111
|
if e.message =~ /^wrong number of arguments \(\d+ for \d+\)/ &&
|
112
|
-
e.backtrace[0] !~ /:in `(block in )?#{ruby_name}'$/
|
112
|
+
e.backtrace[0] !~ /:in `(block in )?#{ruby_name}'$/ &&
|
113
|
+
# JRuby (as of 1.6.7.2) doesn't put the actual method for
|
114
|
+
# which the argument error was thrown in the backtrace, so
|
115
|
+
# we detect whether our send threw an argument error.
|
116
|
+
(RUBY_PLATFORM !~ /java/ || e.backtrace[0] !~ /:in `send'$/ ||
|
117
|
+
e.backtrace[1] !~ /:in `_perform'$/)
|
113
118
|
raise e
|
114
119
|
end
|
115
120
|
raise Sass::SyntaxError.new("#{e.message} for `#{name}'")
|
@@ -23,7 +23,8 @@ class Sass::Tree::Visitors::CheckNesting < Sass::Tree::Visitors::Base
|
|
23
23
|
SCRIPT_NODES = [Sass::Tree::ImportNode] + CONTROL_NODES
|
24
24
|
def visit_children(parent)
|
25
25
|
old_parent = @parent
|
26
|
-
@parent = parent unless is_any_of?(parent, SCRIPT_NODES)
|
26
|
+
@parent = parent unless is_any_of?(parent, SCRIPT_NODES) ||
|
27
|
+
(parent.bubbles? && !old_parent.is_a?(Sass::Tree::RootNode))
|
27
28
|
@parents.push parent
|
28
29
|
super
|
29
30
|
ensure
|
@@ -333,9 +333,7 @@ class Sass::Tree::Visitors::Perform < Sass::Tree::Visitors::Base
|
|
333
333
|
res = node.expr.perform(@environment)
|
334
334
|
res = res.value if res.is_a?(Sass::Script::String)
|
335
335
|
msg = "WARNING: #{res}\n "
|
336
|
-
msg << stack_trace.join("\n ")
|
337
|
-
# JRuby doesn't automatically add a newline for #warn
|
338
|
-
msg << (RUBY_PLATFORM =~ /java/ ? "\n\n" : "\n")
|
336
|
+
msg << stack_trace.join("\n ") << "\n"
|
339
337
|
Sass::Util.sass_warn msg
|
340
338
|
[]
|
341
339
|
ensure
|
data/lib/sass/util.rb
CHANGED
@@ -298,7 +298,9 @@ module Sass
|
|
298
298
|
# @param entry [String] An entry in the `#caller` list, or a similarly formatted string
|
299
299
|
# @return [[String, Fixnum, (String, nil)]] An array containing the filename, line, and method name of the caller.
|
300
300
|
# The method name may be nil
|
301
|
-
def caller_info(entry =
|
301
|
+
def caller_info(entry = nil)
|
302
|
+
# JRuby evaluates `caller` incorrectly when it's in an actual default argument.
|
303
|
+
entry ||= caller[1]
|
302
304
|
info = entry.scan(/^(.*?):(-?.*?)(?::.*`(.+)')?$/).first
|
303
305
|
info[1] = info[1].to_i
|
304
306
|
# This is added by Rubinius to designate a block, but we don't care about it.
|
data/test/sass/plugin_test.rb
CHANGED
@@ -237,11 +237,6 @@ WARNING
|
|
237
237
|
assert_callback :updating_stylesheets, []
|
238
238
|
end
|
239
239
|
|
240
|
-
def test_updating_stylesheets_callback_with_individual_files
|
241
|
-
files = [[template_loc("basic"), tempfile_loc("basic")]]
|
242
|
-
assert_callback(:updating_stylesheets, files) {Sass::Util.silence_sass_warnings{Sass::Plugin.update_stylesheets(files)}}
|
243
|
-
end
|
244
|
-
|
245
240
|
def test_updating_stylesheets_callback_with_never_update
|
246
241
|
Sass::Plugin.options[:never_update] = true
|
247
242
|
assert_no_callback :updating_stylesheets
|
data/test/sass/script_test.rb
CHANGED
@@ -489,6 +489,10 @@ SASS
|
|
489
489
|
end
|
490
490
|
|
491
491
|
def test_deep_argument_error_not_unwrapped
|
492
|
+
# JRuby (as of 1.6.7.2) offers no way of distinguishing between
|
493
|
+
# argument errors caused by programming errors in a function and
|
494
|
+
# argument errors explicitly thrown within that function.
|
495
|
+
return if RUBY_PLATFORM =~ /java/
|
492
496
|
assert_raise_message(ArgumentError, 'wrong number of arguments (0 for 1)') {resolve("arg-error()")}
|
493
497
|
end
|
494
498
|
|
data/test/sass/scss/scss_test.rb
CHANGED
@@ -1977,4 +1977,24 @@ SCSS
|
|
1977
1977
|
SCSS
|
1978
1978
|
Sass::SCSS::Parser.new(template, "test.scss").parse
|
1979
1979
|
end
|
1980
|
+
|
1981
|
+
def test_extend_in_media_in_rule
|
1982
|
+
assert_equal(<<CSS, render(<<SCSS))
|
1983
|
+
@media screen {
|
1984
|
+
.foo {
|
1985
|
+
a: b; } }
|
1986
|
+
CSS
|
1987
|
+
.foo {
|
1988
|
+
@media screen {
|
1989
|
+
@extend %bar;
|
1990
|
+
}
|
1991
|
+
}
|
1992
|
+
|
1993
|
+
@media screen {
|
1994
|
+
%bar {
|
1995
|
+
a: b;
|
1996
|
+
}
|
1997
|
+
}
|
1998
|
+
SCSS
|
1999
|
+
end
|
1980
2000
|
end
|
data/test/sass/util_test.rb
CHANGED
@@ -243,6 +243,10 @@ class UtilTest < Test::Unit::TestCase
|
|
243
243
|
test[['foo ', 1, "\n bar\n", [2, 3, 4], "\n baz"]]
|
244
244
|
end
|
245
245
|
|
246
|
+
def nested_caller_info_fn
|
247
|
+
caller_info
|
248
|
+
end
|
249
|
+
|
246
250
|
def test_caller_info
|
247
251
|
assert_equal(["/tmp/foo.rb", 12, "fizzle"], caller_info("/tmp/foo.rb:12: in `fizzle'"))
|
248
252
|
assert_equal(["/tmp/foo.rb", 12, nil], caller_info("/tmp/foo.rb:12"))
|
@@ -250,6 +254,14 @@ class UtilTest < Test::Unit::TestCase
|
|
250
254
|
assert_equal(["", 12, "boop"], caller_info(":12: in `boop'"))
|
251
255
|
assert_equal(["/tmp/foo.rb", -12, "fizzle"], caller_info("/tmp/foo.rb:-12: in `fizzle'"))
|
252
256
|
assert_equal(["/tmp/foo.rb", 12, "fizzle"], caller_info("/tmp/foo.rb:12: in `fizzle {}'"))
|
257
|
+
|
258
|
+
info = nested_caller_info_fn
|
259
|
+
assert_equal(__FILE__, info[0])
|
260
|
+
assert_equal("test_caller_info", info[2])
|
261
|
+
|
262
|
+
info = proc {nested_caller_info_fn}.call
|
263
|
+
assert_equal(__FILE__, info[0])
|
264
|
+
assert_equal("test_caller_info", info[2])
|
253
265
|
end
|
254
266
|
|
255
267
|
def test_version_gt
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 592302875
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 3
|
9
9
|
- 0
|
10
10
|
- alpha
|
11
|
-
-
|
12
|
-
version: 3.3.0.alpha.
|
11
|
+
- 11
|
12
|
+
version: 3.3.0.alpha.11
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Nathan Weizenbaum
|
@@ -19,7 +19,7 @@ autorequire:
|
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
21
|
|
22
|
-
date: 2012-11-
|
22
|
+
date: 2012-11-09 00:00:00 -05:00
|
23
23
|
default_executable:
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|