objectify-xml 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.2.3 / 2009-06-22
2
+
3
+ * Fixed support for Nokogiri 1.3.x
4
+
1
5
  === 0.2.2 / 2009-03-02
2
6
 
3
7
  * Improved type lookup to look in the object's scope before the general scope.
data/lib/objectify_xml.rb CHANGED
@@ -5,12 +5,13 @@ require 'nokogiri'
5
5
  require File.join(File.dirname(__FILE__), 'objectify_xml/dsl')
6
6
  require File.join(File.dirname(__FILE__), 'objectify_xml/document_parser')
7
7
  require File.join(File.dirname(__FILE__), 'objectify_xml/element_parser')
8
+ require File.join(File.dirname(__FILE__), 'objectify_xml/nokogiri_before_1.3.0_patch') if Nokogiri::VERSION < "1.3"
8
9
 
9
10
  module Objectify
10
11
  # Base class inherited by the DocumentParser and ElementParser. Not intended
11
12
  # for independent use.
12
13
  class Xml
13
- VERSION = '0.2.2'
14
+ VERSION = '0.2.3'
14
15
 
15
16
  # When child nodes are created, they are given the name of the node
16
17
  # that created them which is available here.
@@ -13,7 +13,7 @@ module Objectify
13
13
  # including namespace if present.
14
14
  def qualified_name(x)
15
15
  qn = x.name
16
- qn = "#{ x.namespace }:#{ x.name }" if x.namespace
16
+ qn = "#{ x.namespace.prefix }:#{ x.name }" if x.namespace && x.namespace.prefix
17
17
  qn
18
18
  end
19
19
 
@@ -36,8 +36,8 @@ module Objectify
36
36
 
37
37
  # Returns boolean to indicate if the given element's namespace is supported.
38
38
  def namespace?(x)
39
- if x.namespace
40
- self.class.namespace?(x.namespace)
39
+ if x.namespace && x.namespace.prefix
40
+ self.class.namespace?(x.namespace.prefix)
41
41
  else
42
42
  true
43
43
  end
@@ -46,7 +46,8 @@ module Objectify
46
46
  # Returns the attribute name representing the given element. If the element
47
47
  # is not defined, returns nil.
48
48
  def attribute(x)
49
- self.class.find_attribute(qualified_name(x), x.namespace, x.name)
49
+ prefix = x.namespace.nil? ? nil : x.namespace.prefix
50
+ self.class.find_attribute(qualified_name(x), prefix, x.name)
50
51
  end
51
52
 
52
53
  # Parses the given xml element and all of its siblings.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: objectify-xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - pangloss
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-02 00:00:00 -05:00
12
+ date: 2009-06-22 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -40,9 +40,15 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 1.9.0
43
+ version: 2.0.0
44
44
  version:
45
- description: Provides an easy to use DSL resembling ActiveRecord for defining objects representing any XML document, including deeply nested ones. This project was extracted from my ruby-picasa gem. You can find ruby-picasa at http://github.com/pangloss/ruby_picasa or available as a gem. The project also has significant (if not complete) Atom support.
45
+ description: |-
46
+ Provides an easy to use DSL resembling ActiveRecord for defining objects
47
+ representing any XML document, including deeply nested ones. This project was
48
+ extracted from my ruby-picasa gem. You can find ruby-picasa at
49
+ http://github.com/pangloss/ruby_picasa or available as a gem.
50
+
51
+ The project also has significant (if not complete) Atom support.
46
52
  email:
47
53
  - darrick@innatesoftware.com
48
54
  executables: []
@@ -72,6 +78,8 @@ files:
72
78
  - spec/sample/wikipedia.atom
73
79
  has_rdoc: true
74
80
  homepage: http://github.com/pangloss/objectify_xml
81
+ licenses: []
82
+
75
83
  post_install_message:
76
84
  rdoc_options:
77
85
  - --main
@@ -93,9 +101,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
101
  requirements: []
94
102
 
95
103
  rubyforge_project: objectify-xml
96
- rubygems_version: 1.3.1
104
+ rubygems_version: 1.3.4
97
105
  signing_key:
98
- specification_version: 2
106
+ specification_version: 3
99
107
  summary: Provides an easy to use DSL resembling ActiveRecord for defining objects representing any XML document, including deeply nested ones
100
108
  test_files:
101
109
  - spec/atom_spec.rb