magnum-pi 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.rdoc +4 -0
- data/VERSION +1 -1
- data/lib/magnum-pi/gem_ext/oj/aj.rb +3 -3
- data/lib/magnum-pi/version.rb +1 -1
- data/test/unit/gem_ext/test_aj.rb +19 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWM0NmRmODhiNzA5YjdmZGRhYmQwNzVkYjM4YTUwMDliZTAwYTA4Mw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjY0ODMxNGU1OGY0MTZjYzIxNTQ3ZTlmMmM4Yjc2Mjg1YmQyNThhNQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDJmZDAwMjBlMTZhM2YxN2UyNTRkMTIyNmVmYzEyZDkwMjcwNjc2MGE3ZmYw
|
10
|
+
YTVkZTE0ODYwMjBmYTlmOTE0Zjk4Mjg3ZGZmZGUzZjYxYmZjYzVkOTI0ZWI5
|
11
|
+
OTBmZGRjNGNjNDVjMGFmMDdhNWQ0OWVkY2IxNmMyZDRiZTcwZTE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDk3ZmYwYjM2Y2JmMjkyMzMzMjEzNzQxNzM1YzFiZDZmOWRlZmFiNTc5NTA3
|
14
|
+
YjA3MTUzYTU0MTIzNTk2ZjZjNGQ4OWMwNGFiM2U2OGRjZTgzNWZjYWJjYmU5
|
15
|
+
NDk1ZjAyMjlhOWI5ZDBmYzZiNDZkMjFkNzc4NmU5ZmZiMWIwZTk=
|
data/CHANGELOG.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.4
|
@@ -100,7 +100,7 @@ private
|
|
100
100
|
def start_enum(key, entry, type)
|
101
101
|
add_to_current_path key
|
102
102
|
if current_entry || entry?
|
103
|
-
add_entry entry
|
103
|
+
add_entry entry, type
|
104
104
|
end
|
105
105
|
types << type
|
106
106
|
end
|
@@ -118,9 +118,9 @@ private
|
|
118
118
|
current_path << key if key
|
119
119
|
end
|
120
120
|
|
121
|
-
def add_entry(entry)
|
121
|
+
def add_entry(entry, type)
|
122
122
|
if (parent = current_entry).nil?
|
123
|
-
parent = (current_type == :hash ? {} : [])
|
123
|
+
parent = ((current_type || type) == :hash ? {} : [])
|
124
124
|
entries << parent
|
125
125
|
end
|
126
126
|
parent[current_key] = entry
|
data/lib/magnum-pi/version.rb
CHANGED
@@ -36,13 +36,30 @@ module Unit
|
|
36
36
|
]
|
37
37
|
}
|
38
38
|
}, Aj.new(@json).to_enum)
|
39
|
+
|
40
|
+
json = '{"name": "Paul Engel"}'
|
41
|
+
assert_equal Oj.load(json), Aj.new(json).to_enum
|
39
42
|
assert_equal({
|
40
43
|
"name" => "Paul Engel"
|
41
|
-
}, Aj.new(
|
44
|
+
}, Aj.new(json).to_enum)
|
45
|
+
|
46
|
+
json = '[{"name": "Paul Engel"}, {"name": "Ken Adams"}]'
|
47
|
+
assert_equal Oj.load(json), Aj.new(json).to_enum
|
42
48
|
assert_equal([
|
43
49
|
{"name" => "Paul Engel"},
|
44
50
|
{"name" => "Ken Adams"}
|
45
|
-
], Aj.new(
|
51
|
+
], Aj.new(json).to_enum)
|
52
|
+
|
53
|
+
json = '{"name": "Paul Engel", "foo": {"00": {"bar": "baz"}}}'
|
54
|
+
assert_equal Oj.load(json), Aj.new(json).to_enum
|
55
|
+
assert_equal({
|
56
|
+
"name" => "Paul Engel",
|
57
|
+
"foo" => {
|
58
|
+
"00" => {
|
59
|
+
"bar" => "baz"
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}, Aj.new(json).to_enum)
|
46
63
|
end
|
47
64
|
it "can return an array within a JSON document" do
|
48
65
|
result = []
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: magnum-pi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Engel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|