om 1.9.0.rc1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +1 -0
- data/Gemfile +0 -3
- data/README.textile +7 -5
- data/UPDATING_DOCUMENTS.textile +2 -2
- data/lib/om.rb +3 -3
- data/lib/om/version.rb +1 -1
- data/lib/om/xml.rb +3 -3
- data/lib/om/xml/container.rb +3 -3
- data/lib/om/xml/node_generator.rb +4 -4
- data/lib/om/xml/template_registry.rb +7 -6
- data/lib/om/xml/term.rb +12 -26
- data/lib/om/xml/term_value_operators.rb +3 -1
- data/lib/om/xml/term_xpath_generator.rb +2 -2
- data/lib/om/xml/terminology.rb +2 -2
- data/lib/om/xml/terminology_based_solrizer.rb +4 -4
- data/lib/tasks/om.rake +1 -11
- data/om.gemspec +5 -2
- data/spec/integration/querying_documents_spec.rb +0 -1
- data/spec/samples.rb +2 -0
- data/{lib/om → spec}/samples/mods_article.rb +0 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/unit/term_builder_spec.rb +0 -6
- metadata +69 -68
- data/README.rdoc +0 -21
- data/lib/om/samples.rb +0 -2
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 44a61e82e98c8010da9259bb94dd4c290f197fa7
|
4
|
+
data.tar.gz: 7386eda5bf6c846f1951cf23072ef94cab809deb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 79dc1948ff7370f23878e86b864da077efd9937805dff28fe31245757d14b149f18f269addafe84cb650beab61f1207b12ea780e5b690ab26950b68693b363a5
|
7
|
+
data.tar.gz: 561feab3a3d79d6f24f09ac66f059954487566cf6e12134e1b6c97768551bbb74c10389896adf85060ce4e72e355642db93382394968a07f917bbbc0f826de8d
|
data/.document
CHANGED
data/Gemfile
CHANGED
data/README.textile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
!https://travis-ci.org/projecthydra/om.png!:https://travis-ci.org/projecthydra/om
|
2
|
+
|
1
3
|
h1. om (Optinionated Metadata)
|
2
4
|
|
3
5
|
A library to help you tame sprawling XML schemas like MODS.
|
@@ -8,14 +10,14 @@ OM “terms” are ruby symbols you define (in the terminology) that map specifi
|
|
8
10
|
|
9
11
|
h2. Tutorials
|
10
12
|
|
11
|
-
* "Getting Started":
|
12
|
-
* "Querying Documents":
|
13
|
-
* "Updating Documents":
|
14
|
-
* "Getting Fancy":
|
13
|
+
* "Getting Started":https://github.com/projecthydra/om/blob/master/GETTING_STARTED.textile
|
14
|
+
* "Querying Documents":https://github.com/projecthydra/om/blob/master/QUERYING_DOCUMENTS.textile
|
15
|
+
* "Updating Documents":https://github.com/projecthydra/om/blob/master/UPDATING_DOCUMENTS.textile
|
16
|
+
* "Getting Fancy":https://github.com/projecthydra/om/blob/master/GETTING_FANCY.textile
|
15
17
|
|
16
18
|
h2. Common OM Patterns
|
17
19
|
|
18
|
-
"Common OM Patterns":
|
20
|
+
"Common OM Patterns":https://github.com/projecthydra/om/blob/master/COMMON_OM_PATTERNS.textile
|
19
21
|
|
20
22
|
h3. Solrizing Documents
|
21
23
|
|
data/UPDATING_DOCUMENTS.textile
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
h3. Updating, Inserting & Deleting Elements ("TermValueOperators":OM/XML/TermValueOperators.html)
|
1
|
+
h3. Updating, Inserting & Deleting Elements ("TermValueOperators":http://ruby-doc.org/gems/docs/o/om-1.8.0/OM/XML/TermValueOperators.html)
|
2
2
|
|
3
|
-
h3. Inserting entire hierarchies of Elements
|
3
|
+
h3. Inserting entire hierarchies of Elements
|
data/lib/om.rb
CHANGED
@@ -5,9 +5,10 @@ require 'deprecation'
|
|
5
5
|
require 'nokogiri'
|
6
6
|
|
7
7
|
module OM
|
8
|
-
# @params String, Array, or Hash
|
9
8
|
# Recursively changes any strings beginning with : to symbols and any number strings to integers
|
10
|
-
#
|
9
|
+
# @param [String, Array, Hash] params
|
10
|
+
# @example
|
11
|
+
# [{":person"=>"0"}, ":last_name"] #=> [{:person=>0}, :last_name]
|
11
12
|
def self.destringify(params)
|
12
13
|
case params
|
13
14
|
when String
|
@@ -71,6 +72,5 @@ module OM::XML; end
|
|
71
72
|
|
72
73
|
require "om/tree_node"
|
73
74
|
require "om/xml"
|
74
|
-
require "om/samples"
|
75
75
|
require "om/version"
|
76
76
|
|
data/lib/om/version.rb
CHANGED
data/lib/om/xml.rb
CHANGED
@@ -30,9 +30,9 @@ module OM::XML
|
|
30
30
|
|
31
31
|
module ClassMethods
|
32
32
|
|
33
|
-
# @pointer accessor or property info pointer
|
34
|
-
#
|
35
|
-
#
|
33
|
+
# @param pointer accessor or property info pointer
|
34
|
+
# @example
|
35
|
+
# [[:person,1],:role] #=> [{:person=>1},:role]
|
36
36
|
def sanitize_pointer(pointer)
|
37
37
|
if pointer.kind_of?(Array)
|
38
38
|
pointer.each do |x|
|
data/lib/om/xml/container.rb
CHANGED
@@ -7,8 +7,8 @@ module OM::XML::Container
|
|
7
7
|
|
8
8
|
module ClassMethods
|
9
9
|
|
10
|
-
# @
|
11
|
-
# @
|
10
|
+
# @param [String,File,Nokogiri::XML::Node] xml
|
11
|
+
# @param [ActiveFedora::Datastream] tmpl
|
12
12
|
# Careful! If you call this from a constructor, be sure to provide something 'ie. self' as the @tmpl. Otherwise, you will get an infinite loop!
|
13
13
|
def from_xml(xml=nil, tmpl=self.new) # :nodoc:
|
14
14
|
if xml.nil?
|
@@ -24,7 +24,7 @@ module OM::XML::Container
|
|
24
24
|
# By default, new OM Document instances will create an empty xml document, but if you override self.xml_template to return a different object (e.g. Nokogiri::XML::Document), that will be created instead.
|
25
25
|
# You can make this method create the documents however you want as long as it returns a Nokogiri::XML::Document.
|
26
26
|
# In the tutorials, we use Nokogiri::XML::Builder in this mehtod and call its .doc method at the end of xml_template in order to return the Nokogiri::XML::Document object. Instead of using Nokogiri::XML::Builder, you could put your template into an actual xml file and have xml_template use Nokogiri::XML::Document.parse to load it. That’s up to you.
|
27
|
-
# @return Nokogiri::XML::Document
|
27
|
+
# @return [Nokogiri::XML::Document]
|
28
28
|
def xml_template
|
29
29
|
Nokogiri::XML::Document.parse("")
|
30
30
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module OM::XML::NodeGenerator
|
2
2
|
|
3
3
|
# Module Methods -- These methods can be called directly on the Module itself
|
4
|
-
# @param OM::XML::Term term The term to generate a node based on
|
5
|
-
# @param String builder_new_value The new value to insert into the generated node
|
6
|
-
# @
|
4
|
+
# @param [OM::XML::Term] term The term to generate a node based on
|
5
|
+
# @param [String] builder_new_value The new value to insert into the generated node
|
6
|
+
# @return [Nokogiri::XML::Document]
|
7
7
|
#
|
8
8
|
# Ex.
|
9
9
|
# term = t.retrieve_term(:person, :first_name)
|
@@ -18,4 +18,4 @@ module OM::XML::NodeGenerator
|
|
18
18
|
return builder.doc
|
19
19
|
end
|
20
20
|
|
21
|
-
end
|
21
|
+
end
|
@@ -37,8 +37,9 @@ class OM::XML::TemplateRegistry
|
|
37
37
|
end
|
38
38
|
|
39
39
|
# Define an XML template
|
40
|
-
# @param [Symbol]
|
41
|
-
# @
|
40
|
+
# @param [Symbol] node_type key to associate with this template
|
41
|
+
# @yield [builder] a block that will receive a [Nokogiri::XML::Builder] object and any arbitrary parameters passed to +instantiate+
|
42
|
+
# @yieldparam [Nokogiri::XML::Builder]
|
42
43
|
# @return the +node_type+ Symbol
|
43
44
|
def define(node_type, &block)
|
44
45
|
unless node_type.is_a?(Symbol)
|
@@ -50,7 +51,7 @@ class OM::XML::TemplateRegistry
|
|
50
51
|
end
|
51
52
|
|
52
53
|
# Undefine an XML template
|
53
|
-
# @param [Symbol] the node_type key of the template to undefine
|
54
|
+
# @param [Symbol] node_type the node_type key of the template to undefine
|
54
55
|
# @return the +node_type+ Symbol
|
55
56
|
def undefine(node_type)
|
56
57
|
@templates.delete(node_type)
|
@@ -58,7 +59,7 @@ class OM::XML::TemplateRegistry
|
|
58
59
|
end
|
59
60
|
|
60
61
|
# Check whether a particular node_type is defined
|
61
|
-
# @param [Symbol] the node_type key to check
|
62
|
+
# @param [Symbol] node_type the node_type key to check
|
62
63
|
# @return [True] or [False]
|
63
64
|
def has_node_type?(node_type)
|
64
65
|
@templates.has_key?(node_type)
|
@@ -71,8 +72,8 @@ class OM::XML::TemplateRegistry
|
|
71
72
|
end
|
72
73
|
|
73
74
|
# Instantiate a detached, standalone node
|
74
|
-
# @param [Symbol] the node_type to instantiate
|
75
|
-
# @param additional arguments to pass to the template
|
75
|
+
# @param [Symbol] node_type the node_type to instantiate
|
76
|
+
# @param [Hash] args additional arguments to pass to the template
|
76
77
|
def instantiate(node_type, *args)
|
77
78
|
result = create_detached_node(nil, node_type, *args)
|
78
79
|
# Strip namespaces from text and CDATA nodes. Stupid Nokogiri.
|
data/lib/om/xml/term.rb
CHANGED
@@ -19,10 +19,6 @@ class OM::XML::Term
|
|
19
19
|
# the Builder will add your method & arguments to the it's settings and return itself.
|
20
20
|
class Builder
|
21
21
|
|
22
|
-
extend Deprecation
|
23
|
-
self.deprecation_behavior = :stderr
|
24
|
-
self.deprecation_horizon = 'release 2.0'
|
25
|
-
|
26
22
|
attr_accessor :name, :settings, :children, :terminology_builder
|
27
23
|
|
28
24
|
def initialize(name, terminology_builder=nil)
|
@@ -124,14 +120,6 @@ class OM::XML::Term
|
|
124
120
|
return term
|
125
121
|
end
|
126
122
|
|
127
|
-
# :data_type accessor has been deprecated in favor of :type
|
128
|
-
# Any value set for :data_type will get set for :type instead
|
129
|
-
def data_type value
|
130
|
-
@settings[:type] = value
|
131
|
-
return self
|
132
|
-
end
|
133
|
-
deprecation_deprecate :data_type
|
134
|
-
|
135
123
|
# We have to add this method so it will play nice with ruby 1.8.7
|
136
124
|
def type value
|
137
125
|
@settings[:type] = value
|
@@ -190,17 +178,14 @@ class OM::XML::Term
|
|
190
178
|
|
191
179
|
# h2. Namespaces
|
192
180
|
# By default, OM assumes you have no namespace defined unless it is explicitly defined at the root of your document.
|
193
|
-
# If you want to specify which namespace a term is using, use:
|
194
|
-
# namspace_prefix => "bar"
|
195
|
-
# This value defaults to nil, in which case if a default namespace is set in the termnology, that namespace will be used.
|
196
181
|
#
|
197
|
-
# @param
|
198
|
-
# @param
|
199
|
-
# @
|
200
|
-
# @
|
201
|
-
# @
|
202
|
-
# @
|
203
|
-
# @
|
182
|
+
# @param [Symbol] name the name to refer to this term by
|
183
|
+
# @param [Hash] opts
|
184
|
+
# @option opts [Array] :index_as a list of indexing hints provided to to_solr
|
185
|
+
# @option opts [String] :path partial xpath that points to the node.
|
186
|
+
# @option opts [Hash] :attributes xml attributes to match in the selector
|
187
|
+
# @option opts [String] :namespace_prefix xml namespace for this node. If not provided, the default namespace set in the terminology will be used.
|
188
|
+
# @option opts [Symbol] :type one of :string, :date, :integer. Defaults to :string
|
204
189
|
def initialize(name, opts={}, terminology=nil)
|
205
190
|
opts = {:ancestors=>[], :children=>{}}.merge(opts)
|
206
191
|
[:children, :ancestors,:path, :index_as, :required, :variant_of, :path, :attributes, :default_content_path, :namespace_prefix].each do |accessor_name|
|
@@ -250,7 +235,7 @@ class OM::XML::Term
|
|
250
235
|
end
|
251
236
|
end
|
252
237
|
|
253
|
-
# @param
|
238
|
+
# @param [String] val the value (from xml) to deserialize into the correct object type.
|
254
239
|
# @return [String,Date,Integer]
|
255
240
|
def deserialize(val)
|
256
241
|
case type
|
@@ -324,7 +309,8 @@ class OM::XML::Term
|
|
324
309
|
end
|
325
310
|
|
326
311
|
# +term_pointers+ reference to the property you want to generate a builder template for
|
327
|
-
# @
|
312
|
+
# @param [Hash] extra_opts
|
313
|
+
# @option extra_opts [Hash] :attributes
|
328
314
|
def xml_builder_template(extra_opts = {})
|
329
315
|
extra_attributes = extra_opts.fetch(:attributes, {})
|
330
316
|
|
@@ -369,8 +355,8 @@ class OM::XML::Term
|
|
369
355
|
end
|
370
356
|
|
371
357
|
# Return an XML representation of the Term
|
372
|
-
# @param [Hash] options
|
373
|
-
# @param [Nokogiri::XML::Document] (optional) document to insert the term xml into
|
358
|
+
# @param [Hash] options the term will be added to it. If :children=>false, skips rendering child Terms
|
359
|
+
# @param [Nokogiri::XML::Document] document (optional) document to insert the term xml into
|
374
360
|
# @return [Nokogiri::XML::Document]
|
375
361
|
# @example If :children=>false, skips rendering child Terms
|
376
362
|
# term.to_xml(:children=>false)
|
@@ -27,7 +27,9 @@ module OM::XML::TermValueOperators
|
|
27
27
|
end
|
28
28
|
|
29
29
|
#
|
30
|
-
#
|
30
|
+
# @param [Hash] params
|
31
|
+
# @example
|
32
|
+
# {[{":person"=>"0"}, "role", "text"]=>{"0"=>"role1", "1"=>"role2", "2"=>"role3"}, [{:person=>1}, :family_name]=>"Andronicus", [{"person"=>"1"},:given_name]=>["Titus"],[{:person=>1},:role,:text]=>["otherrole1","otherrole2"] }
|
31
33
|
def update_values(params={})
|
32
34
|
# remove any terms from params that this datastream doesn't recognize
|
33
35
|
|
@@ -100,8 +100,8 @@ module OM::XML::TermXpathGenerator
|
|
100
100
|
end
|
101
101
|
|
102
102
|
# Generate an xpath of the chosen +type+ for the given Term.
|
103
|
-
# @param [OM::XML::Term] term that you want to generate relative xpath for
|
104
|
-
# @param [Symbol] the type of xpath to generate, :relative, :abolute, or :constrained
|
103
|
+
# @param [OM::XML::Term] term the term that you want to generate relative xpath for
|
104
|
+
# @param [Symbol] type the type of xpath to generate, :relative, :abolute, or :constrained
|
105
105
|
def self.generate_xpath(term, type)
|
106
106
|
case type
|
107
107
|
when :relative
|
data/lib/om/xml/terminology.rb
CHANGED
@@ -249,8 +249,8 @@ class OM::XML::Terminology
|
|
249
249
|
end
|
250
250
|
|
251
251
|
# Return an XML representation of the Terminology and its terms
|
252
|
-
# @param [Hash] options
|
253
|
-
# @param [Nokogiri::XML::Document] (optional) document to insert the term xml into
|
252
|
+
# @param [Hash] options the term will be added to it. If :children=>false, skips rendering child Terms
|
253
|
+
# @param [Nokogiri::XML::Document] document (optional) document to insert the term xml into
|
254
254
|
# @return [Nokogiri::XML::Document]
|
255
255
|
# @example If :children=>false, skips rendering child Terms
|
256
256
|
# terminology.to_xml(:children=>false)
|
@@ -11,7 +11,7 @@ module OM::XML::TerminologyBasedSolrizer
|
|
11
11
|
|
12
12
|
# Build a solr document from +doc+ based on its terminology
|
13
13
|
# @param [OM::XML::Document] doc
|
14
|
-
# @param [Hash] (optional) solr_doc (values hash) to populate
|
14
|
+
# @param [Hash] solr_doc (optional) solr_doc (values hash) to populate
|
15
15
|
def solrize(doc, solr_doc=Hash.new, field_mapper = nil)
|
16
16
|
unless doc.class.terminology.nil?
|
17
17
|
doc.class.terminology.terms.each_pair do |term_name,term|
|
@@ -29,7 +29,7 @@ module OM::XML::TerminologyBasedSolrizer
|
|
29
29
|
# rendered to a string.
|
30
30
|
# @param [OM::XML::Document] doc xml document to extract values from
|
31
31
|
# @param [OM::XML::Term] term corresponding to desired xml values
|
32
|
-
# @param [Hash] (optional) solr_doc (values hash) to populate
|
32
|
+
# @param [Hash] solr_doc (optional) solr_doc (values hash) to populate
|
33
33
|
def solrize_term(doc, term, solr_doc = Hash.new, field_mapper = nil, opts={})
|
34
34
|
parents = opts.fetch(:parents, [])
|
35
35
|
term_pointer = parents+[term.name]
|
@@ -49,11 +49,11 @@ module OM::XML::TerminologyBasedSolrizer
|
|
49
49
|
# Populate a solr document with solr fields corresponding to the given xml node
|
50
50
|
# Field names are generated using settings from the term in the +doc+'s terminology corresponding to +term_pointer+
|
51
51
|
# If the supplied term does not have an index_as attribute, no indexing will be performed.
|
52
|
-
# @param [Nokogiri::XML::Node] node to solrize
|
52
|
+
# @param [Nokogiri::XML::Node] node_value node to solrize
|
53
53
|
# @param [OM::XML::Document] doc document the node came from
|
54
54
|
# @param [Array] term_pointer Array pointing to the term that should be used for solrization settings
|
55
55
|
# @param [Term] term the term to be solrized
|
56
|
-
# @param [Hash] (optional) solr_doc (values hash) to populate
|
56
|
+
# @param [Hash] solr_doc (optional) solr_doc (values hash) to populate
|
57
57
|
# @return [Hash] the solr doc
|
58
58
|
def solrize_node(node_value, doc, term_pointer, term, solr_doc = Hash.new, field_mapper = nil, opts = {})
|
59
59
|
return solr_doc unless term.index_as && !term.index_as.empty?
|
data/lib/tasks/om.rake
CHANGED
@@ -34,17 +34,7 @@ namespace :om do
|
|
34
34
|
|
35
35
|
YARD::Rake::YardocTask.new(:doc) do |yt|
|
36
36
|
readme_filename = 'README.textile'
|
37
|
-
|
38
|
-
Dir[File.join(project_root, "*.textile")].each_with_index do |f, index|
|
39
|
-
unless f.include?("/#{readme_filename}") # Skip readme, which is already built by the --readme option
|
40
|
-
textile_docs << '-'
|
41
|
-
textile_docs << f
|
42
|
-
end
|
43
|
-
end
|
44
|
-
yt.files = Dir.glob(File.join(project_root, 'lib', '**', '*.rb')) + textile_docs
|
45
|
-
# [ File.join(project_root, 'README.textile') ]
|
46
|
-
# [ File.join(project_root, 'README.textile'),'-', File.join(project_root,'GETTING_STARTED.textile') ]
|
47
|
-
yt.options = ['--private', '--protected', '--output-dir', doc_destination, '--readme', readme_filename]
|
37
|
+
#yt.options = ['--private', '--protected', '--output-dir', doc_destination, '--readme', readme_filename]
|
48
38
|
end
|
49
39
|
rescue LoadError
|
50
40
|
desc "Generate YARD Documentation"
|
data/om.gemspec
CHANGED
@@ -12,15 +12,19 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.summary = %q{OM (Opinionated Metadata): A library to help you tame sprawling XML schemas like MODS.}
|
13
13
|
s.description = %q{OM (Opinionated Metadata): A library to help you tame sprawling XML schemas like MODS. Wraps Nokogiri documents in objects with miscellaneous helper methods for doing things like retrieve generated xpath queries or look up properties based on a simplified DSL}
|
14
14
|
|
15
|
+
s.required_ruby_version = '>= 1.9.3'
|
16
|
+
|
15
17
|
s.add_dependency 'activesupport'
|
16
18
|
s.add_dependency 'activemodel'
|
17
|
-
s.add_dependency 'solrizer', '~> 3.0.0
|
19
|
+
s.add_dependency 'solrizer', '~> 3.0.0'
|
18
20
|
s.add_dependency('nokogiri', ">= 1.4.2")
|
19
21
|
s.add_dependency('mediashelf-loggable')
|
20
22
|
s.add_dependency('deprecation')
|
21
23
|
s.add_development_dependency "rspec", "~> 2.0"
|
22
24
|
s.add_development_dependency "rake"
|
25
|
+
s.add_development_dependency "yard"
|
23
26
|
s.add_development_dependency "rdoc"
|
27
|
+
s.add_development_dependency "RedCloth" # for textile formatting in rdoc
|
24
28
|
s.add_development_dependency "awesome_print"
|
25
29
|
s.add_development_dependency "equivalent-xml", ">= 0.2.4"
|
26
30
|
|
@@ -29,7 +33,6 @@ Gem::Specification.new do |s|
|
|
29
33
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
30
34
|
s.extra_rdoc_files = [
|
31
35
|
"LICENSE",
|
32
|
-
"README.rdoc",
|
33
36
|
"README.textile"
|
34
37
|
]
|
35
38
|
s.require_paths = ["lib"]
|
data/spec/samples.rb
ADDED
File without changes
|
data/spec/spec_helper.rb
CHANGED
@@ -64,12 +64,6 @@ describe "OM::XML::Term::Builder" do
|
|
64
64
|
@test_builder.settings[:default_content_path].should be_nil
|
65
65
|
end
|
66
66
|
end
|
67
|
-
describe ":data_type" do
|
68
|
-
it "is deprecated and should be assinged to the :type setting" do
|
69
|
-
deprecated_term = OM::XML::Term::Builder.new("depreated_term").data_type(:thing)
|
70
|
-
deprecated_term.settings[:type].should == :thing
|
71
|
-
end
|
72
|
-
end
|
73
67
|
end
|
74
68
|
|
75
69
|
describe ".add_child" do
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: om
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
5
|
-
prerelease: 6
|
4
|
+
version: 2.0.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Matt Zumwalt
|
@@ -10,185 +9,191 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date: 2013-
|
12
|
+
date: 2013-03-28 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: activesupport
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
|
-
- -
|
18
|
+
- - '>='
|
21
19
|
- !ruby/object:Gem::Version
|
22
20
|
version: '0'
|
23
21
|
type: :runtime
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
|
-
- -
|
25
|
+
- - '>='
|
29
26
|
- !ruby/object:Gem::Version
|
30
27
|
version: '0'
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
29
|
name: activemodel
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
|
-
- -
|
32
|
+
- - '>='
|
37
33
|
- !ruby/object:Gem::Version
|
38
34
|
version: '0'
|
39
35
|
type: :runtime
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
|
-
- -
|
39
|
+
- - '>='
|
45
40
|
- !ruby/object:Gem::Version
|
46
41
|
version: '0'
|
47
42
|
- !ruby/object:Gem::Dependency
|
48
43
|
name: solrizer
|
49
44
|
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
45
|
requirements:
|
52
|
-
- -
|
46
|
+
- - ~>
|
53
47
|
- !ruby/object:Gem::Version
|
54
|
-
version: 3.0.0
|
48
|
+
version: 3.0.0
|
55
49
|
type: :runtime
|
56
50
|
prerelease: false
|
57
51
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
52
|
requirements:
|
60
|
-
- -
|
53
|
+
- - ~>
|
61
54
|
- !ruby/object:Gem::Version
|
62
|
-
version: 3.0.0
|
55
|
+
version: 3.0.0
|
63
56
|
- !ruby/object:Gem::Dependency
|
64
57
|
name: nokogiri
|
65
58
|
requirement: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
59
|
requirements:
|
68
|
-
- -
|
60
|
+
- - '>='
|
69
61
|
- !ruby/object:Gem::Version
|
70
62
|
version: 1.4.2
|
71
63
|
type: :runtime
|
72
64
|
prerelease: false
|
73
65
|
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
66
|
requirements:
|
76
|
-
- -
|
67
|
+
- - '>='
|
77
68
|
- !ruby/object:Gem::Version
|
78
69
|
version: 1.4.2
|
79
70
|
- !ruby/object:Gem::Dependency
|
80
71
|
name: mediashelf-loggable
|
81
72
|
requirement: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
73
|
requirements:
|
84
|
-
- -
|
74
|
+
- - '>='
|
85
75
|
- !ruby/object:Gem::Version
|
86
76
|
version: '0'
|
87
77
|
type: :runtime
|
88
78
|
prerelease: false
|
89
79
|
version_requirements: !ruby/object:Gem::Requirement
|
90
|
-
none: false
|
91
80
|
requirements:
|
92
|
-
- -
|
81
|
+
- - '>='
|
93
82
|
- !ruby/object:Gem::Version
|
94
83
|
version: '0'
|
95
84
|
- !ruby/object:Gem::Dependency
|
96
85
|
name: deprecation
|
97
86
|
requirement: !ruby/object:Gem::Requirement
|
98
|
-
none: false
|
99
87
|
requirements:
|
100
|
-
- -
|
88
|
+
- - '>='
|
101
89
|
- !ruby/object:Gem::Version
|
102
90
|
version: '0'
|
103
91
|
type: :runtime
|
104
92
|
prerelease: false
|
105
93
|
version_requirements: !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
107
94
|
requirements:
|
108
|
-
- -
|
95
|
+
- - '>='
|
109
96
|
- !ruby/object:Gem::Version
|
110
97
|
version: '0'
|
111
98
|
- !ruby/object:Gem::Dependency
|
112
99
|
name: rspec
|
113
100
|
requirement: !ruby/object:Gem::Requirement
|
114
|
-
none: false
|
115
101
|
requirements:
|
116
|
-
- -
|
102
|
+
- - ~>
|
117
103
|
- !ruby/object:Gem::Version
|
118
104
|
version: '2.0'
|
119
105
|
type: :development
|
120
106
|
prerelease: false
|
121
107
|
version_requirements: !ruby/object:Gem::Requirement
|
122
|
-
none: false
|
123
108
|
requirements:
|
124
|
-
- -
|
109
|
+
- - ~>
|
125
110
|
- !ruby/object:Gem::Version
|
126
111
|
version: '2.0'
|
127
112
|
- !ruby/object:Gem::Dependency
|
128
113
|
name: rake
|
129
114
|
requirement: !ruby/object:Gem::Requirement
|
130
|
-
none: false
|
131
115
|
requirements:
|
132
|
-
- -
|
116
|
+
- - '>='
|
133
117
|
- !ruby/object:Gem::Version
|
134
118
|
version: '0'
|
135
119
|
type: :development
|
136
120
|
prerelease: false
|
137
121
|
version_requirements: !ruby/object:Gem::Requirement
|
138
|
-
none: false
|
139
122
|
requirements:
|
140
|
-
- -
|
123
|
+
- - '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: yard
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - '>='
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - '>='
|
141
138
|
- !ruby/object:Gem::Version
|
142
139
|
version: '0'
|
143
140
|
- !ruby/object:Gem::Dependency
|
144
141
|
name: rdoc
|
145
142
|
requirement: !ruby/object:Gem::Requirement
|
146
|
-
none: false
|
147
143
|
requirements:
|
148
|
-
- -
|
144
|
+
- - '>='
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '0'
|
147
|
+
type: :development
|
148
|
+
prerelease: false
|
149
|
+
version_requirements: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - '>='
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
154
|
+
- !ruby/object:Gem::Dependency
|
155
|
+
name: RedCloth
|
156
|
+
requirement: !ruby/object:Gem::Requirement
|
157
|
+
requirements:
|
158
|
+
- - '>='
|
149
159
|
- !ruby/object:Gem::Version
|
150
160
|
version: '0'
|
151
161
|
type: :development
|
152
162
|
prerelease: false
|
153
163
|
version_requirements: !ruby/object:Gem::Requirement
|
154
|
-
none: false
|
155
164
|
requirements:
|
156
|
-
- -
|
165
|
+
- - '>='
|
157
166
|
- !ruby/object:Gem::Version
|
158
167
|
version: '0'
|
159
168
|
- !ruby/object:Gem::Dependency
|
160
169
|
name: awesome_print
|
161
170
|
requirement: !ruby/object:Gem::Requirement
|
162
|
-
none: false
|
163
171
|
requirements:
|
164
|
-
- -
|
172
|
+
- - '>='
|
165
173
|
- !ruby/object:Gem::Version
|
166
174
|
version: '0'
|
167
175
|
type: :development
|
168
176
|
prerelease: false
|
169
177
|
version_requirements: !ruby/object:Gem::Requirement
|
170
|
-
none: false
|
171
178
|
requirements:
|
172
|
-
- -
|
179
|
+
- - '>='
|
173
180
|
- !ruby/object:Gem::Version
|
174
181
|
version: '0'
|
175
182
|
- !ruby/object:Gem::Dependency
|
176
183
|
name: equivalent-xml
|
177
184
|
requirement: !ruby/object:Gem::Requirement
|
178
|
-
none: false
|
179
185
|
requirements:
|
180
|
-
- -
|
186
|
+
- - '>='
|
181
187
|
- !ruby/object:Gem::Version
|
182
188
|
version: 0.2.4
|
183
189
|
type: :development
|
184
190
|
prerelease: false
|
185
191
|
version_requirements: !ruby/object:Gem::Requirement
|
186
|
-
none: false
|
187
192
|
requirements:
|
188
|
-
- -
|
193
|
+
- - '>='
|
189
194
|
- !ruby/object:Gem::Version
|
190
195
|
version: 0.2.4
|
191
|
-
description:
|
196
|
+
description: 'OM (Opinionated Metadata): A library to help you tame sprawling XML
|
192
197
|
schemas like MODS. Wraps Nokogiri documents in objects with miscellaneous helper
|
193
198
|
methods for doing things like retrieve generated xpath queries or look up properties
|
194
199
|
based on a simplified DSL'
|
@@ -197,11 +202,10 @@ executables: []
|
|
197
202
|
extensions: []
|
198
203
|
extra_rdoc_files:
|
199
204
|
- LICENSE
|
200
|
-
- README.rdoc
|
201
205
|
- README.textile
|
202
206
|
files:
|
203
|
-
-
|
204
|
-
-
|
207
|
+
- .document
|
208
|
+
- .gitignore
|
205
209
|
- COMMON_OM_PATTERNS.textile
|
206
210
|
- GETTING_FANCY.textile
|
207
211
|
- GETTING_STARTED.textile
|
@@ -209,15 +213,12 @@ files:
|
|
209
213
|
- History.textile
|
210
214
|
- LICENSE
|
211
215
|
- QUERYING_DOCUMENTS.textile
|
212
|
-
- README.rdoc
|
213
216
|
- README.textile
|
214
217
|
- Rakefile
|
215
218
|
- UPDATING_DOCUMENTS.textile
|
216
219
|
- container_spec.rb
|
217
220
|
- devel/notes.txt
|
218
221
|
- lib/om.rb
|
219
|
-
- lib/om/samples.rb
|
220
|
-
- lib/om/samples/mods_article.rb
|
221
222
|
- lib/om/tree_node.rb
|
222
223
|
- lib/om/version.rb
|
223
224
|
- lib/om/xml.rb
|
@@ -252,6 +253,8 @@ files:
|
|
252
253
|
- spec/integration/serialization_spec.rb
|
253
254
|
- spec/integration/set_reentrant_terminology_spec.rb
|
254
255
|
- spec/integration/xpathy_stuff_spec.rb
|
256
|
+
- spec/samples.rb
|
257
|
+
- spec/samples/mods_article.rb
|
255
258
|
- spec/spec.opts
|
256
259
|
- spec/spec_helper.rb
|
257
260
|
- spec/unit/container_spec.rb
|
@@ -274,31 +277,27 @@ files:
|
|
274
277
|
- spec/unit/xml_terminology_based_solrizer_spec.rb
|
275
278
|
homepage: http://github.com/projecthydra/om
|
276
279
|
licenses: []
|
280
|
+
metadata: {}
|
277
281
|
post_install_message:
|
278
282
|
rdoc_options: []
|
279
283
|
require_paths:
|
280
284
|
- lib
|
281
285
|
required_ruby_version: !ruby/object:Gem::Requirement
|
282
|
-
none: false
|
283
286
|
requirements:
|
284
|
-
- -
|
287
|
+
- - '>='
|
285
288
|
- !ruby/object:Gem::Version
|
286
|
-
version:
|
287
|
-
segments:
|
288
|
-
- 0
|
289
|
-
hash: 2574079626263832147
|
289
|
+
version: 1.9.3
|
290
290
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
291
|
-
none: false
|
292
291
|
requirements:
|
293
|
-
- -
|
292
|
+
- - '>='
|
294
293
|
- !ruby/object:Gem::Version
|
295
|
-
version:
|
294
|
+
version: '0'
|
296
295
|
requirements: []
|
297
296
|
rubyforge_project:
|
298
|
-
rubygems_version:
|
297
|
+
rubygems_version: 2.0.0
|
299
298
|
signing_key:
|
300
|
-
specification_version:
|
301
|
-
summary:
|
299
|
+
specification_version: 4
|
300
|
+
summary: 'OM (Opinionated Metadata): A library to help you tame sprawling XML schemas
|
302
301
|
like MODS.'
|
303
302
|
test_files:
|
304
303
|
- spec/fixtures/CBF_MODS/ARS0025_016.xml
|
@@ -317,6 +316,8 @@ test_files:
|
|
317
316
|
- spec/integration/serialization_spec.rb
|
318
317
|
- spec/integration/set_reentrant_terminology_spec.rb
|
319
318
|
- spec/integration/xpathy_stuff_spec.rb
|
319
|
+
- spec/samples.rb
|
320
|
+
- spec/samples/mods_article.rb
|
320
321
|
- spec/spec.opts
|
321
322
|
- spec/spec_helper.rb
|
322
323
|
- spec/unit/container_spec.rb
|
data/README.rdoc
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
= opinionated-xml
|
2
|
-
|
3
|
-
A library to help you tame sprawling XML schemas like MODS.
|
4
|
-
|
5
|
-
OM allows you to define a “terminology” to ease translation between XML and ruby objects – you can query the xml for Nodes or node values without ever writing a line of XPath.
|
6
|
-
|
7
|
-
OM “terms” are ruby symbols you define (in the terminology) that map specific XML content into ruby object attributes.
|
8
|
-
|
9
|
-
== Note on Patches/Pull Requests
|
10
|
-
|
11
|
-
* Fork the project.
|
12
|
-
* Make your feature addition or bug fix.
|
13
|
-
* Add tests for it. This is important so I don't break it in a
|
14
|
-
future version unintentionally.
|
15
|
-
* Commit, do not mess with rakefile, version, or history.
|
16
|
-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
17
|
-
* Send me a pull request. Bonus points for topic branches.
|
18
|
-
|
19
|
-
== Copyright
|
20
|
-
|
21
|
-
Copyright (c) 2010 Matt Zumwalt. See LICENSE for details.
|
data/lib/om/samples.rb
DELETED