webget_ruby_ramp 1.7.6 → 1.7.7
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/lib/webget_ruby_ramp/hash.rb +1 -1
- data/test/webget_ruby_ramp/hash_test.rb +2 -2
- 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')
|
209
209
|
a=self.class.new
|
210
210
|
direction=direction.to_s
|
211
211
|
up=pivot_direction_up?(direction)
|
@@ -130,7 +130,7 @@ class HashTest < Test::Unit::TestCase
|
|
130
130
|
|
131
131
|
|
132
132
|
def test_pivot_vals_with_block
|
133
|
-
p=pivotable.pivot(:vals){|items| items.sort.
|
133
|
+
p=pivotable.pivot(:vals){|items| items.sort.join }
|
134
134
|
assert_equal(['x','y','z'], p.keys.sort)
|
135
135
|
assert_equal('mps', p['x'])
|
136
136
|
assert_equal('nqt', p['y'])
|
@@ -148,7 +148,7 @@ class HashTest < Test::Unit::TestCase
|
|
148
148
|
|
149
149
|
|
150
150
|
def test_pivot_keys_with_block
|
151
|
-
p=pivotable.pivot(:keys){|items| items.sort.
|
151
|
+
p=pivotable.pivot(:keys){|items| items.sort.join }
|
152
152
|
assert_equal(['a','b','c'], p.keys.sort)
|
153
153
|
assert_equal('mno', p['a'])
|
154
154
|
assert_equal('pqr', p['b'])
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|