jnunemaker-crack 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,8 +1,6 @@
1
1
  = crack
2
2
 
3
- Really simple JSON and XML parsing, ripped from ActiveSupport so it can be used without all of ActiveSupport.
4
-
5
- The XML parser is ripped from Merb and the JSON parser is ripped from Rails. I take no credit, just packaged them for all to enjoy and easily use.
3
+ Really simple JSON and XML parsing, ripped from Merb and Rails. The XML parser is ripped from Merb and the JSON parser is ripped from Rails. I take no credit, just packaged them for all to enjoy and easily use.
6
4
 
7
5
  = usage
8
6
 
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 1
3
- :patch: 0
3
+ :patch: 1
4
4
  :major: 0
data/lib/crack/xml.rb CHANGED
@@ -205,7 +205,7 @@ module Crack
205
205
  stack.last.add_node(event[1]) unless event[1].strip.length == 0 || stack.empty?
206
206
  end
207
207
  end
208
- stack.pop.to_hash
208
+ stack.length > 0 ? stack.pop.to_hash : {}
209
209
  end
210
210
  end
211
211
  end
data/test/xml_test.rb CHANGED
@@ -439,4 +439,13 @@ class XmlTest < Test::Unit::TestCase
439
439
 
440
440
  Crack::XML.parse(xml_string)['person'].should == expected_hash
441
441
  end
442
+
443
+ should "handle an empty xml string" do
444
+ Crack::XML.parse('').should == {}
445
+ end
446
+
447
+ # As returned in the response body by the unfuddle XML API when creating objects
448
+ should "handle an xml string containing a single space" do
449
+ Crack::XML.parse(' ').should == {}
450
+ end
442
451
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jnunemaker-crack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-29 00:00:00 -07:00
12
+ date: 2009-04-02 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -57,10 +57,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
57
57
  version:
58
58
  requirements: []
59
59
 
60
- rubyforge_project:
60
+ rubyforge_project: crack
61
61
  rubygems_version: 1.2.0
62
62
  signing_key:
63
63
  specification_version: 2
64
- summary: Really simple JSON and XML parsing, ripped from ActiveSupport so it can be used without all of ActiveSupport.
64
+ summary: Really simple JSON and XML parsing, ripped from Merb and Rails.
65
65
  test_files: []
66
66