om 1.5.3 → 1.6.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.textile +3 -0
- data/lib/om/version.rb +1 -1
- data/lib/om/xml/dynamic_node.rb +2 -0
- data/spec/unit/dynamic_node_spec.rb +6 -0
- metadata +16 -16
data/History.textile
CHANGED
data/lib/om/version.rb
CHANGED
data/lib/om/xml/dynamic_node.rb
CHANGED
@@ -27,6 +27,8 @@ module OM
|
|
27
27
|
# @article.ng_xml.xpath("//oxns:relatedItem[@type=\"host\"]/oxns:titleInfo/oxns:title", {"oxns"=>"http://www.loc.gov/mods/v3"})[1]
|
28
28
|
#
|
29
29
|
class DynamicNode
|
30
|
+
instance_methods.each { |m| undef_method m unless m.to_s =~ /^(?:nil\?|send|object_id|to_a)$|^__|^respond_to|proxy_/ }
|
31
|
+
|
30
32
|
attr_accessor :key, :index, :parent, :addressed_node, :term
|
31
33
|
def initialize(key, index, document, term, parent=nil) ##TODO a real term object in here would make it easier to lookup
|
32
34
|
self.key = key
|
@@ -22,6 +22,12 @@ describe "OM::XML::DynamicNode" do
|
|
22
22
|
@article.abstract.should == ["My Abstract"]
|
23
23
|
end
|
24
24
|
|
25
|
+
it "should delegate all methods (i.e. to_s, first, etc.) to the found array" do
|
26
|
+
@article.person.last_name.to_s.should == ["FAMILY NAME", "Gautama"].to_s
|
27
|
+
@article.person.last_name.first.should == "FAMILY NAME"
|
28
|
+
end
|
29
|
+
|
30
|
+
|
25
31
|
describe "setting attributes" do
|
26
32
|
it "when they exist" do
|
27
33
|
@article.title_info(0).main_title.main_title_lang = "ger"
|
metadata
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: om
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.6.0.rc1
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Matt Zumwalt
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-03-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
16
|
-
requirement: &
|
16
|
+
requirement: &70128708883620 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.4.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70128708883620
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: mediashelf-loggable
|
27
|
-
requirement: &
|
27
|
+
requirement: &70128708883180 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70128708883180
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70128708882600 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '2.0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70128708882600
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: mocha
|
49
|
-
requirement: &
|
49
|
+
requirement: &70128708882080 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 0.9.8
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70128708882080
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: equivalent-xml
|
60
|
-
requirement: &
|
60
|
+
requirement: &70128708881580 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: 0.2.4
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70128708881580
|
69
69
|
description: ! 'OM (Opinionated Metadata): A library to help you tame sprawling XML
|
70
70
|
schemas like MODS. Wraps Nokogiri documents in objects with miscellaneous helper
|
71
71
|
methods for doing things like retrieve generated xpath queries or look up properties
|
@@ -156,12 +156,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
156
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
157
|
none: false
|
158
158
|
requirements:
|
159
|
-
- - ! '
|
159
|
+
- - ! '>'
|
160
160
|
- !ruby/object:Gem::Version
|
161
|
-
version:
|
161
|
+
version: 1.3.1
|
162
162
|
requirements: []
|
163
163
|
rubyforge_project:
|
164
|
-
rubygems_version: 1.8.
|
164
|
+
rubygems_version: 1.8.15
|
165
165
|
signing_key:
|
166
166
|
specification_version: 3
|
167
167
|
summary: ! 'OM (Opinionated Metadata): A library to help you tame sprawling XML schemas
|