hash_dealer 1.3.5 → 1.3.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/hash_dealer.gemspec +8 -8
- data/lib/path_string.rb +1 -1
- data/spec/lib/path_string_spec.rb +18 -0
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.6
|
data/hash_dealer.gemspec
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "1.3.
|
7
|
+
s.name = "hash_dealer"
|
8
|
+
s.version = "1.3.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Dan Langevin"]
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
-
s.email =
|
12
|
+
s.date = "2011-09-15"
|
13
|
+
s.description = "Like Factory Girl but for Hashes only"
|
14
|
+
s.email = "dan.langevin@lifebooker.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE.txt",
|
17
17
|
"README.rdoc"
|
@@ -36,11 +36,11 @@ Gem::Specification.new do |s|
|
|
36
36
|
"spec/lib/path_string_spec.rb",
|
37
37
|
"spec/spec_helper.rb"
|
38
38
|
]
|
39
|
-
s.homepage =
|
39
|
+
s.homepage = "http://github.com/LifebookerInc/hash_dealer"
|
40
40
|
s.licenses = ["MIT"]
|
41
41
|
s.require_paths = ["lib"]
|
42
|
-
s.rubygems_version =
|
43
|
-
s.summary =
|
42
|
+
s.rubygems_version = "1.8.10"
|
43
|
+
s.summary = "Hash Factory - like Factory Girl but for Hashes only"
|
44
44
|
|
45
45
|
if s.respond_to? :specification_version then
|
46
46
|
s.specification_version = 3
|
data/lib/path_string.rb
CHANGED
@@ -36,7 +36,7 @@ class PathString < String
|
|
36
36
|
def self.sort_json(val)
|
37
37
|
return val if val.is_a?(TimeDateMatcher)
|
38
38
|
val = ActiveSupport::JSON.decode(val) if val.is_a?(String)
|
39
|
-
val = self.stringify_keys(val) if val.is_a?(Hash)
|
39
|
+
val = self.stringify_keys(val).sort if val.is_a?(Hash)
|
40
40
|
val = val.collect{|v| v.collect{|n| n.is_a?(Hash) ? self.sort_json(n) : n}} if val.is_a?(Array)
|
41
41
|
val.sort
|
42
42
|
end
|
@@ -37,4 +37,22 @@ describe PathString do
|
|
37
37
|
PathString.paths_match?("/a/1/test/2", "/a/:1/test/:2").should be_true
|
38
38
|
end
|
39
39
|
|
40
|
+
it "should actually sort things with as_sorted_json" do
|
41
|
+
a = [["user_login",
|
42
|
+
{"user_name"=>"username",
|
43
|
+
"user_type"=>"Client",
|
44
|
+
"user_id"=>37,
|
45
|
+
"password"=>"123456",
|
46
|
+
"password_confirmation"=>"123456"}]]
|
47
|
+
b = {:user_login=>
|
48
|
+
{:password=>":password",
|
49
|
+
:password_confirmation=>":password_conf",
|
50
|
+
:user_id=>":id",
|
51
|
+
:user_name=>":username",
|
52
|
+
:user_type=>"Client"}}
|
53
|
+
|
54
|
+
PathString.as_sorted_json(a).should == PathString.as_sorted_json(b)
|
55
|
+
end
|
56
|
+
|
57
|
+
|
40
58
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: hash_dealer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.3.
|
5
|
+
version: 1.3.6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Dan Langevin
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-09-
|
13
|
+
date: 2011-09-15 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -141,7 +141,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
141
141
|
requirements:
|
142
142
|
- - ">="
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
hash:
|
144
|
+
hash: -498563270830469616
|
145
145
|
segments:
|
146
146
|
- 0
|
147
147
|
version: "0"
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
requirements: []
|
155
155
|
|
156
156
|
rubyforge_project:
|
157
|
-
rubygems_version: 1.
|
157
|
+
rubygems_version: 1.8.10
|
158
158
|
signing_key:
|
159
159
|
specification_version: 3
|
160
160
|
summary: Hash Factory - like Factory Girl but for Hashes only
|