harvestdor 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3036c2f23661946012d909179b67effa433c2dd9
4
- data.tar.gz: 149e27d97f4c9d48ca46772d550537aca8a55362
3
+ metadata.gz: dedc072f7e987057ecc62cd6fb174c9733ce414b
4
+ data.tar.gz: 452697c49d6328ffbb334666e3d9f8892ddf5e3e
5
5
  SHA512:
6
- metadata.gz: 4406cda66fcb2a726564ba912c60364433b9209ac03218fc2fbf70200fe679f8c964fa416abc0f163eecdabc4db51ad7b57de148f38cf4773b84a4de3fde854e
7
- data.tar.gz: b18c647163a3970ae02cb3ee79ba0df04f4d5920ccbc5740a83b19b2958297ce2b1e0c761128293ae7bbb51633e419a6689b839f33f34f602a5292b2a078a4db
6
+ metadata.gz: b544187441fff729f33c33bcda20f4a9d9f3c827fad46dab343d8fc4a9ac71a60a8f9a838a4c767f6e29ce23ef5e54cec843c239f1c416690fa1a12c0eeab44a
7
+ data.tar.gz: adf1836583a2b617321ff6b75649dd391161e31b004b2bc93bf513785ec11f6cc84570fd6d1e9bb661af379b86a291d2053c326cdac612fa28f57052ed11ffcf
data/.coveralls.yml ADDED
@@ -0,0 +1 @@
1
+ service_name: travis-ci
data/.travis.yml CHANGED
@@ -1,12 +1,10 @@
1
1
  language: ruby
2
2
  script: rake rspec
3
3
  rvm:
4
- - ruby-head
5
4
  - 2.1.1
6
5
  - 2.0.0
7
6
  - 1.9.3
8
7
  - jruby-19mode # JRuby in 1.9 mode
9
- # - jruby-head
10
8
  notifications:
11
9
  email:
12
10
  - ndushay@stanford.edu
data/Gemfile CHANGED
@@ -2,3 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  # See harvestdor.gemspec for this gem's dependencies
4
4
  gemspec
5
+
6
+ group :test do
7
+ gem 'coveralls', require: false
8
+ end
data/README.rdoc CHANGED
@@ -1,5 +1,5 @@
1
1
  = Harvestdor
2
- {<img src="https://travis-ci.org/sul-dlss/harvestdor.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/sul-dlss/harvestdor] {<img src="https://gemnasium.com/sul-dlss/harvestdor.svg" alt="Dependency Status" />}[https://gemnasium.com/sul-dlss/harvestdor]
2
+ {<img src="https://travis-ci.org/sul-dlss/harvestdor.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/sul-dlss/harvestdor] {<img src="https://coveralls.io/repos/sul-dlss/harvestdor/badge.png" alt="Coverage Status" />}[https://coveralls.io/r/sul-dlss/harvestdor] {<img src="https://gemnasium.com/sul-dlss/harvestdor.svg" alt="Dependency Status" />}[https://gemnasium.com/sul-dlss/harvestdor] {<img src="https://badge.fury.io/rb/harvestdor.svg" alt="Gem Version" />}[http://badge.fury.io/rb/harvestdor]
3
3
 
4
4
  A Gem to harvest metadata from DOR.
5
5
 
@@ -148,6 +148,7 @@ persist this information with your app for incremental harvests
148
148
 
149
149
  == Releases
150
150
 
151
+ * <b>0.0.14</b> Bug fix for compatibility with jruby
151
152
  * <b>0.0.13</b> Updated to work with Faraday 0.9, releases via rubygems instead of sul-gems
152
153
  * <b>0.0.11</b> better error handling, and better testing for errors
153
154
  * <b>0.0.10</b> tweak specs to test that unnec fetching isn't done.
data/harvestdor.gemspec CHANGED
@@ -34,8 +34,8 @@ Gem::Specification.new do |gem|
34
34
  gem.add_development_dependency "yard"
35
35
  # tests
36
36
  gem.add_development_dependency 'rspec'
37
- gem.add_development_dependency 'simplecov'
38
- gem.add_development_dependency 'simplecov-rcov'
37
+ gem.add_development_dependency 'vcr'
38
+ gem.add_development_dependency 'webmock'
39
39
  # gem.add_development_dependency 'ruby-debug19'
40
40
 
41
41
  end
@@ -111,7 +111,7 @@ module Harvestdor
111
111
  pub_xml_ng_doc = pub_xml(object, purl_url)
112
112
  begin
113
113
  # preserve namespaces, etc for the node
114
- ng_doc = Nokogiri::XML(pub_xml_ng_doc.root.xpath('/publicObject/dc:dc', {'dc' => Harvestdor::OAI_DC_NAMESPACE}).to_xml)
114
+ ng_doc = Nokogiri::XML(pub_xml_ng_doc.root.xpath('/publicObject/dc:dc', {'dc' => Harvestdor::OAI_DC_NAMESPACE}).to_xml(:encoding => 'utf-8'))
115
115
  raise Harvestdor::Errors::MissingDC.new(object.inspect) if !ng_doc || ng_doc.children.empty?
116
116
  ng_doc
117
117
  rescue
@@ -1,3 +1,3 @@
1
1
  module Harvestdor
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.14"
3
3
  end
@@ -0,0 +1,98 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://purl-test.stanford.edu/bb375wb8869.xml
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: ''
20
+ headers:
21
+ Date:
22
+ - Mon, 28 Jul 2014 22:23:37 GMT
23
+ Server:
24
+ - Apache/2.2.15 (Red Hat)
25
+ X-Powered-By:
26
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.19
27
+ X-Ua-Compatible:
28
+ - IE=Edge
29
+ Etag:
30
+ - '"c7e2680ca3a1d497d6e46962eac8bb2d"'
31
+ Cache-Control:
32
+ - max-age=0, private, must-revalidate
33
+ X-Request-Id:
34
+ - 510a314d2ea688c5bfaff1d536204974
35
+ X-Runtime:
36
+ - '0.012861'
37
+ Status:
38
+ - '200'
39
+ Content-Length:
40
+ - '4349'
41
+ Content-Type:
42
+ - application/xml; charset=utf-8
43
+ body:
44
+ encoding: UTF-8
45
+ string: "<publicObject id=\"druid:bb375wb8869\" published=\"2012-01-26T16:39:44-08:00\">\n
46
+ \ <identityMetadata>\n <adminPolicy>druid:xs835jp8197</adminPolicy>\n <objectCreator>DOR</objectCreator>\n
47
+ \ <objectId>druid:bb375wb8869</objectId>\n <objectLabel>Kitai_bb375wb8869</objectLabel>\n
48
+ \ <objectType>item</objectType>\n <otherId name=\"uuid\">15ffc446-25f5-11e1-b6f0-0016034322e7</otherId>\n
49
+ \ <tag>Project : Kitai</tag>\n </identityMetadata>\n <contentMetadata
50
+ type=\"image\" objectId=\"bb375wb8869\">\n <resource type=\"image\" sequence=\"1\"
51
+ id=\"bb375wb8869_1\">\n <label>kitai_4</label>\n <file mimetype=\"image/jp2\"
52
+ format=\"JPEG2000\" size=\"8116154\" id=\"36105005868828_05_0001.jp2\">\n
53
+ \ <imageData height=\"6007\" width=\"7175\"/>\n <attr name=\"representation\">uncropped</attr>\n
54
+ \ </file>\n </resource>\n <resource type=\"image\" sequence=\"2\"
55
+ id=\"bb375wb8869_2\">\n <label>kitai_4</label>\n <file mimetype=\"image/jp2\"
56
+ format=\"JPEG2000\" size=\"8141860\" id=\"36105005868828_05_0002.jp2\">\n
57
+ \ <imageData height=\"6017\" width=\"7174\"/>\n <attr name=\"representation\">uncropped</attr>\n
58
+ \ </file>\n </resource>\n </contentMetadata>\n <rightsMetadata>\n
59
+ \ <access type=\"discover\">\n <machine>\n <world/>\n </machine>\n
60
+ \ </access>\n <access type=\"read\">\n <machine>\n <group>stanford</group>\n
61
+ \ </machine>\n </access>\n </rightsMetadata>\n <rdf:RDF xmlns:fedora-model=\"info:fedora/fedora-system:def/model#\"
62
+ xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:fedora=\"info:fedora/fedora-system:def/relations-external#\"
63
+ xmlns:hydra=\"http://projecthydra.org/ns/relations#\">\n <rdf:Description
64
+ rdf:about=\"info:fedora/druid:bb375wb8869\">\n </rdf:Description>\n </rdf:RDF>\n
65
+ \ <oai_dc:dc xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:srw_dc=\"info:srw/schema/1/dc-schema\"
66
+ xmlns:oai_dc=\"http://www.openarchives.org/OAI/2.0/oai_dc/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
67
+ xsi:schemaLocation=\"http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd\">\n
68
+ \ <dc:title>Kita&#x12D;</dc:title>\n <dc:title>China</dc:title>\n <dc:creator>Soviet
69
+ Union Sovetskai&#x361;a Armii&#x361;a. General&#x2B9;ny&#x12D; shtab.</dc:creator>\n
70
+ \ <dc:type>map</dc:type>\n <dc:date>1968-9999</dc:date>\n <dc:publisher>General&#x2B9;ny&#x12D;
71
+ shtab</dc:publisher>\n <dc:language>rus</dc:language>\n <dc:format>maps
72
+ : col. ; 37 x 53 cm. or smaller.</dc:format>\n <dc:format>map</dc:format>\n
73
+ \ <dc:description>Military topographic maps.</dc:description>\n <dc:description>Relief
74
+ shown by contours and spot heights. Depths shown by contours and soundings
75
+ on some sheets.</dc:description>\n <dc:description>Name of jurisdiction[s]
76
+ covered by sheet quadrangle appears in upper margin at left, e.g.: Provint&#x361;sii&#x361;a
77
+ Guandun -- Avtonomny&#x12D; ra&#x12D;on Vnutrenni&#x361;ai&#x361;a Mongolii&#x361;a,
78
+ Provint&#x361;sii Kh&#x117;b&#x117;&#x12D;, Shan&#x2B9;si. May include name
79
+ and province of neighboring country.</dc:description>\n <dc:description>Common
80
+ title precedes jurisdiction name at upper left on each sheet.</dc:description>\n
81
+ \ <dc:description>Sheets individually subtitled and numbered (with roman-alphabet
82
+ lettering) in upper margin, e.g.: Ch&#x117;nma&#x12D;, E-49-III -- Sich&#x117;n,
83
+ K-50-XXXI.</dc:description>\n <dc:description>Ed./publication date in upper
84
+ border at right, e.g.: Izdanie 1970 g. -- Izdanie 1986 g. -- Izdanie 1991
85
+ g.</dc:description>\n <dc:description>Former security classification in
86
+ upper margin at right: Sekretno.</dc:description>\n <dc:description>Includes
87
+ notes, diagrams, compilation date[s], and sheet compiler's/editor's names
88
+ in lower margin.</dc:description>\n <dc:description>Blue sheet no. in upper
89
+ margin precedes black sheet no., e.g.: 05-49-01 -- 11-50-31.</dc:description>\n
90
+ \ <dc:description>Text and ancillary map, \"Skhema gruntov,\" on verso.</dc:description>\n
91
+ \ <dc:description>In Russian.</dc:description>\n <dc:subject/>\n <dc:coverage>Scale
92
+ 1:200,000. 1 cm. to 2 km.</dc:coverage>\n <dc:coverage>116.0,27.333333
93
+ \n117.0,27.333333 \n117.0,26.666667 \n116.0,26.666667 \n116.0,27.333333\n</dc:coverage>\n
94
+ \ <dc:coverage>Pulkovo 1942</dc:coverage>\n <dc:subject>Military maps</dc:subject>\n
95
+ \ <dc:subject/>\n <dc:coverage>China</dc:coverage>\n </oai_dc:dc>\n</publicObject>\n"
96
+ http_version:
97
+ recorded_at: Mon, 28 Jul 2014 22:23:37 GMT
98
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,98 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://purl-test.stanford.edu/bb375wb8869.xml
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: ''
20
+ headers:
21
+ Date:
22
+ - Mon, 28 Jul 2014 22:26:22 GMT
23
+ Server:
24
+ - Apache/2.2.15 (Red Hat)
25
+ X-Powered-By:
26
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.19
27
+ X-Ua-Compatible:
28
+ - IE=Edge
29
+ Etag:
30
+ - '"c7e2680ca3a1d497d6e46962eac8bb2d"'
31
+ Cache-Control:
32
+ - max-age=0, private, must-revalidate
33
+ X-Request-Id:
34
+ - 494d94bd96cf627c1eff6e27957cddd6
35
+ X-Runtime:
36
+ - '0.011981'
37
+ Status:
38
+ - '200'
39
+ Content-Length:
40
+ - '4349'
41
+ Content-Type:
42
+ - application/xml; charset=utf-8
43
+ body:
44
+ encoding: UTF-8
45
+ string: "<publicObject id=\"druid:bb375wb8869\" published=\"2012-01-26T16:39:44-08:00\">\n
46
+ \ <identityMetadata>\n <adminPolicy>druid:xs835jp8197</adminPolicy>\n <objectCreator>DOR</objectCreator>\n
47
+ \ <objectId>druid:bb375wb8869</objectId>\n <objectLabel>Kitai_bb375wb8869</objectLabel>\n
48
+ \ <objectType>item</objectType>\n <otherId name=\"uuid\">15ffc446-25f5-11e1-b6f0-0016034322e7</otherId>\n
49
+ \ <tag>Project : Kitai</tag>\n </identityMetadata>\n <contentMetadata
50
+ type=\"image\" objectId=\"bb375wb8869\">\n <resource type=\"image\" sequence=\"1\"
51
+ id=\"bb375wb8869_1\">\n <label>kitai_4</label>\n <file mimetype=\"image/jp2\"
52
+ format=\"JPEG2000\" size=\"8116154\" id=\"36105005868828_05_0001.jp2\">\n
53
+ \ <imageData height=\"6007\" width=\"7175\"/>\n <attr name=\"representation\">uncropped</attr>\n
54
+ \ </file>\n </resource>\n <resource type=\"image\" sequence=\"2\"
55
+ id=\"bb375wb8869_2\">\n <label>kitai_4</label>\n <file mimetype=\"image/jp2\"
56
+ format=\"JPEG2000\" size=\"8141860\" id=\"36105005868828_05_0002.jp2\">\n
57
+ \ <imageData height=\"6017\" width=\"7174\"/>\n <attr name=\"representation\">uncropped</attr>\n
58
+ \ </file>\n </resource>\n </contentMetadata>\n <rightsMetadata>\n
59
+ \ <access type=\"discover\">\n <machine>\n <world/>\n </machine>\n
60
+ \ </access>\n <access type=\"read\">\n <machine>\n <group>stanford</group>\n
61
+ \ </machine>\n </access>\n </rightsMetadata>\n <rdf:RDF xmlns:fedora-model=\"info:fedora/fedora-system:def/model#\"
62
+ xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:fedora=\"info:fedora/fedora-system:def/relations-external#\"
63
+ xmlns:hydra=\"http://projecthydra.org/ns/relations#\">\n <rdf:Description
64
+ rdf:about=\"info:fedora/druid:bb375wb8869\">\n </rdf:Description>\n </rdf:RDF>\n
65
+ \ <oai_dc:dc xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:srw_dc=\"info:srw/schema/1/dc-schema\"
66
+ xmlns:oai_dc=\"http://www.openarchives.org/OAI/2.0/oai_dc/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
67
+ xsi:schemaLocation=\"http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd\">\n
68
+ \ <dc:title>Kita&#x12D;</dc:title>\n <dc:title>China</dc:title>\n <dc:creator>Soviet
69
+ Union Sovetskai&#x361;a Armii&#x361;a. General&#x2B9;ny&#x12D; shtab.</dc:creator>\n
70
+ \ <dc:type>map</dc:type>\n <dc:date>1968-9999</dc:date>\n <dc:publisher>General&#x2B9;ny&#x12D;
71
+ shtab</dc:publisher>\n <dc:language>rus</dc:language>\n <dc:format>maps
72
+ : col. ; 37 x 53 cm. or smaller.</dc:format>\n <dc:format>map</dc:format>\n
73
+ \ <dc:description>Military topographic maps.</dc:description>\n <dc:description>Relief
74
+ shown by contours and spot heights. Depths shown by contours and soundings
75
+ on some sheets.</dc:description>\n <dc:description>Name of jurisdiction[s]
76
+ covered by sheet quadrangle appears in upper margin at left, e.g.: Provint&#x361;sii&#x361;a
77
+ Guandun -- Avtonomny&#x12D; ra&#x12D;on Vnutrenni&#x361;ai&#x361;a Mongolii&#x361;a,
78
+ Provint&#x361;sii Kh&#x117;b&#x117;&#x12D;, Shan&#x2B9;si. May include name
79
+ and province of neighboring country.</dc:description>\n <dc:description>Common
80
+ title precedes jurisdiction name at upper left on each sheet.</dc:description>\n
81
+ \ <dc:description>Sheets individually subtitled and numbered (with roman-alphabet
82
+ lettering) in upper margin, e.g.: Ch&#x117;nma&#x12D;, E-49-III -- Sich&#x117;n,
83
+ K-50-XXXI.</dc:description>\n <dc:description>Ed./publication date in upper
84
+ border at right, e.g.: Izdanie 1970 g. -- Izdanie 1986 g. -- Izdanie 1991
85
+ g.</dc:description>\n <dc:description>Former security classification in
86
+ upper margin at right: Sekretno.</dc:description>\n <dc:description>Includes
87
+ notes, diagrams, compilation date[s], and sheet compiler's/editor's names
88
+ in lower margin.</dc:description>\n <dc:description>Blue sheet no. in upper
89
+ margin precedes black sheet no., e.g.: 05-49-01 -- 11-50-31.</dc:description>\n
90
+ \ <dc:description>Text and ancillary map, \"Skhema gruntov,\" on verso.</dc:description>\n
91
+ \ <dc:description>In Russian.</dc:description>\n <dc:subject/>\n <dc:coverage>Scale
92
+ 1:200,000. 1 cm. to 2 km.</dc:coverage>\n <dc:coverage>116.0,27.333333
93
+ \n117.0,27.333333 \n117.0,26.666667 \n116.0,26.666667 \n116.0,27.333333\n</dc:coverage>\n
94
+ \ <dc:coverage>Pulkovo 1942</dc:coverage>\n <dc:subject>Military maps</dc:subject>\n
95
+ \ <dc:subject/>\n <dc:coverage>China</dc:coverage>\n </oai_dc:dc>\n</publicObject>\n"
96
+ http_version:
97
+ recorded_at: Mon, 28 Jul 2014 22:26:22 GMT
98
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,42 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://dor-oaiprovider-test.stanford.edu/oai?metadataPrefix=mods&set=is_governed_by_hy787xj5878&verb=ListIdentifiers
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.0
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Date:
22
+ - Mon, 28 Jul 2014 22:02:50 GMT
23
+ Server:
24
+ - Apache/2.2.15 (Red Hat)
25
+ X-Content-Type-Options:
26
+ - nosniff
27
+ X-Powered-By:
28
+ - Phusion Passenger 4.0.10
29
+ Content-Length:
30
+ - '1402'
31
+ Status:
32
+ - 200 OK
33
+ Content-Type:
34
+ - application/xml;charset=utf-8
35
+ body:
36
+ encoding: UTF-8
37
+ string: |-
38
+ <?xml version="1.0" encoding="UTF-8" ?>
39
+ <?xml-stylesheet type="text/xsl" href="https://dor-oaiprovider-test.stanford.edu/oai2.xsl" ?><OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd"><responseDate>2014-07-28T22:02:50Z</responseDate><request metadataPrefix="mods" set="is_governed_by_hy787xj5878" verb="ListIdentifiers">https://dor-oaiprovider-test.stanford.edu/oai</request><ListIdentifiers><header><identifier>oai:searchworks.stanford.edu/druid:jt959wc5586</identifier><datestamp>2012-02-27T23:11:50Z</datestamp><setSpec>is_member_of_jh957jy1101</setSpec><setSpec>is_member_of_collection_jh957jy1101</setSpec><setSpec>is_governed_by_hy787xj5878</setSpec></header><header><identifier>oai:searchworks.stanford.edu/druid:pd817cv1860</identifier><datestamp>2012-03-28T21:25:56Z</datestamp><setSpec>is_member_of_jh957jy1101</setSpec><setSpec>is_member_of_collection_jh957jy1101</setSpec><setSpec>is_governed_by_hy787xj5878</setSpec></header><header><identifier>oai:searchworks.stanford.edu/druid:qk487nd2690</identifier><datestamp>2013-05-22T23:38:57Z</datestamp><setSpec>is_member_of_jh957jy1101</setSpec><setSpec>is_member_of_collection_jh957jy1101</setSpec><setSpec>is_governed_by_hy787xj5878</setSpec></header></ListIdentifiers></OAI-PMH>
40
+ http_version:
41
+ recorded_at: Mon, 28 Jul 2014 22:02:50 GMT
42
+ recorded_with: VCR 2.9.2