om 1.4.0 → 1.4.2
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.textile +4 -0
- data/lib/om/version.rb +1 -1
- data/lib/om/xml/dynamic_node.rb +1 -0
- data/lib/om/xml/term.rb +2 -2
- data/spec/unit/dynamic_node_spec.rb +1 -0
- data/spec/unit/term_spec.rb +2 -2
- data/spec/unit/terminology_spec.rb +2 -0
- metadata +5 -5
data/History.textile
CHANGED
data/lib/om/version.rb
CHANGED
data/lib/om/xml/dynamic_node.rb
CHANGED
data/lib/om/xml/term.rb
CHANGED
@@ -250,9 +250,9 @@ class OM::XML::Term
|
|
250
250
|
if self.path.include?(":")
|
251
251
|
ns_prefix = self.path[0..path.index(":")-1]
|
252
252
|
path_name = self.path[path.index(":")+1..-1]
|
253
|
-
template = "xml[
|
253
|
+
template = "xml['#{ns_prefix}'].#{path_name}( #{OM::XML.delimited_list(node_options)} )" + node_child_template
|
254
254
|
elsif !self.namespace_prefix.nil? and self.namespace_prefix != 'oxns'
|
255
|
-
template = "xml[
|
255
|
+
template = "xml['#{self.namespace_prefix}'].#{self.path}( #{OM::XML.delimited_list(node_options)} )" + node_child_template
|
256
256
|
else
|
257
257
|
template = "xml.#{self.path}( #{OM::XML.delimited_list(node_options)} )" + node_child_template
|
258
258
|
end
|
@@ -67,6 +67,7 @@ describe "OM::XML::DynamicNode" do
|
|
67
67
|
end
|
68
68
|
|
69
69
|
it "should append nodes at the specified index if possible" do
|
70
|
+
@article.expects(:dirty=).with(true).twice
|
70
71
|
@article.journal.title_info = ["all", "for", "the"]
|
71
72
|
@article.journal.title_info(3, 'glory')
|
72
73
|
@article.term_values(:journal, :title_info).should == ["all", "for", "the", "glory"]
|
data/spec/unit/term_spec.rb
CHANGED
@@ -173,9 +173,9 @@ describe "OM::XML::Term" do
|
|
173
173
|
|
174
174
|
it "should work for namespaced nodes" do
|
175
175
|
@ical_date = OM::XML::Term.new(:ical_date, :path=>"ical:date")
|
176
|
-
@ical_date.xml_builder_template.should == "xml[\
|
176
|
+
@ical_date.xml_builder_template.should == "xml[\'ical\'].date( '\#{builder_new_value}' )"
|
177
177
|
@ical_date = OM::XML::Term.new(:ical_date, :path=>"date", :namespace_prefix=>"ical")
|
178
|
-
@ical_date.xml_builder_template.should == "xml[\
|
178
|
+
@ical_date.xml_builder_template.should == "xml[\'ical\'].date( '\#{builder_new_value}' )"
|
179
179
|
end
|
180
180
|
|
181
181
|
it "should work for nodes with default_content_path" do
|
@@ -87,6 +87,8 @@ describe "OM::XML::Terminology" do
|
|
87
87
|
|
88
88
|
it "should expand proxy and get sub terms" do
|
89
89
|
@test_full_terminology.retrieve_node(:title, :main_title_lang).xpath.should == '//oxns:titleInfo/oxns:title/@xml:lang'
|
90
|
+
### retrieve_term() will not cross proxies
|
91
|
+
@test_full_terminology.retrieve_term(:title_info, :main_title, :main_title_lang).xpath.should == '//oxns:titleInfo/oxns:title/@xml:lang'
|
90
92
|
end
|
91
93
|
|
92
94
|
it "constructs templates for value-driven searches" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: om
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 1.4.
|
9
|
+
- 2
|
10
|
+
version: 1.4.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matt Zumwalt
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-09-21 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -213,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
213
213
|
requirements: []
|
214
214
|
|
215
215
|
rubyforge_project:
|
216
|
-
rubygems_version: 1.
|
216
|
+
rubygems_version: 1.6.2
|
217
217
|
signing_key:
|
218
218
|
specification_version: 3
|
219
219
|
summary: "OM (Opinionated Metadata): A library to help you tame sprawling XML schemas like MODS."
|