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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NmQ0YjgwZDQxYjViY2E1MjAxNTFmMjI0ZDRlNzZhZDBjNWQzOTc1ZQ==
4
+ NWM0NmRmODhiNzA5YjdmZGRhYmQwNzVkYjM4YTUwMDliZTAwYTA4Mw==
5
5
  data.tar.gz: !binary |-
6
- Mzg3ZDczMzQ5NDI4NGQwMmQzMDk5YzNhY2NhNjIzYjE3MzJlOTRjNA==
6
+ NjY0ODMxNGU1OGY0MTZjYzIxNTQ3ZTlmMmM4Yjc2Mjg1YmQyNThhNQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NGJhMWExODYxM2E5ZjAyYjZiODg0OTIwODZlYmQxMGY5MWUwMTE3YTkyYjhj
10
- Y2ZjZmRkMmE4OTgyYmNkZGM3NzhjNDdmNGY2NmY2YWE1ZjRmZDU2ZTI1OTVh
11
- ZmUzN2U1ZWUzMzQ1MjFhM2I5MGM2ZDQxMTM0MGVkYmY2ZTIxOTQ=
9
+ ZDJmZDAwMjBlMTZhM2YxN2UyNTRkMTIyNmVmYzEyZDkwMjcwNjc2MGE3ZmYw
10
+ YTVkZTE0ODYwMjBmYTlmOTE0Zjk4Mjg3ZGZmZGUzZjYxYmZjYzVkOTI0ZWI5
11
+ OTBmZGRjNGNjNDVjMGFmMDdhNWQ0OWVkY2IxNmMyZDRiZTcwZTE=
12
12
  data.tar.gz: !binary |-
13
- NzA4YTU0ODE0ZjFiZjEwMTIxMDk2MTlkNjFlYmZjODQ5Yzc1NzFiOTZiNTg2
14
- MGVlY2MxZDYwYmQwNzE3YjBhNjNkZDNhYjFhMjFlOGE5MDdiOWNkZTc1ZmIx
15
- NWVkYmNjYTlmZWY5NWRmMDQ0ZTk1MjRiYzk4M2VkNTE2MTVkOTc=
13
+ MDk3ZmYwYjM2Y2JmMjkyMzMzMjEzNzQxNzM1YzFiZDZmOWRlZmFiNTc5NTA3
14
+ YjA3MTUzYTU0MTIzNTk2ZjZjNGQ4OWMwNGFiM2U2OGRjZTgzNWZjYWJjYmU5
15
+ NDk1ZjAyMjlhOWI5ZDBmYzZiNDZkMjFkNzc4NmU5ZmZiMWIwZTk=
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,9 @@
1
1
  = MagnumPI CHANGELOG
2
2
 
3
+ == Version 0.2.4 (July 16, 2014)
4
+
5
+ * Fixed Aj parsing
6
+
3
7
  == Version 0.2.3 (June 24, 2014)
4
8
 
5
9
  * Interpreting CDATA as text when parsing XML documents with Ax
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
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
@@ -1,7 +1,7 @@
1
1
  module MagnumPI
2
2
  MAJOR = 0
3
3
  MINOR = 2
4
- TINY = 3
4
+ TINY = 4
5
5
 
6
6
  VERSION = [MAJOR, MINOR, TINY].join(".")
7
7
  end
@@ -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('{"name": "Paul Engel"}').to_enum)
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('[{"name": "Paul Engel"}, {"name": "Ken Adams"}]').to_enum)
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.3
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-06-24 00:00:00.000000000 Z
11
+ date: 2014-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize