hash_digest 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG +6 -0
- data/lib/hash_digest/version.rb +1 -1
- data/lib/hash_digest.rb +5 -7
- data/test/test_hash_digest.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGNkZjg5MjcyZmI4ODJiNzFiYTNkNmI3MmE5MzcyZjNiZjRiZDRiMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDExNjc1YzI5OGJlNDQ5ZjUzYzM0MTU1YTYwNGQ2Mjg1MjI0YTdmNg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTExOWU5MTkyNWRjY2JjYjBlMDRhY2ZhOGU5YmNmNGY0OGUzYjg5ZjlkZTRk
|
10
|
+
NWU1YTdmMzAxMTkxYzQ4MjBiMDIzODc4MGRiZGUyNTNjZmI1MTgzOGM2M2U5
|
11
|
+
ODY5YzkyOTcwNGZjMzM4ZGIzMWJmNTU1ZTQ5ZWQzNWI3NDY0YmI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTU0NDNjMzg0M2Q2NmEyZWM0OWFlODU3NjU5NDRkMTY0NjlkZjQwOTBiNTVl
|
14
|
+
MzU3MjY0MDYxNjcyZDdlMTcxOWE4MzJhNWMxYzYwZTgwODM5MDY0N2U1ZmQ4
|
15
|
+
MjdkOTE4YTg0YTc4YmNmZTgyYTRmNzQ4YmZjODZkZTkxYWFlMmM=
|
data/CHANGELOG
CHANGED
data/lib/hash_digest/version.rb
CHANGED
data/lib/hash_digest.rb
CHANGED
@@ -62,6 +62,10 @@ class Object
|
|
62
62
|
def to_hash_digest_param
|
63
63
|
to_s
|
64
64
|
end
|
65
|
+
|
66
|
+
def to_hash_digest_query(key)
|
67
|
+
"#{::HashDigest.escape_url(key.to_hash_digest_param)}=#{::HashDigest.escape_url(to_hash_digest_param)}"
|
68
|
+
end
|
65
69
|
end
|
66
70
|
|
67
71
|
class Array
|
@@ -69,7 +73,7 @@ class Array
|
|
69
73
|
map { |e| e.to_hash_digest_param }.join '/'
|
70
74
|
end
|
71
75
|
|
72
|
-
def to_hash_digest_query(key)
|
76
|
+
def to_hash_digest_query(key = nil)
|
73
77
|
prefix = "#{key}[]"
|
74
78
|
map { |value| value.to_hash_digest_query(prefix) }.join '&'
|
75
79
|
end
|
@@ -83,9 +87,3 @@ class Hash
|
|
83
87
|
end
|
84
88
|
alias_method :to_hash_digest_query, :to_hash_digest_param
|
85
89
|
end
|
86
|
-
|
87
|
-
class Object
|
88
|
-
def to_hash_digest_query(key)
|
89
|
-
"#{::HashDigest.escape_url(key.to_hash_digest_param)}=#{::HashDigest.escape_url(to_hash_digest_param)}"
|
90
|
-
end
|
91
|
-
end
|
data/test/test_hash_digest.rb
CHANGED
@@ -67,6 +67,7 @@ describe HashDigest do
|
|
67
67
|
[{:a => 1, 'b' => 2}, {'a' => 1, :b => 2}],
|
68
68
|
[{:a => 1, 'b' => [1, 2]}, {'a' => 1, :b => ['1', 2]}],
|
69
69
|
[{:a => 1, 'b' => { foo: :bar }}, {'a' => 1, :b => { 'foo' => 'bar' }}],
|
70
|
+
[[:a, 'b'], ['a', :b]],
|
70
71
|
].each do |a, b|
|
71
72
|
it "trivial difference between #{a} and #{b}" do
|
72
73
|
assert_same_as_old a
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hash_digest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seamus Abshere
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: murmurhash3
|