haml-edge 2.3.91 → 2.3.92

Sign up to get free protection for your applications and to get access to all the features.
data/EDGE_GEM_VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.91
1
+ 2.3.92
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.91
1
+ 2.3.92
@@ -93,10 +93,10 @@ END
93
93
 
94
94
  # Returns the red, green, and blue components of the color.
95
95
  #
96
- # @return [Array<Fixnum>] A three-element array of the red, green, and blue
96
+ # @return [Array<Fixnum>] A frozen three-element array of the red, green, and blue
97
97
  # values (respectively) of the color
98
98
  def rgb
99
- [red, green, blue]
99
+ [red, green, blue].freeze
100
100
  end
101
101
 
102
102
  # The SassScript `==` operation.
@@ -111,6 +111,29 @@ END
111
111
  other.is_a?(Color) && rgb == other.rgb && alpha == other.alpha)
112
112
  end
113
113
 
114
+ # Returns a copy of this color with one or more channels changed.
115
+ #
116
+ # For example:
117
+ #
118
+ # Color.new([10, 20, 30].with(:blue => 40)
119
+ # #=> rgb(10, 40, 30)
120
+ # Color.new([126, 126, 126]).with(:red => 0, :green => 255)
121
+ # #=> rgb(0, 255, 126)
122
+ # Color.new([1, 2, 3]).with(:alpha => 0.4)
123
+ # #=> rgba(1, 2, 3, 0.4)
124
+ #
125
+ # @param attrs [Hash<Symbol, Numeric>]
126
+ # A map of channel names (`:red`, `:green`, `:blue`, or `:alpha`) to values
127
+ # @return [Color] The new Color object
128
+ def with(attrs)
129
+ Color.new([
130
+ attrs[:red] || red,
131
+ attrs[:green] || green,
132
+ attrs[:blue] || blue,
133
+ attrs[:alpha] || alpha,
134
+ ])
135
+ end
136
+
114
137
  # The SassScript `+` operation.
115
138
  # Its functionality depends on the type of its argument:
116
139
  #
@@ -256,9 +279,8 @@ END
256
279
  if !other_num && other.alpha != alpha
257
280
  raise Sass::SyntaxError.new("Alpha channels must be equal: #{self} #{operation} #{other}")
258
281
  end
259
- result[3] = alpha
260
282
 
261
- Color.new(result)
283
+ with(:red => result[0], :green => result[1], :blue => result[2])
262
284
  end
263
285
  end
264
286
  end
@@ -11,7 +11,7 @@
11
11
  It's only used for benchmarking.
12
12
  </h1>
13
13
  <div class="crazy_partials">
14
- <%= render :partial => 'haml/rhtml/av_partial_1' %>
14
+ <%= render :partial => 'haml/erb/av_partial_1' %>
15
15
  </div>
16
16
  <!-- You're In my house now! -->
17
17
  <div class='header'>
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml-edge
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.91
4
+ version: 2.3.92
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Weizenbaum
@@ -131,7 +131,7 @@ files:
131
131
  - test/haml/erb/_av_partial_1.erb
132
132
  - test/haml/erb/_av_partial_2.erb
133
133
  - test/haml/erb/action_view.erb
134
- - test/haml/erb/standard.rhtml
134
+ - test/haml/erb/standard.erb
135
135
  - test/haml/markaby
136
136
  - test/haml/markaby/standard.mab
137
137
  - test/haml/mocks