webget_ruby_ramp 1.7.7 → 1.7.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/webget_ruby_ramp/hash.rb +3 -3
- data/lib/webget_ruby_ramp.rb +1 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
@@ -205,7 +205,7 @@ class Hash
|
|
205
205
|
# h.pivot(:vals){|items| items.join("-") } => {"a"=>"1-4-7","b"=>"2-5-8","c"=>"3-6-9"}
|
206
206
|
# h.pivot(:vals){|items| items.inject{|sum,x| sum+=x } } => {"a"=>12,"b"=>15,"c"=>18}
|
207
207
|
|
208
|
-
def pivot(direction='keys')
|
208
|
+
def pivot(direction='keys',&block)
|
209
209
|
a=self.class.new
|
210
210
|
direction=direction.to_s
|
211
211
|
up=pivot_direction_up?(direction)
|
@@ -216,8 +216,8 @@ class Hash
|
|
216
216
|
a[k]<<(v2)
|
217
217
|
}
|
218
218
|
}
|
219
|
-
if
|
220
|
-
a.each_pair{|
|
219
|
+
if block
|
220
|
+
a.each_pair{|key,val| a[key]=block.call(val)}
|
221
221
|
end
|
222
222
|
a
|
223
223
|
end
|
data/lib/webget_ruby_ramp.rb
CHANGED
@@ -194,6 +194,7 @@ Extensions that help debug Ruby programs.
|
|
194
194
|
|
195
195
|
== Changes
|
196
196
|
|
197
|
+
- 1.7.8 Add rcov testing
|
197
198
|
- 1.7.4 Add Class#publicize_methods, Integer#even?, Integer#odd?
|
198
199
|
- 1.7.3 Refactor Rails classes to their own gem, add README, LICENSE
|
199
200
|
- 1.7.2 Gemcutter update
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|