harvestdor 0.3.1 → 0.3.2

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
- SHA1:
3
- metadata.gz: d6cae2e27c9d43283887f19fe9e9e7eba17461fb
4
- data.tar.gz: 81afa857d8f042fbecdcf32e68fe31b5bfc7f2a4
2
+ SHA256:
3
+ metadata.gz: d94db1129fe0036bed16d1d9f97054cc0c6cb986a3ae91ad714d3a28d77eaff0
4
+ data.tar.gz: ef5514a943b899b496023423835edbb1d1c1c6e68fe6affe520b5c6065410d86
5
5
  SHA512:
6
- metadata.gz: e88f3d8c26d357a775a6e32d73d01c6339cb264f3cc70ab338011553b62fb4bf5d8c5232e1d62cc822422614240882257a796f1d48d95822db7738d3e1e3513a
7
- data.tar.gz: 1d6a8823f21a15003f4a558700d600c8f55bdd799eaa43f581af2dc73cb35545593d27717527e964736818e76b2eb1992016a84d1aba034c4ccffaf91df4d6cb
6
+ metadata.gz: fd4d31e7a52f7d6b69bf84adbf26cadf248489eaaf6a74d558f8a6d65154d74589485fcec51b75c5cc9a1b12718f9af8b6465875df935d962a0e37377408f84e
7
+ data.tar.gz: 2cbcadd20302319b40a42e90e0050f93a0682efd2f494d328148807184d0e161b283520d13bc97ad7c5e886d05de506e9426e2116b173058689e51a6d932f90e
@@ -1,9 +1,19 @@
1
+ dist: xenial
1
2
  language: ruby
2
3
  script: rake rspec
3
4
  sudo: false
4
5
  rvm:
5
- - 2.3.1
6
+ - 2.7.0
7
+
6
8
  notifications:
7
- email:
8
- - laneymcg@stanford.edu
9
- - cbeer@stanford.edu
9
+ email: false
10
+ env:
11
+ global:
12
+ - CC_TEST_REPORTER_ID=533e2edef1885c87092961c61576c5723296cabda9e1be7b62d7afe95f5e7bcd
13
+
14
+ before_script:
15
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
16
+ - chmod +x ./cc-test-reporter
17
+ - ./cc-test-reporter before-build
18
+ after_script:
19
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
@@ -1,10 +1,12 @@
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://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]
1
+ # Harvestdor
2
+ [![Build Status](https://travis-ci.org/sul-dlss/harvestdor.svg?branch=master)](https://travis-ci.org/sul-dlss/harvestdor)
3
+ [![Code Climate Test Coverage](https://codeclimate.com/github/sul-dlss/harvestdor/badges/coverage.svg)](https://codeclimate.com/github/sul-dlss/harvestdor/coverage)
4
+ [![Gem Version](https://badge.fury.io/rb/harvestdor.svg)](https://badge.fury.io/rb/harvestdor)
3
5
 
4
6
  A Gem to harvest data from a Stanford Purl page, with convenience methods for
5
7
  getting Nokogiri::XML::Document and errors when pieces are missing
6
8
 
7
- == Installation
9
+ ## Installation
8
10
 
9
11
  Add this line to your application's Gemfile:
10
12
 
@@ -18,11 +20,11 @@ Or install it yourself as:
18
20
 
19
21
  $ gem install harvestdor
20
22
 
21
- == Usage
23
+ ## Usage
22
24
 
23
- === Configuration
25
+ ### Configuration
24
26
 
25
- ==== Possible configuration options (with default values unless otherwise indicated)
27
+ #### Possible configuration options (with default values unless otherwise indicated)
26
28
 
27
29
  client = Harvestdor::Client.new({ # Example with all possible options
28
30
  :log_dir => File.join(File.dirname(__FILE__), "..", "logs"),
@@ -30,26 +32,26 @@ Or install it yourself as:
30
32
  :purl => 'https://purl.stanford.edu'
31
33
  })
32
34
 
33
- ==== Option 1: use a yaml file
35
+ #### Option 1: use a yaml file
34
36
 
35
37
  for contents of yml -- see spec/config/example.yml
36
38
 
37
39
  client = Harvestdor::Client.new({:config_yml_path => path_to_my_yml})
38
40
  client.mods('oo111oo2222')
39
41
 
40
- ==== Option 2: pass in non-default configurations as a hash
42
+ #### Option 2: pass in non-default configurations as a hash
41
43
 
42
44
  client = Harvestdor::Client.new({:purl => 'https://my_purl.org'})
43
45
  client.mods('oo111oo2222')
44
46
 
45
- ==== Option 3: set the attributes explicitly in your code
47
+ #### Option 3: set the attributes explicitly in your code
46
48
 
47
49
  client = Harvestdor::Client.new
48
50
  client.config.purl = 'https://my_purl.org'
49
51
  client.mods('oo111oo2222')
50
52
 
51
53
 
52
- === XML from PURL pages
54
+ ### XML from PURL pages
53
55
 
54
56
  You can get, for example, the contentMetadata for a druid:
55
57
 
@@ -70,13 +72,13 @@ Or the MODS metadata:
70
72
  end
71
73
 
72
74
  Similarly for
73
- # mods
74
- # public_xml (all of it)
75
- # content_metadata
76
- # identity_metadata
77
- # rights_metadata
78
- # rdf
79
- # dc
75
+ - mods
76
+ - public_xml (all of it)
77
+ - content_metadata
78
+ - identity_metadata
79
+ - rights_metadata
80
+ - rdf
81
+ - dc
80
82
 
81
83
  You can also do this from a Harvestdor::Client object, and it will use the purl from the Client.config:
82
84
 
@@ -84,16 +86,16 @@ You can also do this from a Harvestdor::Client object, and it will use the purl
84
86
  client.identity_metadata('bb375wb8869')
85
87
 
86
88
 
87
- == Contributing
89
+ ## Contributing
88
90
 
89
- # Fork it
90
- # Create your feature branch (`git checkout -b my-new-feature`)
91
- # Write code and tests.
92
- # Commit your changes (`git commit -am 'Added some feature'`)
93
- # Push to the branch (`git push origin my-new-feature`)
94
- # Create new Pull Request
91
+ - Fork it
92
+ - Create your feature branch (`git checkout -b my-new-feature`)
93
+ - Write code and tests.
94
+ - Commit your changes (`git commit -am 'Added some feature'`)
95
+ - Push to the branch (`git push origin my-new-feature`)
96
+ - Create new Pull Request
95
97
 
96
- == Releases
98
+ ## Releases
97
99
 
98
100
  * <b>0.0.14</b> Bug fix for compatibility with jruby
99
101
  * <b>0.0.13</b> Updated to work with Faraday 0.9, releases via rubygems instead of sul-gems
@@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
19
19
 
20
20
  gem.add_dependency 'confstruct'
21
21
  gem.add_dependency 'nokogiri'
22
- gem.add_dependency 'faraday'
22
+ gem.add_dependency 'faraday', '~> 1'
23
23
  gem.add_dependency 'net-http-persistent'
24
24
 
25
25
  # Development dependencies
@@ -29,9 +29,9 @@ Gem::Specification.new do |gem|
29
29
  gem.add_development_dependency "yard"
30
30
  # tests
31
31
  gem.add_development_dependency 'rspec'
32
- gem.add_development_dependency 'coveralls'
33
32
  gem.add_development_dependency 'rubocop'
34
33
  gem.add_development_dependency 'rubocop-rspec'
34
+ gem.add_development_dependency 'simplecov'
35
35
  gem.add_development_dependency 'vcr'
36
36
  gem.add_development_dependency 'webmock'
37
37
  end
@@ -15,7 +15,7 @@ module Harvestdor
15
15
  def self.mods druid, purl_url = Harvestdor::PURL_DEFAULT
16
16
  begin
17
17
  Nokogiri::XML(http_client.get("#{purl_url}/#{druid}.mods").body,nil,'UTF-8')
18
- rescue Faraday::Error::ClientError
18
+ rescue Faraday::ClientError
19
19
  raise Harvestdor::Errors::MissingMods.new(druid)
20
20
  end
21
21
  end
@@ -30,7 +30,7 @@ module Harvestdor
30
30
  ng_doc = Nokogiri::XML(http_client.get("#{purl_url}/#{druid}.xml").body)
31
31
  raise Harvestdor::Errors::MissingPublicXml.new(druid) if !ng_doc || ng_doc.children.empty?
32
32
  ng_doc
33
- rescue Faraday::Error::ClientError
33
+ rescue Faraday::ClientError
34
34
  raise Harvestdor::Errors::MissingPurlPage.new(druid)
35
35
  end
36
36
  end
@@ -147,9 +147,9 @@ module Harvestdor
147
147
  interval: 0.05,
148
148
  interval_randomness: 0.5,
149
149
  backoff_factor: 2,
150
- exceptions: ['Errno::ECONNRESET', 'Errno::ETIMEDOUT', 'Timeout::Error', 'Faraday::Error::TimeoutError', 'Faraday::Error::ConnectionFailed']
150
+ exceptions: ['Errno::ECONNRESET', 'Errno::ETIMEDOUT', 'Timeout::Error', 'Faraday::TimeoutError', 'Faraday::ConnectionFailed']
151
151
  end
152
152
  end
153
153
  private_class_method :http_client
154
154
 
155
- end # module Harvestdor
155
+ end # module Harvestdor
@@ -1,3 +1,3 @@
1
1
  module Harvestdor
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -1,5 +1,5 @@
1
- require 'coveralls'
2
- Coveralls.wear!
1
+ require 'simplecov'
2
+ SimpleCov.start
3
3
 
4
4
  require 'vcr'
5
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: harvestdor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naomi Dushay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-20 00:00:00.000000000 Z
11
+ date: 2020-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: confstruct
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: faraday
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '1'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: net-http-persistent
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -123,7 +123,7 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: coveralls
126
+ name: rubocop
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
@@ -137,7 +137,7 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: rubocop
140
+ name: rubocop-rspec
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - ">="
@@ -151,7 +151,7 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
- name: rubocop-rspec
154
+ name: simplecov
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - ">="
@@ -199,7 +199,6 @@ executables: []
199
199
  extensions: []
200
200
  extra_rdoc_files: []
201
201
  files:
202
- - ".coveralls.yml"
203
202
  - ".gitignore"
204
203
  - ".hound.yml"
205
204
  - ".rubocop.yml"
@@ -208,7 +207,7 @@ files:
208
207
  - ".yardopts"
209
208
  - Gemfile
210
209
  - LICENSE.txt
211
- - README.rdoc
210
+ - README.md
212
211
  - Rakefile
213
212
  - harvestdor.gemspec
214
213
  - lib/harvestdor.rb
@@ -246,8 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
245
  - !ruby/object:Gem::Version
247
246
  version: '0'
248
247
  requirements: []
249
- rubyforge_project:
250
- rubygems_version: 2.5.1
248
+ rubygems_version: 3.1.2
251
249
  signing_key:
252
250
  specification_version: 4
253
251
  summary: Harvest DOR object metadata
@@ -1 +0,0 @@
1
- service_name: travis-ci