mods 0.0.22 → 0.0.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.travis.yml +2 -0
- data/README.rdoc +3 -0
- data/lib/mods/reader.rb +0 -1
- data/lib/mods/record.rb +2 -2
- data/lib/mods/version.rb +1 -1
- data/spec/record_spec.rb +14 -1
- metadata +5 -33
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NDEwMWE1MTQ2NzZiZWY5N2U4NDg0MDAyZjdlZDVhYmQ1M2I2ZWVmZA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YTc1MTZhZjg2MWI1MmVhNmJlYjdmODU0N2M5OTg3MDNmM2I4ZTZhMA==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZjE1N2RmMmI3YTZkYWU1ZTU4ZDg4MWM3MzUzMDQ4N2RiZjEzNDAzNDE2NmFm
|
10
|
+
ZWFlZDllMTcyNWU0MzlkM2FjNjE1YmM3ODllYTlkMDMyMzg0MjI2OWY2N2My
|
11
|
+
YzVjODkwMDJiNDExOGJhMTZjODBiYzc5YzFmOWY2MGNhZDU5ODc=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZWNkYjNkZTQxMmZjNzI4NDhhODFmNGNmMjMxOGFjOTc1MjNiYTIyNGYyOThj
|
14
|
+
MmE0NTNmOTEwNWU4YjY1MzIzNTEyZWU5MGNkMTkzODU5NDg3MjYyNDUwNjYz
|
15
|
+
Mzc5YmZkZjI0YWMwMjVkZDA2OGVkNTUzYjVhNTA1NTU1OTExNGQ=
|
data/.travis.yml
CHANGED
data/README.rdoc
CHANGED
@@ -38,7 +38,10 @@ TODO: Write usage instructions here
|
|
38
38
|
|
39
39
|
== Releases
|
40
40
|
|
41
|
+
=======
|
42
|
+
* <b>0.0.23</b> minor bug and typo fixes
|
41
43
|
* <b>0.0.22</b> add displayLabel and lang attributes to every element
|
44
|
+
* <b>0.0.21</b> bug fix to check for nil values in name nodes
|
42
45
|
* <b>0.0.21</b> Check for the possibility that name_node.display_value is nil
|
43
46
|
* <b>0.0.20</b> added translated_value convenience method to geographicCode (mods.subject.geographicCode.translated_value)
|
44
47
|
* <b>0.0.19</b> term_values and term_value method added to Record object
|
data/lib/mods/reader.rb
CHANGED
data/lib/mods/record.rb
CHANGED
@@ -36,7 +36,7 @@ module Mods
|
|
36
36
|
# convenience method to call Mods::Reader.new.from_url and to nom
|
37
37
|
# @param namespace_aware true if the XML parsing should be strict about using namespaces. Default is true
|
38
38
|
# @param url (String) - url that has mods xml as its content
|
39
|
-
def from_url(url,
|
39
|
+
def from_url(url, ns_aware = true)
|
40
40
|
@mods_ng_xml = Mods::Reader.new(ns_aware).from_url(url)
|
41
41
|
if ns_aware
|
42
42
|
set_terminology_ns(@mods_ng_xml)
|
@@ -195,4 +195,4 @@ module Mods
|
|
195
195
|
|
196
196
|
end # class Record
|
197
197
|
|
198
|
-
end # module Mods
|
198
|
+
end # module Mods
|
data/lib/mods/version.rb
CHANGED
data/spec/record_spec.rb
CHANGED
@@ -6,6 +6,7 @@ describe "Mods::Record" do
|
|
6
6
|
@def_ns_decl = "xmlns='#{Mods::MODS_NS}'"
|
7
7
|
@example_ns_str = "<mods #{@def_ns_decl}><note>default ns</note></mods>"
|
8
8
|
@example_no_ns_str = '<mods><note>no ns</note></mods>'
|
9
|
+
@example_record_url = 'http://www.loc.gov/standards/mods/modsrdf/examples/0001.xml'
|
9
10
|
@doc_from_str_ns = Mods::Reader.new.from_str(@example_ns_str)
|
10
11
|
@doc_from_str_no_ns = Mods::Reader.new.from_str(@example_no_ns_str)
|
11
12
|
end
|
@@ -29,6 +30,18 @@ describe "Mods::Record" do
|
|
29
30
|
mods_ng_doc.note.map { |e| e.text }.should == ['no ns']
|
30
31
|
end
|
31
32
|
end
|
33
|
+
|
34
|
+
context "from_url" do
|
35
|
+
before(:all) do
|
36
|
+
@mods_doc = Mods::Record.new.from_url(@example_record_url)
|
37
|
+
end
|
38
|
+
it "should be a mods record" do
|
39
|
+
@mods_doc.kind_of? Mods::Record
|
40
|
+
end
|
41
|
+
it "should raise an error on a bad url" do
|
42
|
+
lambda{Mods::Record.new.from_url("http://example.org/fake.xml")}.should raise_error
|
43
|
+
end
|
44
|
+
end
|
32
45
|
|
33
46
|
context "from_nk_node" do
|
34
47
|
before(:all) do
|
@@ -322,4 +335,4 @@ describe "Mods::Record" do
|
|
322
335
|
end
|
323
336
|
end # convenience methods for tricky bits of terminology
|
324
337
|
|
325
|
-
end
|
338
|
+
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mods
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.23
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Naomi Dushay
|
@@ -10,12 +9,11 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2014-02-04 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: nokogiri
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
18
|
- - ! '>='
|
21
19
|
- !ruby/object:Gem::Version
|
@@ -23,7 +21,6 @@ dependencies:
|
|
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
|
@@ -31,7 +28,6 @@ dependencies:
|
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
29
|
name: nom-xml
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
32
|
- - ! '>='
|
37
33
|
- !ruby/object:Gem::Version
|
@@ -39,7 +35,6 @@ dependencies:
|
|
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
|
@@ -47,7 +42,6 @@ dependencies:
|
|
47
42
|
- !ruby/object:Gem::Dependency
|
48
43
|
name: iso-639
|
49
44
|
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
45
|
requirements:
|
52
46
|
- - ! '>='
|
53
47
|
- !ruby/object:Gem::Version
|
@@ -55,7 +49,6 @@ dependencies:
|
|
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
|
@@ -63,7 +56,6 @@ dependencies:
|
|
63
56
|
- !ruby/object:Gem::Dependency
|
64
57
|
name: rake
|
65
58
|
requirement: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
59
|
requirements:
|
68
60
|
- - ! '>='
|
69
61
|
- !ruby/object:Gem::Version
|
@@ -71,7 +63,6 @@ dependencies:
|
|
71
63
|
type: :development
|
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
|
@@ -79,7 +70,6 @@ dependencies:
|
|
79
70
|
- !ruby/object:Gem::Dependency
|
80
71
|
name: rdoc
|
81
72
|
requirement: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
73
|
requirements:
|
84
74
|
- - ! '>='
|
85
75
|
- !ruby/object:Gem::Version
|
@@ -87,7 +77,6 @@ dependencies:
|
|
87
77
|
type: :development
|
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
|
@@ -95,7 +84,6 @@ dependencies:
|
|
95
84
|
- !ruby/object:Gem::Dependency
|
96
85
|
name: yard
|
97
86
|
requirement: !ruby/object:Gem::Requirement
|
98
|
-
none: false
|
99
87
|
requirements:
|
100
88
|
- - ! '>='
|
101
89
|
- !ruby/object:Gem::Version
|
@@ -103,7 +91,6 @@ dependencies:
|
|
103
91
|
type: :development
|
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
|
@@ -111,7 +98,6 @@ dependencies:
|
|
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
|
@@ -119,7 +105,6 @@ dependencies:
|
|
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
|
@@ -127,7 +112,6 @@ dependencies:
|
|
127
112
|
- !ruby/object:Gem::Dependency
|
128
113
|
name: simplecov
|
129
114
|
requirement: !ruby/object:Gem::Requirement
|
130
|
-
none: false
|
131
115
|
requirements:
|
132
116
|
- - ! '>='
|
133
117
|
- !ruby/object:Gem::Version
|
@@ -135,7 +119,6 @@ dependencies:
|
|
135
119
|
type: :development
|
136
120
|
prerelease: false
|
137
121
|
version_requirements: !ruby/object:Gem::Requirement
|
138
|
-
none: false
|
139
122
|
requirements:
|
140
123
|
- - ! '>='
|
141
124
|
- !ruby/object:Gem::Version
|
@@ -143,7 +126,6 @@ dependencies:
|
|
143
126
|
- !ruby/object:Gem::Dependency
|
144
127
|
name: simplecov-rcov
|
145
128
|
requirement: !ruby/object:Gem::Requirement
|
146
|
-
none: false
|
147
129
|
requirements:
|
148
130
|
- - ! '>='
|
149
131
|
- !ruby/object:Gem::Version
|
@@ -151,7 +133,6 @@ dependencies:
|
|
151
133
|
type: :development
|
152
134
|
prerelease: false
|
153
135
|
version_requirements: !ruby/object:Gem::Requirement
|
154
|
-
none: false
|
155
136
|
requirements:
|
156
137
|
- - ! '>='
|
157
138
|
- !ruby/object:Gem::Version
|
@@ -159,7 +140,6 @@ dependencies:
|
|
159
140
|
- !ruby/object:Gem::Dependency
|
160
141
|
name: equivalent-xml
|
161
142
|
requirement: !ruby/object:Gem::Requirement
|
162
|
-
none: false
|
163
143
|
requirements:
|
164
144
|
- - ! '>='
|
165
145
|
- !ruby/object:Gem::Version
|
@@ -167,7 +147,6 @@ dependencies:
|
|
167
147
|
type: :development
|
168
148
|
prerelease: false
|
169
149
|
version_requirements: !ruby/object:Gem::Requirement
|
170
|
-
none: false
|
171
150
|
requirements:
|
172
151
|
- - ! '>='
|
173
152
|
- !ruby/object:Gem::Version
|
@@ -220,33 +199,26 @@ files:
|
|
220
199
|
- spec/top_level_elmnts_simple_spec.rb
|
221
200
|
homepage: https://github.com/sul-dlss/mods
|
222
201
|
licenses: []
|
202
|
+
metadata: {}
|
223
203
|
post_install_message:
|
224
204
|
rdoc_options: []
|
225
205
|
require_paths:
|
226
206
|
- lib
|
227
207
|
required_ruby_version: !ruby/object:Gem::Requirement
|
228
|
-
none: false
|
229
208
|
requirements:
|
230
209
|
- - ! '>='
|
231
210
|
- !ruby/object:Gem::Version
|
232
211
|
version: '0'
|
233
|
-
segments:
|
234
|
-
- 0
|
235
|
-
hash: 2304160584269815561
|
236
212
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
237
|
-
none: false
|
238
213
|
requirements:
|
239
214
|
- - ! '>='
|
240
215
|
- !ruby/object:Gem::Version
|
241
216
|
version: '0'
|
242
|
-
segments:
|
243
|
-
- 0
|
244
|
-
hash: 2304160584269815561
|
245
217
|
requirements: []
|
246
218
|
rubyforge_project:
|
247
|
-
rubygems_version:
|
219
|
+
rubygems_version: 2.0.7
|
248
220
|
signing_key:
|
249
|
-
specification_version:
|
221
|
+
specification_version: 4
|
250
222
|
summary: Parse MODS (Metadata Object Description Schema) records.
|
251
223
|
test_files:
|
252
224
|
- spec/language_spec.rb
|