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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTY4NDk1MDA3Yjc5ODZhNzI3ZmRkNjEzN2U4YjAxNzg4ZTFlNGEzMA==
4
+ ZGNkZjg5MjcyZmI4ODJiNzFiYTNkNmI3MmE5MzcyZjNiZjRiZDRiMg==
5
5
  data.tar.gz: !binary |-
6
- OGViMWNlNTE5NjA5M2VjMzg1YjBhM2IxNmY2N2U2ZjY1NTRhYmViZQ==
6
+ NDExNjc1YzI5OGJlNDQ5ZjUzYzM0MTU1YTYwNGQ2Mjg1MjI0YTdmNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDk2YzFjZjg3MmYwM2U0OTdkMjc5YjA3MjRiZTZiZDI0ZTYwZDYxNzVkZDdm
10
- ZDgyOTA1YTk3ZjM5MzMzMDQ2YTU2ZTk4YmU3MTJiZjY0YzNlNGVlZjVhMDY3
11
- ZTc5NWY4NTJlMGM2MGU5ZDY2NGVmYzMzM2I2OTk0OWZlMDg0OTE=
9
+ MTExOWU5MTkyNWRjY2JjYjBlMDRhY2ZhOGU5YmNmNGY0OGUzYjg5ZjlkZTRk
10
+ NWU1YTdmMzAxMTkxYzQ4MjBiMDIzODc4MGRiZGUyNTNjZmI1MTgzOGM2M2U5
11
+ ODY5YzkyOTcwNGZjMzM4ZGIzMWJmNTU1ZTQ5ZWQzNWI3NDY0YmI=
12
12
  data.tar.gz: !binary |-
13
- Y2NhYzQ4M2VmZWI0Yzg5NDg5ZDJhNTNkZGRjNTgwMmQ5NzliYzE5YmNiY2Uz
14
- ZGQ3M2U3NWU5MGNlNDZlZmM2ODMyOWVjOTUxOWQwOTE2MjExMGViZmNjNTAw
15
- YmY4Y2Q0M2JiNmEwMTQ1OTNiYTExOGI0YWM1ZmUwYmQ4OWQwYzM=
13
+ MTU0NDNjMzg0M2Q2NmEyZWM0OWFlODU3NjU5NDRkMTY0NjlkZjQwOTBiNTVl
14
+ MzU3MjY0MDYxNjcyZDdlMTcxOWE4MzJhNWMxYzYwZTgwODM5MDY0N2U1ZmQ4
15
+ MjdkOTE4YTg0YTc4YmNmZTgyYTRmNzQ4YmZjODZkZTkxYWFlMmM=
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 1.1.2 / 2014-01-06
2
+
3
+ * Bug fixes
4
+
5
+ * HashDigest.digest2 now works on arrays
6
+
1
7
  1.1.1 / 2014-01-02
2
8
 
3
9
  * Bug fixes
@@ -1,3 +1,3 @@
1
1
  module HashDigest
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
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
@@ -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.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-02 00:00:00.000000000 Z
11
+ date: 2014-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: murmurhash3