sass 3.3.0.alpha.107 → 3.3.0.alpha.120

Sign up to get free protection for your applications and to get access to all the features.
data/REVISION CHANGED
@@ -1 +1 @@
1
- c95e7cf047d7f71abeaf03ec6f3b90d6a08e20c1
1
+ a3ffe87ffef0dddf468060e1b56ca8a0b93cfea3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.3.0.alpha.107
1
+ 3.3.0.alpha.120
@@ -1 +1 @@
1
- 22 March 2013 19:46:38 GMT
1
+ 22 March 2013 22:05:28 GMT
@@ -353,7 +353,7 @@ ERR
353
353
  rendered << "\n" if rendered[-1] != ?\n
354
354
  rendered << "\n" unless compressed
355
355
  rendered << "/*@ sourceMappingURL="
356
- rendered << URI.encode(sourcemap_uri)
356
+ rendered << Sass::Util.escape_uri(sourcemap_uri)
357
357
  rendered << " */"
358
358
  rendered = encode_and_set_charset(rendered)
359
359
  return rendered, sourcemap
@@ -673,9 +673,7 @@ WARNING
673
673
  property
674
674
  else
675
675
  res.pop if comment
676
- scanner_start_pos = scanner.pos
677
676
  interp_parsed = parse_interp(scanner.rest)
678
- scanned_size = scanner.pos - scanner_start_pos
679
677
  selector_range = Sass::Source::Range.new(
680
678
  ident_range.start_pos,
681
679
  Sass::Source::Position.new(@line, to_parser_offset(line.offset) + line.text.length),
@@ -911,7 +909,7 @@ WARNING
911
909
  def parse_import_arg(scanner, offset)
912
910
  return if scanner.eos?
913
911
 
914
- if match_length = scanner.match?(/url\(/i)
912
+ if scanner.match?(/url\(/i)
915
913
  script_parser = Sass::Script::Parser.new(scanner, @line, to_parser_offset(offset), @options)
916
914
  str = script_parser.parse_string
917
915
 
@@ -5,11 +5,6 @@ module Sass::Script
5
5
  # are designed to be overridden by subclasses which may change the semantics somewhat.
6
6
  # The operations listed here are just the defaults.
7
7
  class Literal < Node
8
- require 'sass/script/string'
9
- require 'sass/script/number'
10
- require 'sass/script/color'
11
- require 'sass/script/bool'
12
- require 'sass/script/null'
13
8
  require 'sass/script/list'
14
9
  require 'sass/script/arg_list'
15
10
 
@@ -1,7 +1,10 @@
1
1
  require 'set'
2
+ require 'sass/script/literal'
2
3
  require 'sass/script/string'
3
4
  require 'sass/script/number'
4
5
  require 'sass/script/color'
6
+ require 'sass/script/bool'
7
+ require 'sass/script/null'
5
8
  require 'sass/script/functions'
6
9
  require 'sass/script/unary_operation'
7
10
  require 'sass/script/interpolation'
@@ -35,7 +38,6 @@ module Sass::Script
35
38
 
36
39
  # @see Node#to_sass
37
40
  def to_sass(opts = {})
38
- pred = Sass::Script::Parser.precedence_of(@operator)
39
41
  o1 = operand_to_sass @operand1, :left, opts
40
42
  o2 = operand_to_sass @operand2, :right, opts
41
43
  sep =
@@ -255,7 +255,7 @@ module Sass
255
255
  # is a supersequence of the other, use that, otherwise give up.
256
256
  lcs = Sass::Util.lcs(ops1, ops2)
257
257
  return unless lcs == ops1 || lcs == ops2
258
- res.unshift *(ops1.size > ops2.size ? ops1 : ops2).reverse
258
+ res.unshift(*(ops1.size > ops2.size ? ops1 : ops2).reverse)
259
259
  return res
260
260
  end
261
261
 
@@ -135,9 +135,9 @@ module Sass
135
135
  # by the time extension and unification happen,
136
136
  # this exception will only ever be raised as a result of programmer error
137
137
  def unify(sels, other_subject)
138
- return unless sseq = members.inject(sels) do |sseq, sel|
139
- return unless sseq
140
- sel.unify(sseq)
138
+ return unless sseq = members.inject(sels) do |member, sel|
139
+ return unless member
140
+ sel.unify(member)
141
141
  end
142
142
  SimpleSequence.new(sseq, other_subject || subject?)
143
143
  end
@@ -32,7 +32,7 @@ module Sass
32
32
  # The child nodes of this node.
33
33
  #
34
34
  # @return [Array<Tree::Node>]
35
- attr_accessor :children
35
+ attr_reader :children
36
36
 
37
37
  # Whether or not this node has child nodes.
38
38
  # This may be true even when \{#children} is empty,
@@ -1,5 +1,4 @@
1
1
  require 'pathname'
2
- require 'uri'
3
2
 
4
3
  module Sass::Tree
5
4
  # A static node reprenting a CSS rule.
@@ -115,7 +114,7 @@ module Sass::Tree
115
114
  #
116
115
  # @return [{#to_s => #to_s}]
117
116
  def debug_info
118
- {:filename => filename && ("file://" + URI.escape(File.expand_path(filename))),
117
+ {:filename => filename && ("file://" + Sass::Util.escape_uri(File.expand_path(filename))),
119
118
  :line => self.line}
120
119
  end
121
120
 
@@ -124,12 +124,12 @@ class Sass::Tree::Visitors::Cssize < Sass::Tree::Visitors::Base
124
124
  end
125
125
 
126
126
  sel = sseq.members
127
- parent.resolved_rules.members.each do |seq|
128
- if !seq.members.last.is_a?(Sass::Selector::SimpleSequence)
127
+ parent.resolved_rules.members.each do |member|
128
+ if !member.members.last.is_a?(Sass::Selector::SimpleSequence)
129
129
  raise Sass::SyntaxError.new("#{seq} can't extend: invalid selector")
130
130
  end
131
131
 
132
- @extends[sel] = Extend.new(seq, sel, node, @parent_directives.dup, :not_found)
132
+ @extends[sel] = Extend.new(member, sel, node, @parent_directives.dup, :not_found)
133
133
  end
134
134
  end
135
135
 
@@ -274,7 +274,6 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
274
274
  joined_rules.gsub!(/\s*\n\s*/, "#{line_separator}#{per_rule_indent}")
275
275
 
276
276
  old_spaces = ' ' * @tabs
277
- spaces = ' ' * (@tabs + 1)
278
277
  if node.style != :compressed
279
278
  if node.options[:debug_info] && !@in_directive
280
279
  visit(debug_info_rule(node.debug_info, node.options))
@@ -3,6 +3,7 @@ require 'set'
3
3
  require 'enumerator'
4
4
  require 'stringio'
5
5
  require 'rbconfig'
6
+ require 'uri'
6
7
 
7
8
  require 'sass/root'
8
9
  require 'sass/util/subset_map'
@@ -962,6 +963,15 @@ MSG
962
963
  end
963
964
  end
964
965
 
966
+
967
+ URI_ESCAPE = URI.const_defined?(:DEFAULT_PARSER) ?
968
+ URI::DEFAULT_PARSER :
969
+ URI
970
+
971
+ def escape_uri(uri)
972
+ URI_ESCAPE.escape uri
973
+ end
974
+
965
975
  private
966
976
 
967
977
  # Calculates the memoization table for the Least Common Subsequence algorithm.
@@ -1,8 +1,4 @@
1
1
  require 'date'
2
-
3
- # This is necessary for loading Sass when Haml is required in Rails 3.
4
- # Once the split is complete, we can remove it.
5
- require File.dirname(__FILE__) + '/../sass'
6
2
  require 'sass/util'
7
3
 
8
4
  module Sass
@@ -1347,7 +1347,7 @@ div
1347
1347
  SASS
1348
1348
  end
1349
1349
 
1350
- def test_loud_comment_conversion
1350
+ def test_loud_comment_conversion
1351
1351
  assert_renders(<<SASS, <<SCSS)
1352
1352
  /*! \#{"interpolated"}
1353
1353
  SASS
@@ -489,7 +489,7 @@ CSS
489
489
  SCSS
490
490
  end
491
491
 
492
- def test_nested_extender_with_early_child_selectors_doesnt_subseq_them
492
+ def test_nested_extender_with_early_child_selector
493
493
  assert_equal <<CSS, render(<<SCSS)
494
494
  .foo .bar, .foo .bip > .baz {
495
495
  a: b; }
@@ -1061,7 +1061,7 @@ CSS
1061
1061
  x! .bar {a: b}
1062
1062
  y! .bap {@extend .bar}
1063
1063
  SCSS
1064
- end
1064
+ end
1065
1065
 
1066
1066
  def test_extend_warns_when_extendee_doesnt_exist
1067
1067
  assert_raise_message(Sass::SyntaxError, <<ERR) {render(<<SCSS)}
@@ -1089,20 +1089,6 @@ SCSS
1089
1089
  a.bar {
1090
1090
  a: b; }
1091
1091
 
1092
- .bar, b.foo {
1093
- c: d; }
1094
- CSS
1095
- a.bar {a: b}
1096
- .bar {c: d}
1097
- b.foo {@extend .bar}
1098
- SCSS
1099
- end
1100
-
1101
- def test_extend_succeeds_when_one_extension_fails_but_others_dont
1102
- assert_equal(<<CSS, render(<<SCSS))
1103
- a.bar {
1104
- a: b; }
1105
-
1106
1092
  .bar, b.foo {
1107
1093
  c: d; }
1108
1094
  CSS
@@ -200,7 +200,7 @@ CSS
200
200
  }
201
201
  SCSS
202
202
 
203
- rendered, sourcemap = engine.render_with_sourcemap('sourcemap_uri')
203
+ _, sourcemap = engine.render_with_sourcemap('sourcemap_uri')
204
204
  assert_equal <<JSON.strip, sourcemap.to_json(:css_uri => 'css_uri')
205
205
  {
206
206
  "version": "3",
@@ -223,7 +223,7 @@ JSON
223
223
  .foo {a: b}
224
224
  SCSS
225
225
 
226
- rendered, sourcemap = engine.render_with_sourcemap('http://1.example.com/style.map')
226
+ _, sourcemap = engine.render_with_sourcemap('http://1.example.com/style.map')
227
227
 
228
228
  assert_warning(<<WARNING) {sourcemap.to_json(:css_uri => 'css_uri')}
229
229
  WARNING: Couldn't determine public URL for "#{filename_for_test(:scss)}" while generating sourcemap.
@@ -244,7 +244,7 @@ WARNING
244
244
  .foo {a: b}
245
245
  SCSS
246
246
 
247
- rendered, sourcemap = engine.render_with_sourcemap('http://1.example.com/style.map')
247
+ _, sourcemap = engine.render_with_sourcemap('http://1.example.com/style.map')
248
248
 
249
249
  assert_warning(<<WARNING) {sourcemap.to_json(:css_uri => 'css_uri', :css_path => 'css_path')}
250
250
  WARNING: Couldn't determine public URL for "#{filename_for_test(:scss)}" while generating sourcemap.
@@ -293,7 +293,7 @@ JSON
293
293
  .foo {a: b}
294
294
  SCSS
295
295
 
296
- rendered, sourcemap = engine.render_with_sourcemap('http://map.example.com/map/style.map')
296
+ _, sourcemap = engine.render_with_sourcemap('http://map.example.com/map/style.map')
297
297
  css_path = 'static/style.css'
298
298
  sourcemap_path = 'map/style.map'
299
299
  assert_equal <<JSON.strip, sourcemap.to_json(:css_path => css_path, :sourcemap_path => sourcemap_path)
@@ -651,7 +651,7 @@ SCSS
651
651
  ## Selectors
652
652
 
653
653
  # Taken from http://dev.w3.org/csswg/selectors4/#overview
654
- def test_summarized_selectors
654
+ def test_summarized_selectors_with_element
655
655
  assert_selector_parses('*')
656
656
  assert_selector_parses('E')
657
657
  assert_selector_parses('E:not(s)')
@@ -5,7 +5,7 @@ require File.dirname(__FILE__) + '/test_helper'
5
5
 
6
6
  class SourcemapTest < Test::Unit::TestCase
7
7
  def test_to_json_requires_args
8
- rendered, sourcemap = render_with_sourcemap('')
8
+ _, sourcemap = render_with_sourcemap('')
9
9
  assert_raise(ArgumentError) {sourcemap.to_json({})}
10
10
  assert_raise(ArgumentError) {sourcemap.to_json({:css_path => 'foo'})}
11
11
  assert_raise(ArgumentError) {sourcemap.to_json({:sourcemap_path => 'foo'})}
@@ -474,7 +474,7 @@ SCSS
474
474
  CSS
475
475
  end
476
476
 
477
- def test_while_sourcemap_sass
477
+ def test_while_sourcemap_sass
478
478
  assert_parses_with_mapping <<'SASS', <<'CSS', :syntax => :sass
479
479
  $i: 6
480
480
  @while $i > 0
@@ -723,7 +723,6 @@ CSS
723
723
  start_positions = {}
724
724
  text.split("\n").each_with_index do |line_text, line|
725
725
  line += 1 # lines shoud be 1-based
726
- match_start = 0
727
726
  while match = line_text.match(ANNOTATION_REGEX)
728
727
  closing = !match[1].empty?
729
728
  name = match[2]
@@ -750,13 +749,13 @@ CSS
750
749
  source_ranges = build_ranges(source, source_file_name)
751
750
  target_ranges = build_ranges(css)
752
751
  map = Sass::Source::Map.new
753
- mappings = Sass::Util.flatten(source_ranges.map do |(name, sources)|
752
+ Sass::Util.flatten(source_ranges.map do |(name, sources)|
754
753
  assert(sources.length == 1, "#{sources.length} source ranges encountered for annotation #{name}")
755
754
  assert(target_ranges[name], "No target ranges for annotation #{name}")
756
755
  target_ranges[name].map {|target_range| [sources.first, target_range]}
757
756
  end, 1).
758
- sort_by {|(source, target)| [target.start_pos.line, target.start_pos.offset]}.
759
- each {|(source, target)| map.add(source, target)}
757
+ sort_by {|(_, target)| [target.start_pos.line, target.start_pos.offset]}.
758
+ each {|(s2, target)| map.add(s2, target)}
760
759
  map
761
760
  end
762
761
 
@@ -324,7 +324,7 @@ class UtilTest < Test::Unit::TestCase
324
324
 
325
325
  def test_json_value_of
326
326
  assert_json_value 0, "0"
327
- assert_json_value -42, "-42"
327
+ assert_json_value(-42, "-42")
328
328
  assert_json_value 42, "42"
329
329
  assert_json_value true, "true"
330
330
  assert_json_value false, "false"
@@ -7,7 +7,12 @@ require 'sass'
7
7
  require 'mathn' if ENV['MATHN'] == 'true'
8
8
 
9
9
  Sass::RAILS_LOADED = true unless defined?(Sass::RAILS_LOADED)
10
- Encoding.default_external = 'UTF-8' if defined?(Encoding)
10
+
11
+ if defined?(Encoding)
12
+ $-w, w = false, $-w
13
+ Encoding.default_external = 'UTF-8'
14
+ $-w = w
15
+ end
11
16
 
12
17
  module Sass::Script::Functions
13
18
  def option(name)
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: 592303067
4
+ hash: 592303101
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 3
8
8
  - 3
9
9
  - 0
10
10
  - alpha
11
- - 107
12
- version: 3.3.0.alpha.107
11
+ - 120
12
+ version: 3.3.0.alpha.120
13
13
  platform: ruby
14
14
  authors:
15
15
  - Nathan Weizenbaum