mods 0.0.10 → 0.0.11

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/README.rdoc CHANGED
@@ -37,6 +37,8 @@ TODO: Write usage instructions here
37
37
 
38
38
  == Releases
39
39
 
40
+ (0.0.12 make namespace aware processing the default)
41
+ 0.0.11 fix remove xsi:schemaLocation attribute from mods element when not using namespaces
40
42
  0.0.10 remove xsi:schemaLocation attribute from mods element when not using namespaces
41
43
  0.0.9 implement from_nk_node as way to load record object
42
44
  0.0.8 implement relatedItem and attributes on all simple top level elements
data/lib/mods/reader.rb CHANGED
@@ -43,7 +43,7 @@ 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.remove_attribute('schemaLocation') if @mods_ng_xml.has_attribute?('schemaLocation')
46
+ @mods_ng_xml.root.remove_attribute('xsi:schemaLocation') if @mods_ng_xml.has_attribute?('xsi:schemaLocation')
47
47
  # doing weird re-reading of xml for jruby, which gets confused by its own cache
48
48
  @mods_ng_xml = Nokogiri::XML(@mods_ng_xml.to_s)
49
49
  end
data/lib/mods/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Mods
2
2
  # this is the Ruby Gem version
3
- VERSION = "0.0.10"
3
+ VERSION = "0.0.11"
4
4
  end
data/spec/reader_spec.rb CHANGED
@@ -89,7 +89,8 @@ describe "Mods::Reader" do
89
89
  str = '<ns3:mods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="http://www.loc.gov/mods/v3" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-2.xsd">
90
90
  <ns3:note>be very frightened</ns3:note></ns3:mods>'
91
91
  ng_xml = Nokogiri::XML(str)
92
- ng_xml.root.has_attribute?('schemaLocation').should == true
92
+ # Nokogiri treats namespaced attributes differently in jruby than in ruby
93
+ (ng_xml.root.has_attribute?('schemaLocation') || ng_xml.root.has_attribute?('xsi:schemaLocation')).should == true
93
94
  r = Mods::Reader.new
94
95
  r.namespace_aware = true
95
96
  r.from_nk_node(ng_xml)
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.10
4
+ version: 0.0.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -214,7 +214,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
214
214
  version: '0'
215
215
  segments:
216
216
  - 0
217
- hash: -2366641569606885765
217
+ hash: -3403809671650053657
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: -2366641569606885765
226
+ hash: -3403809671650053657
227
227
  requirements: []
228
228
  rubyforge_project:
229
229
  rubygems_version: 1.8.24