nori 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of nori might be problematic. Click here for more details.

data/.travis.yml CHANGED
@@ -5,4 +5,4 @@ rvm:
5
5
  - ree
6
6
  - rbx
7
7
  - jruby
8
-
8
+ - ruby-head
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.2.2 (2011-05-16)
2
+
3
+ * Fix: namespaced xs:nil values should be nil objects.
4
+
1
5
  == 0.2.1 (2011-05-15)
2
6
 
3
7
  * Fix: Changed XML attributes converted to Hash keys to be prefixed with an @-sign.
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- Nori ![http://travis-ci.org/rubiii/nori](http://travis-ci.org/rubiii/nori.png)
1
+ Nori [![Build Status](http://travis-ci.org/rubiii/nori.png)](http://travis-ci.org/rubiii/nori)
2
2
  ====
3
3
 
4
4
  Really simple XML parsing ripped from Crack which ripped it from Merb.
data/lib/nori/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Nori
2
2
 
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
 
5
5
  end
@@ -57,7 +57,13 @@ module Nori
57
57
  # leave the type alone if we don't know what it is
58
58
  @type = self.class.available_typecasts.include?(attributes["type"]) ? attributes.delete("type") : attributes["type"]
59
59
 
60
- @nil_element = attributes.delete("nil") == "true"
60
+ @nil_element = false
61
+ attributes.keys.each do |key|
62
+ if result = /^((.*):)?nil$/.match(key)
63
+ @nil_element = attributes.delete(key) == "true"
64
+ attributes.delete("xmlns:#{result[2]}") if result[1]
65
+ end
66
+ end
61
67
  @attributes = undasherize_keys(attributes)
62
68
  @children = []
63
69
  @text = false
data/nori.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.rubyforge_project = "nori"
15
15
 
16
16
  s.add_development_dependency "nokogiri", ">= 1.4.0"
17
- s.add_development_dependency "rspec", "~> 2.4.0"
17
+ s.add_development_dependency "rspec", "~> 2.6.0"
18
18
  s.add_development_dependency "autotest"
19
19
 
20
20
  s.files = `git ls-files`.split("\n")
@@ -246,6 +246,8 @@ describe Nori do
246
246
  <viewed-at type="datetime"></viewed-at>
247
247
  <content type="yaml"></content>
248
248
  <parent-id></parent-id>
249
+ <nil_true nil="true"/>
250
+ <namespaced xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
249
251
  </topic>
250
252
  EOT
251
253
 
@@ -256,7 +258,9 @@ describe Nori do
256
258
  'written_on' => nil,
257
259
  'viewed_at' => nil,
258
260
  'content' => nil,
259
- 'parent_id' => nil
261
+ 'parent_id' => nil,
262
+ 'nil_true' => nil,
263
+ 'namespaced' => nil
260
264
  }
261
265
  parse(topic_xml)["topic"].should == expected_topic_hash
262
266
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nori
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Daniel Harrington
@@ -17,7 +17,8 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-05-15 00:00:00 Z
20
+ date: 2011-05-16 00:00:00 +02:00
21
+ default_executable:
21
22
  dependencies:
22
23
  - !ruby/object:Gem::Dependency
23
24
  name: nokogiri
@@ -43,12 +44,12 @@ dependencies:
43
44
  requirements:
44
45
  - - ~>
45
46
  - !ruby/object:Gem::Version
46
- hash: 31
47
+ hash: 23
47
48
  segments:
48
49
  - 2
49
- - 4
50
+ - 6
50
51
  - 0
51
- version: 2.4.0
52
+ version: 2.6.0
52
53
  type: :development
53
54
  version_requirements: *id002
54
55
  - !ruby/object:Gem::Dependency
@@ -101,6 +102,7 @@ files:
101
102
  - spec/nori/nori_spec.rb
102
103
  - spec/nori/parser_spec.rb
103
104
  - spec/spec_helper.rb
105
+ has_rdoc: true
104
106
  homepage: http://github.com/rubiii/nori
105
107
  licenses: []
106
108
 
@@ -130,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
132
  requirements: []
131
133
 
132
134
  rubyforge_project: nori
133
- rubygems_version: 1.7.2
135
+ rubygems_version: 1.4.1
134
136
  signing_key:
135
137
  specification_version: 3
136
138
  summary: XML to Hash translator