mods 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -1
- data/lib/mods/reader.rb +5 -1
- data/lib/mods/version.rb +1 -1
- data/spec/reader_spec.rb +3 -5
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -37,7 +37,8 @@ TODO: Write usage instructions here
|
|
37
37
|
|
38
38
|
== Releases
|
39
39
|
|
40
|
-
(0.0.
|
40
|
+
(0.0.14 make namespace aware processing the default)
|
41
|
+
0.0.13 really really fix removal of xsi:schemaLocation in jruby
|
41
42
|
0.0.12 fix failing jruby test
|
42
43
|
0.0.11 fix remove xsi:schemaLocation attribute from mods element when not using namespaces
|
43
44
|
0.0.10 remove xsi:schemaLocation attribute from mods element when not using namespaces
|
data/lib/mods/reader.rb
CHANGED
@@ -43,8 +43,12 @@ module Mods
|
|
43
43
|
if !@namespace_aware
|
44
44
|
@mods_ng_xml.remove_namespaces!
|
45
45
|
# xsi:schemaLocation attribute will cause problems in JRuby
|
46
|
-
@mods_ng_xml.root
|
46
|
+
if @mods_ng_xml.root && @mods_ng_xml.root.attributes.keys.include?('schemaLocation')
|
47
|
+
@mods_ng_xml.root.attributes['schemaLocation'].remove
|
48
|
+
end
|
47
49
|
# doing weird re-reading of xml for jruby, which gets confused by its own cache
|
50
|
+
# using pedantic is helpful for debugging
|
51
|
+
# @mods_ng_xml = Nokogiri::XML(@mods_ng_xml.to_s, nil, nil, Nokogiri::XML::ParseOptions::PEDANTIC)
|
48
52
|
@mods_ng_xml = Nokogiri::XML(@mods_ng_xml.to_s)
|
49
53
|
end
|
50
54
|
end
|
data/lib/mods/version.rb
CHANGED
data/spec/reader_spec.rb
CHANGED
@@ -92,13 +92,11 @@ describe "Mods::Reader" do
|
|
92
92
|
# Nokogiri treats namespaced attributes differently in jruby than in ruby
|
93
93
|
(ng_xml.root.has_attribute?('schemaLocation') || ng_xml.root.has_attribute?('xsi:schemaLocation')).should == true
|
94
94
|
r = Mods::Reader.new
|
95
|
-
r.namespace_aware =
|
95
|
+
r.namespace_aware = false
|
96
96
|
r.from_nk_node(ng_xml)
|
97
97
|
# the below are different depending on jruby or ruby ... oy
|
98
|
-
|
99
|
-
|
100
|
-
has = r.mods_ng_xml.has_attribute?('xsi:schemaLocation')
|
101
|
-
has_a.should == false if has_a
|
98
|
+
r.mods_ng_xml.root.attributes.keys.should_not include('schemaLocation')
|
99
|
+
r.mods_ng_xml.root.attributes.keys.should_not include('xsi:schemaLocation')
|
102
100
|
end
|
103
101
|
end
|
104
102
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mods
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-11-
|
13
|
+
date: 2012-11-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: nokogiri
|
@@ -214,7 +214,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
214
214
|
version: '0'
|
215
215
|
segments:
|
216
216
|
- 0
|
217
|
-
hash:
|
217
|
+
hash: 1378644879324237983
|
218
218
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
219
219
|
none: false
|
220
220
|
requirements:
|
@@ -223,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
223
|
version: '0'
|
224
224
|
segments:
|
225
225
|
- 0
|
226
|
-
hash:
|
226
|
+
hash: 1378644879324237983
|
227
227
|
requirements: []
|
228
228
|
rubyforge_project:
|
229
229
|
rubygems_version: 1.8.24
|