sass 3.3.0 → 3.4.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (208) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +3 -1
  3. data/CODE_OF_CONDUCT.md +10 -0
  4. data/CONTRIBUTING.md +148 -0
  5. data/MIT-LICENSE +1 -1
  6. data/README.md +76 -62
  7. data/Rakefile +104 -24
  8. data/VERSION +1 -1
  9. data/VERSION_DATE +1 -1
  10. data/VERSION_NAME +1 -1
  11. data/bin/sass +1 -1
  12. data/bin/scss +1 -1
  13. data/extra/sass-spec-ref.sh +32 -0
  14. data/extra/update_watch.rb +1 -1
  15. data/lib/sass/cache_stores/filesystem.rb +9 -5
  16. data/lib/sass/cache_stores/memory.rb +4 -5
  17. data/lib/sass/callbacks.rb +2 -2
  18. data/lib/sass/css.rb +12 -13
  19. data/lib/sass/deprecation.rb +55 -0
  20. data/lib/sass/engine.rb +106 -70
  21. data/lib/sass/environment.rb +39 -19
  22. data/lib/sass/error.rb +17 -20
  23. data/lib/sass/exec/base.rb +199 -0
  24. data/lib/sass/exec/sass_convert.rb +283 -0
  25. data/lib/sass/exec/sass_scss.rb +440 -0
  26. data/lib/sass/exec.rb +5 -771
  27. data/lib/sass/features.rb +9 -2
  28. data/lib/sass/importers/base.rb +8 -3
  29. data/lib/sass/importers/filesystem.rb +30 -38
  30. data/lib/sass/logger/base.rb +8 -2
  31. data/lib/sass/logger/delayed.rb +50 -0
  32. data/lib/sass/logger.rb +8 -3
  33. data/lib/sass/media.rb +1 -4
  34. data/lib/sass/plugin/compiler.rb +224 -90
  35. data/lib/sass/plugin/configuration.rb +38 -22
  36. data/lib/sass/plugin/merb.rb +2 -2
  37. data/lib/sass/plugin/rack.rb +3 -3
  38. data/lib/sass/plugin/rails.rb +1 -1
  39. data/lib/sass/plugin/staleness_checker.rb +4 -4
  40. data/lib/sass/plugin.rb +6 -5
  41. data/lib/sass/script/css_lexer.rb +1 -1
  42. data/lib/sass/script/css_parser.rb +2 -3
  43. data/lib/sass/script/css_variable_warning.rb +52 -0
  44. data/lib/sass/script/functions.rb +739 -318
  45. data/lib/sass/script/lexer.rb +134 -54
  46. data/lib/sass/script/parser.rb +252 -56
  47. data/lib/sass/script/tree/funcall.rb +13 -6
  48. data/lib/sass/script/tree/interpolation.rb +127 -4
  49. data/lib/sass/script/tree/list_literal.rb +31 -4
  50. data/lib/sass/script/tree/literal.rb +4 -0
  51. data/lib/sass/script/tree/node.rb +21 -3
  52. data/lib/sass/script/tree/operation.rb +54 -1
  53. data/lib/sass/script/tree/selector.rb +26 -0
  54. data/lib/sass/script/tree/string_interpolation.rb +59 -38
  55. data/lib/sass/script/tree/variable.rb +1 -1
  56. data/lib/sass/script/tree.rb +1 -0
  57. data/lib/sass/script/value/base.rb +17 -14
  58. data/lib/sass/script/value/bool.rb +0 -5
  59. data/lib/sass/script/value/color.rb +78 -42
  60. data/lib/sass/script/value/helpers.rb +119 -2
  61. data/lib/sass/script/value/list.rb +0 -15
  62. data/lib/sass/script/value/map.rb +1 -1
  63. data/lib/sass/script/value/null.rb +0 -5
  64. data/lib/sass/script/value/number.rb +112 -31
  65. data/lib/sass/script/value/string.rb +102 -13
  66. data/lib/sass/script/value.rb +0 -1
  67. data/lib/sass/script.rb +3 -3
  68. data/lib/sass/scss/css_parser.rb +24 -4
  69. data/lib/sass/scss/parser.rb +290 -383
  70. data/lib/sass/scss/rx.rb +17 -9
  71. data/lib/sass/scss/static_parser.rb +306 -4
  72. data/lib/sass/scss.rb +0 -2
  73. data/lib/sass/selector/abstract_sequence.rb +35 -18
  74. data/lib/sass/selector/comma_sequence.rb +114 -19
  75. data/lib/sass/selector/pseudo.rb +266 -0
  76. data/lib/sass/selector/sequence.rb +146 -40
  77. data/lib/sass/selector/simple.rb +22 -33
  78. data/lib/sass/selector/simple_sequence.rb +122 -39
  79. data/lib/sass/selector.rb +57 -197
  80. data/lib/sass/shared.rb +2 -2
  81. data/lib/sass/source/map.rb +31 -14
  82. data/lib/sass/source/position.rb +4 -4
  83. data/lib/sass/stack.rb +2 -8
  84. data/lib/sass/supports.rb +10 -13
  85. data/lib/sass/tree/at_root_node.rb +1 -0
  86. data/lib/sass/tree/charset_node.rb +1 -1
  87. data/lib/sass/tree/comment_node.rb +1 -1
  88. data/lib/sass/tree/css_import_node.rb +9 -1
  89. data/lib/sass/tree/directive_node.rb +8 -2
  90. data/lib/sass/tree/error_node.rb +18 -0
  91. data/lib/sass/tree/extend_node.rb +1 -1
  92. data/lib/sass/tree/function_node.rb +9 -0
  93. data/lib/sass/tree/import_node.rb +6 -5
  94. data/lib/sass/tree/keyframe_rule_node.rb +15 -0
  95. data/lib/sass/tree/node.rb +5 -3
  96. data/lib/sass/tree/prop_node.rb +6 -7
  97. data/lib/sass/tree/rule_node.rb +26 -11
  98. data/lib/sass/tree/visitors/check_nesting.rb +56 -32
  99. data/lib/sass/tree/visitors/convert.rb +59 -44
  100. data/lib/sass/tree/visitors/cssize.rb +34 -30
  101. data/lib/sass/tree/visitors/deep_copy.rb +6 -1
  102. data/lib/sass/tree/visitors/extend.rb +15 -13
  103. data/lib/sass/tree/visitors/perform.rb +87 -50
  104. data/lib/sass/tree/visitors/set_options.rb +15 -1
  105. data/lib/sass/tree/visitors/to_css.rb +72 -43
  106. data/lib/sass/util/multibyte_string_scanner.rb +0 -2
  107. data/lib/sass/util/normalized_map.rb +0 -1
  108. data/lib/sass/util/subset_map.rb +2 -3
  109. data/lib/sass/util.rb +334 -154
  110. data/lib/sass/version.rb +7 -7
  111. data/lib/sass.rb +10 -8
  112. data/test/sass/cache_test.rb +62 -20
  113. data/test/sass/callbacks_test.rb +1 -1
  114. data/test/sass/compiler_test.rb +24 -11
  115. data/test/sass/conversion_test.rb +241 -50
  116. data/test/sass/css2sass_test.rb +73 -5
  117. data/test/sass/css_variable_test.rb +132 -0
  118. data/test/sass/encoding_test.rb +219 -0
  119. data/test/sass/engine_test.rb +343 -260
  120. data/test/sass/exec_test.rb +12 -2
  121. data/test/sass/extend_test.rb +333 -44
  122. data/test/sass/functions_test.rb +353 -260
  123. data/test/sass/importer_test.rb +40 -21
  124. data/test/sass/logger_test.rb +1 -1
  125. data/test/sass/more_results/more_import.css +1 -1
  126. data/test/sass/more_templates/more1.sass +10 -10
  127. data/test/sass/more_templates/more_import.sass +2 -2
  128. data/test/sass/plugin_test.rb +24 -21
  129. data/test/sass/results/compact.css +1 -1
  130. data/test/sass/results/complex.css +4 -4
  131. data/test/sass/results/expanded.css +1 -1
  132. data/test/sass/results/import.css +1 -1
  133. data/test/sass/results/import_charset_ibm866.css +2 -2
  134. data/test/sass/results/mixins.css +17 -17
  135. data/test/sass/results/nested.css +1 -1
  136. data/test/sass/results/parent_ref.css +2 -2
  137. data/test/sass/results/script.css +5 -5
  138. data/test/sass/results/scss_import.css +1 -1
  139. data/test/sass/script_conversion_test.rb +71 -39
  140. data/test/sass/script_test.rb +714 -123
  141. data/test/sass/scss/css_test.rb +213 -30
  142. data/test/sass/scss/rx_test.rb +8 -4
  143. data/test/sass/scss/scss_test.rb +766 -22
  144. data/test/sass/source_map_test.rb +263 -95
  145. data/test/sass/superselector_test.rb +210 -0
  146. data/test/sass/templates/_partial.sass +1 -1
  147. data/test/sass/templates/basic.sass +10 -10
  148. data/test/sass/templates/bork1.sass +1 -1
  149. data/test/sass/templates/bork5.sass +1 -1
  150. data/test/sass/templates/compact.sass +10 -10
  151. data/test/sass/templates/complex.sass +187 -187
  152. data/test/sass/templates/compressed.sass +10 -10
  153. data/test/sass/templates/expanded.sass +10 -10
  154. data/test/sass/templates/import.sass +2 -2
  155. data/test/sass/templates/importee.sass +3 -3
  156. data/test/sass/templates/mixins.sass +22 -22
  157. data/test/sass/templates/multiline.sass +4 -4
  158. data/test/sass/templates/nested.sass +13 -13
  159. data/test/sass/templates/parent_ref.sass +12 -12
  160. data/test/sass/templates/script.sass +70 -70
  161. data/test/sass/templates/scss_import.scss +2 -1
  162. data/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +1 -1
  163. data/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +2 -2
  164. data/test/sass/templates/subdir/subdir.sass +3 -3
  165. data/test/sass/templates/units.sass +10 -10
  166. data/test/sass/test_helper.rb +1 -1
  167. data/test/sass/util/multibyte_string_scanner_test.rb +11 -3
  168. data/test/sass/util/normalized_map_test.rb +1 -1
  169. data/test/sass/util/subset_map_test.rb +2 -2
  170. data/test/sass/util_test.rb +46 -45
  171. data/test/sass/value_helpers_test.rb +5 -7
  172. data/test/sass-spec.yml +3 -0
  173. data/test/test_helper.rb +7 -6
  174. data/vendor/listen/CHANGELOG.md +1 -228
  175. data/vendor/listen/Gemfile +5 -15
  176. data/vendor/listen/README.md +111 -77
  177. data/vendor/listen/Rakefile +0 -42
  178. data/vendor/listen/lib/listen/adapter.rb +195 -82
  179. data/vendor/listen/lib/listen/adapters/bsd.rb +27 -64
  180. data/vendor/listen/lib/listen/adapters/darwin.rb +21 -58
  181. data/vendor/listen/lib/listen/adapters/linux.rb +23 -55
  182. data/vendor/listen/lib/listen/adapters/polling.rb +25 -34
  183. data/vendor/listen/lib/listen/adapters/windows.rb +50 -46
  184. data/vendor/listen/lib/listen/directory_record.rb +96 -61
  185. data/vendor/listen/lib/listen/listener.rb +135 -37
  186. data/vendor/listen/lib/listen/turnstile.rb +9 -5
  187. data/vendor/listen/lib/listen/version.rb +1 -1
  188. data/vendor/listen/lib/listen.rb +33 -19
  189. data/vendor/listen/listen.gemspec +6 -0
  190. data/vendor/listen/spec/listen/adapter_spec.rb +43 -77
  191. data/vendor/listen/spec/listen/adapters/polling_spec.rb +8 -8
  192. data/vendor/listen/spec/listen/directory_record_spec.rb +81 -56
  193. data/vendor/listen/spec/listen/listener_spec.rb +128 -39
  194. data/vendor/listen/spec/listen_spec.rb +15 -21
  195. data/vendor/listen/spec/spec_helper.rb +4 -0
  196. data/vendor/listen/spec/support/adapter_helper.rb +52 -15
  197. data/vendor/listen/spec/support/directory_record_helper.rb +7 -5
  198. data/vendor/listen/spec/support/listeners_helper.rb +30 -7
  199. metadata +310 -300
  200. data/CONTRIBUTING +0 -3
  201. data/ext/mkrf_conf.rb +0 -27
  202. data/lib/sass/script/value/deprecated_false.rb +0 -55
  203. data/lib/sass/scss/script_lexer.rb +0 -15
  204. data/lib/sass/scss/script_parser.rb +0 -25
  205. data/vendor/listen/lib/listen/dependency_manager.rb +0 -126
  206. data/vendor/listen/lib/listen/multi_listener.rb +0 -143
  207. data/vendor/listen/spec/listen/dependency_manager_spec.rb +0 -107
  208. data/vendor/listen/spec/listen/multi_listener_spec.rb +0 -174
@@ -12,8 +12,10 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
12
12
  @tabs = 0
13
13
  @line = 1
14
14
  @offset = 1
15
- @result = ""
16
- @source_mapping = Sass::Source::Map.new if build_source_mapping
15
+ @result = String.new("")
16
+ @source_mapping = build_source_mapping ? Sass::Source::Map.new : nil
17
+ @lstrip = nil
18
+ @in_directive = false
17
19
  end
18
20
 
19
21
  # Runs the visitor on `node`.
@@ -51,6 +53,10 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
51
53
  @source_mapping.add(source_range, target_range)
52
54
  end
53
55
 
56
+ def trailing_semicolon?
57
+ @result.end_with?(";") && !@result.end_with?('\;')
58
+ end
59
+
54
60
  # Move the output cursor back `chars` characters.
55
61
  def erase!(chars)
56
62
  return if chars == 0
@@ -98,7 +104,7 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
98
104
  @lstrip = true
99
105
  yield
100
106
  ensure
101
- @lstrip = @lstrip && old_lstrip
107
+ @lstrip &&= old_lstrip
102
108
  end
103
109
 
104
110
  # Prepend `prefix` to the output string.
@@ -116,32 +122,30 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
116
122
  node.children.each do |child|
117
123
  next if child.invisible?
118
124
  visit(child)
119
- unless node.style == :compressed
120
- output "\n"
121
- if child.is_a?(Sass::Tree::DirectiveNode) && child.has_children && !child.bubbles?
122
- output "\n"
123
- end
124
- end
125
+ next if node.style == :compressed
126
+ output "\n"
127
+ next unless child.is_a?(Sass::Tree::DirectiveNode) && child.has_children && !child.bubbles?
128
+ output "\n"
125
129
  end
126
130
  rstrip!
131
+ if node.style == :compressed && trailing_semicolon?
132
+ erase! 1
133
+ end
127
134
  return "" if @result.empty?
128
135
 
129
136
  output "\n"
130
- return @result if Sass::Util.ruby1_8? || @result.ascii_only?
131
-
132
- if node.children.first.is_a?(Sass::Tree::CharsetNode)
133
- begin
134
- encoding = node.children.first.name
135
- # Default to big-endian encoding, because we have to decide somehow
136
- encoding << 'BE' if encoding =~ /\Autf-(16|32)\Z/i
137
- @result = @result.encode(Encoding.find(encoding))
138
- rescue EncodingError
137
+
138
+ unless Sass::Util.ruby1_8? || @result.ascii_only?
139
+ if node.style == :compressed
140
+ # A byte order mark is sufficient to tell browsers that this
141
+ # file is UTF-8 encoded, and will override any other detection
142
+ # methods as per http://encoding.spec.whatwg.org/#decode-and-encode.
143
+ prepend! "\uFEFF"
144
+ else
145
+ prepend! "@charset \"UTF-8\";\n"
139
146
  end
140
147
  end
141
148
 
142
- prepend! "@charset \"#{@result.encoding.name}\";#{
143
- node.style == :compressed ? '' : "\n"
144
- }".encode(@result.encoding)
145
149
  @result
146
150
  rescue Sass::SyntaxError => e
147
151
  e.sass_template ||= node.template
@@ -155,13 +159,14 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
155
159
  def visit_comment(node)
156
160
  return if node.invisible?
157
161
  spaces = (' ' * [@tabs - node.resolved_value[/^ */].size, 0].max)
162
+ output(spaces)
158
163
 
159
- content = node.resolved_value.gsub(/^/, spaces)
164
+ content = node.resolved_value.split("\n").join("\n" + spaces)
160
165
  if node.type == :silent
161
- content.gsub!(%r{^(\s*)//(.*)$}) {|md| "#{$1}/*#{$2} */"}
166
+ content.gsub!(%r{^(\s*)//(.*)$}) {"#{$1}/*#{$2} */"}
162
167
  end
163
168
  if (node.style == :compact || node.style == :compressed) && node.type != :loud
164
- content.gsub!(/\n +(\* *(?!\/))?/, ' ')
169
+ content.gsub!(%r{\n +(\* *(?!/))?}, ' ')
165
170
  end
166
171
  for_node(node) {output(content)}
167
172
  end
@@ -174,28 +179,32 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
174
179
  if !node.has_children || node.children.empty?
175
180
  output(tab_str)
176
181
  for_node(node) {output(node.resolved_value)}
177
- output(!node.has_children ? ";" : " {}")
182
+ if node.has_children
183
+ output("#{' ' unless node.style == :compressed}{}")
184
+ elsif node.children.empty?
185
+ output(";")
186
+ end
178
187
  return
179
188
  end
180
189
 
181
- @in_directive = @in_directive || !node.is_a?(Sass::Tree::MediaNode)
190
+ @in_directive ||= !node.is_a?(Sass::Tree::MediaNode)
182
191
  output(tab_str) if node.style != :compressed
183
192
  for_node(node) {output(node.resolved_value)}
184
193
  output(node.style == :compressed ? "{" : " {")
185
194
  output(node.style == :compact ? ' ' : "\n") if node.style != :compressed
186
195
 
187
- was_prop = false
196
+ had_children = true
188
197
  first = true
189
198
  node.children.each do |child|
190
199
  next if child.invisible?
191
200
  if node.style == :compact
192
201
  if child.is_a?(Sass::Tree::PropNode)
193
- with_tabs(first || was_prop ? 0 : @tabs + 1) do
202
+ with_tabs(first || !had_children ? 0 : @tabs + 1) do
194
203
  visit(child)
195
204
  output(' ')
196
205
  end
197
206
  else
198
- if was_prop
207
+ unless had_children
199
208
  erase! 1
200
209
  output "\n"
201
210
  end
@@ -209,18 +218,23 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
209
218
  rstrip!
210
219
  output "\n"
211
220
  end
212
- was_prop = child.is_a?(Sass::Tree::PropNode)
221
+ had_children = child.has_children
213
222
  first = false
214
223
  elsif node.style == :compressed
215
- output(was_prop ? ";" : "")
224
+ unless had_children
225
+ output(";") unless trailing_semicolon?
226
+ end
216
227
  with_tabs(0) {visit(child)}
217
- was_prop = child.is_a?(Sass::Tree::PropNode)
228
+ had_children = child.has_children
218
229
  else
219
230
  with_tabs(@tabs + 1) {visit(child)}
220
231
  output "\n"
221
232
  end
222
233
  end
223
234
  rstrip!
235
+ if node.style == :compressed && trailing_semicolon?
236
+ erase! 1
237
+ end
224
238
  if node.style == :expanded
225
239
  output("\n#{tab_str}")
226
240
  elsif node.style != :compressed
@@ -235,7 +249,7 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
235
249
 
236
250
  def visit_media(node)
237
251
  with_tabs(@tabs + node.tabs) {visit_directive(node)}
238
- output("\n") if node.group_end
252
+ output("\n") if node.style != :compressed && node.group_end
239
253
  end
240
254
 
241
255
  def visit_supports(node)
@@ -281,10 +295,13 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
281
295
 
282
296
  joined_rules = node.resolved_rules.members.map do |seq|
283
297
  next if seq.has_placeholder?
284
- rule_part = seq.to_a.join
298
+ rule_part = seq.to_s(:style => node.style)
285
299
  if node.style == :compressed
286
300
  rule_part.gsub!(/([^,])\s*\n\s*/m, '\1 ')
287
- rule_part.gsub!(/\s*([,+>])\s*/m, '\1')
301
+ rule_part.gsub!(/\s*([+>])\s*/m, '\1')
302
+ rule_part.gsub!(/nth([^( ]*)\(([^)]*)\)/m) do |match|
303
+ match.tr(" \t\n", "")
304
+ end
288
305
  rule_part.strip!
289
306
  end
290
307
  rule_part
@@ -309,8 +326,8 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
309
326
  relative_filename =
310
327
  if node.options[:css_filename]
311
328
  begin
312
- Sass::Util.pathname(node.filename).relative_path_from(
313
- Sass::Util.pathname(File.dirname(node.options[:css_filename]))).to_s
329
+ Sass::Util.relative_path_from(
330
+ node.filename, File.dirname(node.options[:css_filename])).to_s
314
331
  rescue ArgumentError
315
332
  nil
316
333
  end
@@ -323,7 +340,7 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
323
340
  end
324
341
  end
325
342
 
326
- end_props, trailer, tabs = '', '', 0
343
+ end_props, trailer, tabs = '', '', 0
327
344
  if node.style == :compact
328
345
  separator, end_props, bracket = ' ', ' ', ' { '
329
346
  trailer = "\n" if node.group_end
@@ -341,10 +358,18 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
341
358
 
342
359
  with_tabs(tabs) do
343
360
  node.children.each_with_index do |child, i|
344
- output(separator) if i > 0
361
+ if i > 0
362
+ if separator.start_with?(";") && trailing_semicolon?
363
+ erase! 1
364
+ end
365
+ output(separator)
366
+ end
345
367
  visit(child)
346
368
  end
347
369
  end
370
+ if node.style == :compressed && trailing_semicolon?
371
+ erase! 1
372
+ end
348
373
 
349
374
  output(end_props)
350
375
  output("}" + trailer)
@@ -353,6 +378,10 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
353
378
  # @comment
354
379
  # rubocop:enable MethodLength
355
380
 
381
+ def visit_keyframerule(node)
382
+ visit_directive(node)
383
+ end
384
+
356
385
  private
357
386
 
358
387
  def debug_info_rule(debug_info, options)
@@ -361,10 +390,10 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
361
390
  rule = Sass::Tree::RuleNode.new([""])
362
391
  rule.resolved_rules = Sass::Selector::CommaSequence.new(
363
392
  [Sass::Selector::Sequence.new(
364
- [Sass::Selector::SimpleSequence.new(
365
- [Sass::Selector::Element.new(k.to_s.gsub(/[^\w-]/, "\\\\\\0"), nil)],
366
- false)
367
- ])
393
+ [Sass::Selector::SimpleSequence.new(
394
+ [Sass::Selector::Element.new(k.to_s.gsub(/[^\w-]/, "\\\\\\0"), nil)],
395
+ false)
396
+ ])
368
397
  ])
369
398
  prop = Sass::Tree::PropNode.new([""], Sass::Script::Value::String.new(''), :new)
370
399
  prop.resolved_name = "font-family"
@@ -1,9 +1,7 @@
1
1
  require 'strscan'
2
2
 
3
3
  if Sass::Util.ruby1_8?
4
- # rubocop:disable ConstantName
5
4
  Sass::Util::MultibyteStringScanner = StringScanner
6
- # rubocop:enable ConstantName
7
5
  else
8
6
  if Sass::Util.rbx?
9
7
  # Rubinius's StringScanner class implements some of its methods in terms of
@@ -1,5 +1,4 @@
1
1
  require 'delegate'
2
- require 'sass/util'
3
2
 
4
3
  module Sass
5
4
  module Util
@@ -59,7 +59,7 @@ module Sass
59
59
  #
60
60
  # In the worst case, this runs in `O(m*max(n, log m))` time,
61
61
  # where `n` is the size of `set`
62
- # and `m` is the number of assocations in the map.
62
+ # and `m` is the number of associations in the map.
63
63
  # However, unless many keys in the map overlap with `set`,
64
64
  # `m` will typically be much smaller.
65
65
  #
@@ -78,8 +78,7 @@ module Sass
78
78
  next unless subset.subset?(set)
79
79
  [index, subenum]
80
80
  end
81
- end
82
- res = Sass::Util.flatten(res, 1)
81
+ end.flatten(1)
83
82
  res.compact!
84
83
  res.uniq!
85
84
  res.sort!