sass 3.1.0.alpha.9 → 3.1.0.alpha.10

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.
@@ -1 +1 @@
1
- 3.1.0.alpha.9
1
+ 3.1.0.alpha.10
data/Rakefile CHANGED
@@ -24,7 +24,7 @@ end
24
24
  # Don't use Rake::GemPackageTast because we want prerequisites to run
25
25
  # before we load the gemspec.
26
26
  desc "Build all the packages."
27
- task :package => [:permissions, :revision_file, :submodules] do
27
+ task :package => [:revision_file, :submodules, :permissions] do
28
28
  load scope('sass.gemspec')
29
29
  Gem::Builder.new(SASS_GEMSPEC).build
30
30
  pkg = "#{SASS_GEMSPEC.name}-#{SASS_GEMSPEC.version}"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.0.alpha.9
1
+ 3.1.0.alpha.10
@@ -63,13 +63,10 @@ module Sass
63
63
  args = self.args.map {|a| a.perform(environment)}
64
64
  ruby_name = name.gsub('-', '_')
65
65
  unless Sass::Util.has?(:public_instance_method, Functions, ruby_name) && ruby_name !~ /^__/
66
- result = Script::String.new("#{name}(#{args.map {|a| a.perform(environment)}.join(', ')})")
66
+ opts(Script::String.new("#{name}(#{args.map {|a| a.perform(environment)}.join(', ')})"))
67
67
  else
68
- result = Functions::EvaluationContext.new(environment.options).send(ruby_name, *args)
68
+ opts(Functions::EvaluationContext.new(environment.options).send(ruby_name, *args))
69
69
  end
70
-
71
- result.options = environment.options
72
- return result
73
70
  rescue ArgumentError => e
74
71
  raise e unless e.backtrace.any? {|t| t =~ /:in `(block in )?(#{name}|perform)'$/}
75
72
  raise Sass::SyntaxError.new("#{e.message} for `#{name}'")
@@ -64,7 +64,7 @@ module Sass::Script
64
64
  res << (val.is_a?(Sass::Script::String) ? val.value : val.to_s)
65
65
  res << " " if @after && @whitespace_after
66
66
  res << @after.perform(environment).to_s if @after
67
- Sass::Script::String.new(res)
67
+ opts(Sass::Script::String.new(res))
68
68
  end
69
69
  end
70
70
  end
@@ -90,6 +90,8 @@ module Sass::Script
90
90
  end
91
91
 
92
92
  # Evaluates this node.
93
+ # Note that all {Literal} objects created within this method
94
+ # should have their \{#options} attribute set, probably via \{#opts}.
93
95
  #
94
96
  # @param environment [Sass::Environment] The environment in which to evaluate the SassScript
95
97
  # @return [Literal] The SassScript object that is the value of the SassScript
@@ -97,5 +99,14 @@ module Sass::Script
97
99
  def _perform(environment)
98
100
  Sass::Util.abstract(self)
99
101
  end
102
+
103
+ # Sets the \{#options} field on the given literal and returns it
104
+ #
105
+ # @param literal [Literal]
106
+ # @return [Literal]
107
+ def opts(literal)
108
+ literal.options = options
109
+ literal
110
+ end
100
111
  end
101
112
  end
@@ -72,9 +72,7 @@ module Sass::Script
72
72
  end
73
73
 
74
74
  begin
75
- res = literal1.send(@operator, literal2)
76
- res.options = environment.options
77
- res
75
+ opts(literal1.send(@operator, literal2))
78
76
  rescue NoMethodError => e
79
77
  raise e unless e.name.to_s == @operator.to_s
80
78
  raise Sass::SyntaxError.new("Undefined operation: \"#{literal1} #{@operator} #{literal2}\".")
@@ -72,7 +72,7 @@ module Sass::Script
72
72
  mid = @mid.perform(environment)
73
73
  res << (mid.is_a?(Sass::Script::String) ? mid.value : mid.to_s)
74
74
  res << @after.perform(environment).value
75
- Sass::Script::String.new(res, before.type)
75
+ opts(Sass::Script::String.new(res, before.type))
76
76
  end
77
77
 
78
78
  private
@@ -2111,6 +2111,28 @@ foo
2111
2111
  SASS
2112
2112
  end
2113
2113
 
2114
+ def test_interpolation_with_comma
2115
+ assert_equal <<CSS, render(<<SASS)
2116
+ foo {
2117
+ a: foo, bar; }
2118
+ CSS
2119
+ $foo: foo
2120
+ foo
2121
+ a: \#{$foo}, bar
2122
+ SASS
2123
+ end
2124
+
2125
+ def test_string_interpolation_with_comma
2126
+ assert_equal <<CSS, render(<<SASS)
2127
+ foo {
2128
+ a: "bip foo bap", bar; }
2129
+ CSS
2130
+ $foo: foo
2131
+ foo
2132
+ a: "bip \#{$foo} bap", bar
2133
+ SASS
2134
+ end
2135
+
2114
2136
  # Encodings
2115
2137
 
2116
2138
  unless Sass::Util.ruby1_8?
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.9
4
+ version: 3.1.0.alpha.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Weizenbaum