sass 3.3.0.alpha.11 → 3.3.0.alpha.15

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -173,11 +173,10 @@ See `sass-convert --help` for further information and options.
173
173
 
174
174
  ## Authors
175
175
 
176
- Sass was envisioned by [Hampton Catlin](http://www.hamptoncatlin.com)
177
- (@hcatlin). However, Hampton doesn't even know his way around the code anymore
178
- and now occasionally consults on the language issues. Hampton lives in San
179
- Francisco, California and works as VP of Technology
180
- at [Moovweb](http://www.moovweb.com/).
176
+ Sass was envisioned by [Hampton Catlin](http://hamptoncatlin.com) (hcatlin).
177
+ However, Hampton doesn't even know his way around the code anymore and now
178
+ occasionally consults on the language issues. Hampton lives in Cambridge, UK and
179
+ is the owner of [Catlin Software](http://www.catlinsoftware.com/).
181
180
 
182
181
  [Nathan Weizenbaum](http://nex-3.com) is the primary developer and architect of
183
182
  Sass. His hard work has kept the project alive by endlessly answering forum
data/REVISION CHANGED
@@ -1 +1 @@
1
- eb90864aa1f2b1c2e54e110670417e4de34b2dca
1
+ 236f12d9047615e91e832945ebe06fa4952c0395
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.3.0.alpha.11
1
+ 3.3.0.alpha.15
@@ -1 +1 @@
1
- 09 November 2012 22:20:10 GMT
1
+ 01 November 2012 22:44:24 GMT
@@ -125,7 +125,6 @@ module Sass
125
125
  def puts_action(name, color, arg)
126
126
  return if @options[:for_engine][:quiet]
127
127
  printf color(color, "%11s %s\n"), name, arg
128
- STDOUT.flush
129
128
  end
130
129
 
131
130
  # Same as \{Kernel.puts}, but doesn't print anything if the `--quiet` option is set.
@@ -407,13 +406,6 @@ MSG
407
406
  ::Sass::Plugin.on_creating_directory {|dirname| puts_action :directory, :green, dirname}
408
407
  ::Sass::Plugin.on_deleting_css {|filename| puts_action :delete, :yellow, filename}
409
408
  ::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
-
417
409
  raise error unless error.is_a?(::Sass::SyntaxError) && !@options[:stop_on_error]
418
410
  had_error = true
419
411
  puts_action :error, :red, "#{error.sass_filename} (Line #{error.sass_line}: #{error.message})"
@@ -30,7 +30,7 @@ module Sass
30
30
 
31
31
  # @see Base#mtime
32
32
  def mtime(name, options)
33
- file, s = Sass::Util.destructure(find_real_file(@root, name, options))
33
+ file, s = find_real_file(@root, name, options)
34
34
  File.mtime(file) if file
35
35
  rescue Errno::ENOENT
36
36
  nil
@@ -163,7 +163,7 @@ WARNING
163
163
  private
164
164
 
165
165
  def _find(dir, name, options)
166
- full_filename, syntax = Sass::Util.destructure(find_real_file(dir, name, options))
166
+ full_filename, syntax = find_real_file(dir, name, options)
167
167
  return unless full_filename && File.readable?(full_filename)
168
168
 
169
169
  options[:syntax] = syntax
@@ -183,7 +183,6 @@ 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
187
186
  Sass::Plugin.checked_for_updates = true
188
187
  staleness_checker = StalenessChecker.new(engine_options)
189
188
 
@@ -140,7 +140,7 @@ module Sass
140
140
  end
141
141
 
142
142
  def dependencies(uri, importer)
143
- stored_mtime, dependencies = Sass::Util.destructure(@dependencies[[uri, importer]])
143
+ stored_mtime, dependencies = @dependencies[[uri, importer]]
144
144
 
145
145
  if !stored_mtime || stored_mtime < mtime(uri, importer)
146
146
  dependencies = compute_dependencies(uri, importer)
@@ -109,12 +109,7 @@ 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}'$/ &&
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'$/)
112
+ e.backtrace[0] !~ /:in `(block in )?#{ruby_name}'$/
118
113
  raise e
119
114
  end
120
115
  raise Sass::SyntaxError.new("#{e.message} for `#{name}'")
@@ -1235,8 +1235,8 @@ module Sass::Script
1235
1235
  # arguments.
1236
1236
  #
1237
1237
  # @example
1238
- # max(1px, 4px) => 4px
1239
- # max(5em, 3em, 4em) => 5em
1238
+ # max(1px, 4px) => 1px
1239
+ # max(5em, 3em, 4em) => 3em
1240
1240
  # @return [Number] The maximum value
1241
1241
  # @raise [ArgumentError] if any argument isn't a number, or if not all of
1242
1242
  # the arguments have comparable units
@@ -332,7 +332,7 @@ module Sass
332
332
  def use_css_import?; false; end
333
333
 
334
334
  def media_directive
335
- block(node(Sass::Tree::MediaNode.new(expr!(:media_query_list).to_a)), :directive)
335
+ block(node(Sass::Tree::MediaNode.new(media_query_list.to_a)), :directive)
336
336
  end
337
337
 
338
338
  # http://www.w3.org/TR/css3-mediaqueries/#syntax
@@ -709,7 +709,7 @@ module Sass
709
709
  end
710
710
 
711
711
  def element_name
712
- ns, name = Sass::Util.destructure(qualified_name(:allow_star_name))
712
+ ns, name = qualified_name(:allow_star_name)
713
713
  return unless ns || name
714
714
 
715
715
  if name == '*'
@@ -800,7 +800,7 @@ module Sass
800
800
  # could start a pseudo expression like "n+1", or it could start a
801
801
  # selector like "n|m". In order to handle this, we must regrettably
802
802
  # backtrack.
803
- expr, sel = nil, nil
803
+ expr, sel = nil
804
804
  pseudo_err = catch_error do
805
805
  expr = pseudo_expr
806
806
  next if tok?(/[,)]/)
@@ -1024,7 +1024,6 @@ MESSAGE
1024
1024
 
1025
1025
  EXPR_NAMES = {
1026
1026
  :media_query => "media query (e.g. print, screen, print and screen)",
1027
- :media_query_list => "media query (e.g. print, screen, print and screen)",
1028
1027
  :media_expr => "media expression (e.g. (min-device-width: 800px))",
1029
1028
  :pseudo_arg => "expression (e.g. fr, 2n+1)",
1030
1029
  :interp_ident => "identifier",
@@ -23,8 +23,7 @@ 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) ||
27
- (parent.bubbles? && !old_parent.is_a?(Sass::Tree::RootNode))
26
+ @parent = parent unless is_any_of?(parent, SCRIPT_NODES)
28
27
  @parents.push parent
29
28
  super
30
29
  ensure
@@ -333,7 +333,9 @@ 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 ") << "\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")
337
339
  Sass::Util.sass_warn msg
338
340
  []
339
341
  ensure
@@ -298,9 +298,7 @@ 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 = nil)
302
- # JRuby evaluates `caller` incorrectly when it's in an actual default argument.
303
- entry ||= caller[1]
301
+ def caller_info(entry = caller[1])
304
302
  info = entry.scan(/^(.*?):(-?.*?)(?::.*`(.+)')?$/).first
305
303
  info[1] = info[1].to_i
306
304
  # This is added by Rubinius to designate a block, but we don't care about it.
@@ -469,19 +467,6 @@ module Sass
469
467
  Dir.glob(path, &block)
470
468
  end
471
469
 
472
- # Prepare a value for a destructuring assignment (e.g. `a, b =
473
- # val`). This works around a performance bug when using
474
- # ActiveSupport, and only needs to be called when `val` is likely
475
- # to be `nil` reasonably often.
476
- #
477
- # See [this bug report](http://redmine.ruby-lang.org/issues/4917).
478
- #
479
- # @param val [Object]
480
- # @return [Object]
481
- def destructure(val)
482
- val || []
483
- end
484
-
485
470
  ## Cross-Ruby-Version Compatibility
486
471
 
487
472
  # Whether or not this is running under Ruby 1.8 or lower.
@@ -237,6 +237,11 @@ 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
+
240
245
  def test_updating_stylesheets_callback_with_never_update
241
246
  Sass::Plugin.options[:never_update] = true
242
247
  assert_no_callback :updating_stylesheets
@@ -489,10 +489,6 @@ 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/
496
492
  assert_raise_message(ArgumentError, 'wrong number of arguments (0 for 1)') {resolve("arg-error()")}
497
493
  end
498
494
 
@@ -1042,18 +1042,6 @@ body {
1042
1042
  SCSS
1043
1043
  end
1044
1044
 
1045
- def test_malformed_media
1046
- render <<SCSS
1047
- @media {
1048
- margin: 0;
1049
- }
1050
- SCSS
1051
- assert(false, "Expected syntax error")
1052
- rescue Sass::SyntaxError => e
1053
- assert_equal 'Invalid CSS after "@media ": expected media query (e.g. print, screen, print and screen), was "{"', e.message
1054
- assert_equal 1, e.sass_line
1055
- end
1056
-
1057
1045
  private
1058
1046
 
1059
1047
  def assert_selector_parses(selector)
@@ -1977,24 +1977,4 @@ 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
2000
1980
  end
@@ -243,10 +243,6 @@ 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
-
250
246
  def test_caller_info
251
247
  assert_equal(["/tmp/foo.rb", 12, "fizzle"], caller_info("/tmp/foo.rb:12: in `fizzle'"))
252
248
  assert_equal(["/tmp/foo.rb", 12, nil], caller_info("/tmp/foo.rb:12"))
@@ -254,14 +250,6 @@ class UtilTest < Test::Unit::TestCase
254
250
  assert_equal(["", 12, "boop"], caller_info(":12: in `boop'"))
255
251
  assert_equal(["/tmp/foo.rb", -12, "fizzle"], caller_info("/tmp/foo.rb:-12: in `fizzle'"))
256
252
  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])
265
253
  end
266
254
 
267
255
  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: 592302875
4
+ hash: 592302867
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 3
8
8
  - 3
9
9
  - 0
10
10
  - alpha
11
- - 11
12
- version: 3.3.0.alpha.11
11
+ - 15
12
+ version: 3.3.0.alpha.15
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-09 00:00:00 -05:00
22
+ date: 2012-11-01 00:00:00 -04:00
23
23
  default_executable:
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
@@ -233,7 +233,6 @@ files:
233
233
  - test/sass/plugin_test.rb
234
234
  - test/sass/results/alt.css
235
235
  - test/sass/results/basic.css
236
- - test/sass/results/cached_import_option.css
237
236
  - test/sass/results/compact.css
238
237
  - test/sass/results/complex.css
239
238
  - test/sass/results/compressed.css
@@ -259,27 +258,25 @@ files:
259
258
  - test/sass/results/units.css
260
259
  - test/sass/results/warn.css
261
260
  - test/sass/results/warn_imported.css
261
+ - test/sass/results/cached_import_option.css
262
262
  - test/sass/script_conversion_test.rb
263
263
  - test/sass/script_test.rb
264
264
  - test/sass/scss/css_test.rb
265
265
  - test/sass/scss/rx_test.rb
266
266
  - test/sass/scss/scss_test.rb
267
267
  - test/sass/scss/test_helper.rb
268
- - test/sass/templates/_cached_import_option_partial.scss
269
268
  - test/sass/templates/_double_import_loop2.sass
270
269
  - test/sass/templates/_filename_fn_import.scss
271
270
  - test/sass/templates/_imported_charset_ibm866.sass
272
271
  - test/sass/templates/_imported_charset_utf8.sass
273
272
  - test/sass/templates/_imported_content.sass
274
273
  - test/sass/templates/_partial.sass
275
- - test/sass/templates/_same_name_different_partiality.scss
276
274
  - test/sass/templates/alt.sass
277
275
  - test/sass/templates/basic.sass
278
276
  - test/sass/templates/bork1.sass
279
277
  - test/sass/templates/bork2.sass
280
278
  - test/sass/templates/bork3.sass
281
279
  - test/sass/templates/bork4.sass
282
- - test/sass/templates/cached_import_option.scss
283
280
  - test/sass/templates/compact.sass
284
281
  - test/sass/templates/complex.sass
285
282
  - test/sass/templates/compressed.sass
@@ -307,9 +304,6 @@ files:
307
304
  - test/sass/templates/nested_mixin_bork.sass
308
305
  - test/sass/templates/options.sass
309
306
  - test/sass/templates/parent_ref.sass
310
- - test/sass/templates/same_name_different_ext.sass
311
- - test/sass/templates/same_name_different_ext.scss
312
- - test/sass/templates/same_name_different_partiality.scss
313
307
  - test/sass/templates/script.sass
314
308
  - test/sass/templates/scss_import.scss
315
309
  - test/sass/templates/scss_importee.scss
@@ -320,6 +314,12 @@ files:
320
314
  - test/sass/templates/units.sass
321
315
  - test/sass/templates/warn.sass
322
316
  - test/sass/templates/warn_imported.sass
317
+ - test/sass/templates/_cached_import_option_partial.scss
318
+ - test/sass/templates/_same_name_different_partiality.scss
319
+ - test/sass/templates/cached_import_option.scss
320
+ - test/sass/templates/same_name_different_ext.sass
321
+ - test/sass/templates/same_name_different_ext.scss
322
+ - test/sass/templates/same_name_different_partiality.scss
323
323
  - test/sass/test_helper.rb
324
324
  - test/sass/util/multibyte_string_scanner_test.rb
325
325
  - test/sass/util/subset_map_test.rb