sass 3.1.0.alpha.47 → 3.1.0.alpha.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/EDGE_GEM_VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.0.alpha.47
1
+ 3.1.0.alpha.48
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.0.alpha.47
1
+ 3.1.0.alpha.48
data/lib/sass/exec.rb CHANGED
@@ -231,7 +231,7 @@ END
231
231
  opts.on('-q', '--quiet', 'Silence warnings and status messages during compilation.') do
232
232
  @options[:for_engine][:quiet] = true
233
233
  end
234
- opts.on('--compass', 'Loads compass.') do
234
+ opts.on('--compass', 'Make Compass imports available and load project configuration.') do
235
235
  @options[:compass] = true
236
236
  end
237
237
  opts.on('-g', '--debug-info',
@@ -51,17 +51,5 @@ module Sass::Tree
51
51
  end
52
52
  children
53
53
  end
54
-
55
- # Returns an error message if the given child node is invalid,
56
- # and false otherwise.
57
- #
58
- # {ExtendNode}s are valid within {ForNode}s.
59
- #
60
- # @param child [Tree::Node] A potential child node.
61
- # @return [Boolean, String] Whether or not the child node is valid,
62
- # as well as the error message to display if it is invalid
63
- def invalid_child?(child)
64
- super unless child.is_a?(ExtendNode)
65
- end
66
54
  end
67
55
  end
@@ -84,17 +84,5 @@ module Sass::Tree
84
84
  return @else.perform(environment) if @else
85
85
  []
86
86
  end
87
-
88
- # Returns an error message if the given child node is invalid,
89
- # and false otherwise.
90
- #
91
- # {ExtendNode}s are valid within {IfNode}s.
92
- #
93
- # @param child [Tree::Node] A potential child node.
94
- # @return [Boolean, String] Whether or not the child node is valid,
95
- # as well as the error message to display if it is invalid
96
- def invalid_child?(child)
97
- super unless child.is_a?(ExtendNode)
98
- end
99
87
  end
100
88
  end
@@ -43,18 +43,6 @@ module Sass
43
43
  environment.set_mixin(@name, Sass::Mixin.new(@name, @args, environment, children))
44
44
  []
45
45
  end
46
-
47
- # Returns an error message if the given child node is invalid,
48
- # and false otherwise.
49
- #
50
- # {ExtendNode}s are valid within {MixinDefNode}s.
51
- #
52
- # @param child [Tree::Node] A potential child node.
53
- # @return [Boolean, String] Whether or not the child node is valid,
54
- # as well as the error message to display if it is invalid
55
- def invalid_child?(child)
56
- super unless child.is_a?(ExtendNode)
57
- end
58
46
  end
59
47
  end
60
48
  end
@@ -31,18 +31,6 @@ module Sass::Tree
31
31
 
32
32
  protected
33
33
 
34
- # Returns an error message if the given child node is invalid,
35
- # and false otherwise.
36
- #
37
- # {ExtendNode}s are valid within {MixinNode}s.
38
- #
39
- # @param child [Tree::Node] A potential child node
40
- # @return [Boolean, String] Whether or not the child node is valid,
41
- # as well as the error message to display if it is invalid
42
- def invalid_child?(child)
43
- super unless child.is_a?(ExtendNode)
44
- end
45
-
46
34
  # @see Node#to_src
47
35
  def to_src(tabs, opts, fmt)
48
36
  unless @args.empty? && @keywords.empty?
@@ -340,6 +340,7 @@ module Sass
340
340
  # @see #perform
341
341
  def perform!(environment)
342
342
  self.children = perform_children(Environment.new(environment))
343
+ self.children.each {|c| check_child! c}
343
344
  end
344
345
 
345
346
  # Non-destructively runs \{#perform} on all children of the current node.
@@ -393,8 +394,6 @@ module Sass
393
394
  "Mixins may only be defined at the root of a document."
394
395
  when Tree::ImportNode
395
396
  "Import directives may only be used at the root of a document."
396
- when Tree::ExtendNode
397
- "Extend directives may only be used within rules."
398
397
  end
399
398
  end
400
399
 
@@ -148,9 +148,15 @@ module Sass
148
148
  #
149
149
  # @see Node#invalid_child?
150
150
  def invalid_child?(child)
151
- return unless child.is_a?(Tree::PropNode)
152
- "Properties aren't allowed at the root of a document." +
153
- child.pseudo_class_selector_message
151
+ case child
152
+ when Tree::ExtendNode
153
+ "Extend directives may only be used within rules."
154
+ when Tree::PropNode
155
+ "Properties aren't allowed at the root of a document." +
156
+ child.pseudo_class_selector_message
157
+ else
158
+ return
159
+ end
154
160
  end
155
161
  end
156
162
  end
@@ -225,18 +225,6 @@ module Sass::Tree
225
225
  super
226
226
  end
227
227
 
228
- # Returns an error message if the given child node is invalid,
229
- # and false otherwise.
230
- #
231
- # {ExtendNode}s are valid within {RuleNode}s.
232
- #
233
- # @param child [Tree::Node] A potential child node.
234
- # @return [Boolean, String] Whether or not the child node is valid,
235
- # as well as the error message to display if it is invalid
236
- def invalid_child?(child)
237
- super unless child.is_a?(ExtendNode)
238
- end
239
-
240
228
  # A hash that will be associated with this rule in the CSS document
241
229
  # if the {file:SASS_REFERENCE.md#debug_info-option `:debug_info` option} is enabled.
242
230
  # This data is used by e.g. [the FireSass Firebug extension](https://addons.mozilla.org/en-US/firefox/addon/103988).
@@ -32,17 +32,5 @@ module Sass::Tree
32
32
  end
33
33
  children
34
34
  end
35
-
36
- # Returns an error message if the given child node is invalid,
37
- # and false otherwise.
38
- #
39
- # {ExtendNode}s are valid within {WhileNode}s.
40
- #
41
- # @param child [Tree::Node] A potential child node.
42
- # @return [Boolean, String] Whether or not the child node is valid,
43
- # as well as the error message to display if it is invalid
44
- def invalid_child?(child)
45
- super unless child.is_a?(ExtendNode)
46
- end
47
35
  end
48
36
  end
@@ -123,6 +123,10 @@ MSG
123
123
  "a\n b: foo($var: a, $var: b)" => 'Keyword argument "$var" passed more than once',
124
124
  "a\n b: foo($var-var: a, $var_var: b)" => 'Keyword argument "$var-var" passed more than once',
125
125
  "a\n b: foo($var_var: a, $var-var: b)" => 'Keyword argument "$var_var" passed more than once',
126
+ "@if foo\n @extend .bar" => ["Extend directives may only be used within rules.", 2],
127
+ "$var: true\n@while $var\n @extend .bar\n $var: false" => ["Extend directives may only be used within rules.", 3],
128
+ "@for $i from 0 to 1\n @extend .bar" => ["Extend directives may only be used within rules.", 2],
129
+ "@mixin foo\n @extend .bar\n@include foo" => ["Extend directives may only be used within rules.", 2],
126
130
 
127
131
  # Regression tests
128
132
  "a\n b:\n c\n d" => ["Illegal nesting: Only properties may be nested beneath properties.", 3],
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.alpha.47
4
+ version: 3.1.0.alpha.48
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Weizenbaum
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2010-11-29 00:00:00 -05:00
14
+ date: 2010-12-01 00:00:00 -05:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency