hydra-derivatives 3.4.1 → 3.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +5 -4
- data/CODE_OF_CONDUCT.md +36 -0
- data/CONTRIBUTING.md +23 -21
- data/README.md +34 -3
- data/SUPPORT.md +5 -0
- data/VERSION +1 -1
- data/hydra-derivatives.gemspec +1 -1
- data/lib/hydra/derivatives/processors/full_text.rb +13 -6
- data/lib/hydra/derivatives/processors/shell_based_processor.rb +5 -3
- data/spec/processors/full_text_spec.rb +42 -5
- data/spec/processors/shell_based_processor_spec.rb +9 -0
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 47fbc2bf8a041e266066dac9b4735ef653ab669e373e475c976e36615ce98f09
|
4
|
+
data.tar.gz: ee2435c0b1cd2aebc7b274b92e4280a4c68f493e0c2665b3dfce3b1b363acfaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8adf3f99d52e6b8f21597a2d022fd3f9f1c5c0b319c9ebfb68ae91202db3b61531aea12169fd5bc4fd9602fa8fcfe2d7bc3486c097b704e8575e5b22c2b44c1a
|
7
|
+
data.tar.gz: 92c5704c75bd8cbff6f2b10f8a238cf60da0e2d9c914396c148152cf8d7c55c61b5799f97abaec5d6401b86ac94a26810aed4ae6c965f21d19695faecea20ef0
|
data/.travis.yml
CHANGED
@@ -5,9 +5,10 @@ before_install:
|
|
5
5
|
- gem update --system
|
6
6
|
- gem install bundler
|
7
7
|
rvm:
|
8
|
-
- 2.
|
9
|
-
- 2.
|
10
|
-
- 2.
|
8
|
+
- 2.3.8
|
9
|
+
- 2.4.5
|
10
|
+
- 2.5.3
|
11
|
+
- 2.6.0
|
11
12
|
env:
|
12
13
|
global:
|
13
14
|
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
@@ -35,4 +36,4 @@ addons:
|
|
35
36
|
- libpng-dev
|
36
37
|
- imagemagick
|
37
38
|
- ffmpeg
|
38
|
-
- libreoffice
|
39
|
+
- libreoffice
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
The Samvera community is dedicated to providing a welcoming and
|
2
|
+
positive experience for all its members, whether they are at a formal
|
3
|
+
gathering, in a social setting, or taking part in activities online.
|
4
|
+
The Samvera community welcomes participation from people all over the
|
5
|
+
world and these members bring with them a wide variety of
|
6
|
+
professional, personal and social backgrounds; whatever these may be,
|
7
|
+
we treat colleagues with dignity and respect.
|
8
|
+
|
9
|
+
Community members communicate primarily in English, though for many of
|
10
|
+
them this is not their native language. We therefore strive to express
|
11
|
+
ourselves simply and clearly remembering that unnecessary use of
|
12
|
+
jargon and slang will be a barrier to understanding for many of our
|
13
|
+
colleagues. We are sensitive to the fact that the international
|
14
|
+
nature of the community means that we span many different social norms
|
15
|
+
around language and behaviour and we strive to conduct ourselves,
|
16
|
+
online and in person, in ways that are unlikely to cause offence.
|
17
|
+
|
18
|
+
Samvera conversations are often information-rich and intended to
|
19
|
+
generate discussion and debate. We discuss ideas from a standpoint of
|
20
|
+
mutual respect and reasoned argument.
|
21
|
+
|
22
|
+
Community members work together to promote a respectful and safe
|
23
|
+
community. In the event that someone’s conduct is causing offence or
|
24
|
+
distress, Samvera has a detailed
|
25
|
+
[Anti-Harassment Policy and Protocol](https://wiki.duraspace.org/display/samvera/Anti-Harassment+Policy)
|
26
|
+
which can be applied to address the problem. The first step in dealing
|
27
|
+
with any serious misconduct is to contact a local meeting organizer,
|
28
|
+
the
|
29
|
+
[Samvera community helpers](https://wiki.duraspace.org/display/samvera/Samvera+Community+Helpers)
|
30
|
+
([email](mailto:helpers@samvera.org)), a community member you
|
31
|
+
trust, or the
|
32
|
+
[Samvera Steering Group](https://wiki.duraspace.org/display/samvera/Samvera+Steering+Group+membership)
|
33
|
+
immediately; at Samvera events, these people can be identified by
|
34
|
+
distinctive name badges. The
|
35
|
+
[Policy and Protocol](https://wiki.duraspace.org/display/samvera/Anti-Harassment+Policy)
|
36
|
+
should be consulted for fuller details.
|
data/CONTRIBUTING.md
CHANGED
@@ -1,21 +1,24 @@
|
|
1
1
|
# How to Contribute
|
2
2
|
|
3
|
-
We want your help to make
|
4
|
-
|
3
|
+
We want your help to make the Samvera community great. There are a few guidelines
|
4
|
+
that we need contributors to follow so that we can have a chance of
|
5
|
+
keeping on top of things.
|
5
6
|
|
6
7
|
## Code of Conduct
|
7
8
|
|
8
|
-
The
|
9
|
-
members, whether they are at a formal gathering, in
|
10
|
-
online.
|
11
|
-
for more information.
|
9
|
+
The Samvera Community is dedicated to providing a welcoming and positive
|
10
|
+
experience for all its members, whether they are at a formal gathering, in
|
11
|
+
a social setting, or taking part in activities online. Please see our
|
12
|
+
[Code of Conduct](CODE_OF_CONDUCT.md) for more information.
|
12
13
|
|
13
|
-
##
|
14
|
+
## Samvera Community Intellectual Property Licensing and Ownership
|
14
15
|
|
15
|
-
All code contributors must have an Individual Contributor License Agreement
|
16
|
-
|
16
|
+
All code contributors must have an Individual Contributor License Agreement
|
17
|
+
(iCLA) on file with the Samvera Steering Group. If the contributor works for
|
18
|
+
an institution, the institution must have a Corporate Contributor License
|
19
|
+
Agreement (cCLA) on file.
|
17
20
|
|
18
|
-
https://wiki.duraspace.org/display/
|
21
|
+
https://wiki.duraspace.org/display/samvera/Samvera+Community+Intellectual+Property+Licensing+and+Ownership
|
19
22
|
|
20
23
|
You should also add yourself to the `CONTRIBUTORS.md` file in the root of the project.
|
21
24
|
|
@@ -31,7 +34,7 @@ You should also add yourself to the `CONTRIBUTORS.md` file in the root of the pr
|
|
31
34
|
### Reporting Issues
|
32
35
|
|
33
36
|
* Make sure you have a [GitHub account](https://github.com/signup/free)
|
34
|
-
* Submit a [Github issue](
|
37
|
+
* Submit a [Github issue](https://github.com/samvera/hydra-derivatives/issues/) by:
|
35
38
|
* Clearly describing the issue
|
36
39
|
* Provide a descriptive summary
|
37
40
|
* Explain the expected behavior
|
@@ -48,7 +51,7 @@ You should also add yourself to the `CONTRIBUTORS.md` file in the root of the pr
|
|
48
51
|
* Please avoid working directly on the `master` branch.
|
49
52
|
* You may find the [hub suite of commands](https://github.com/defunkt/hub) helpful
|
50
53
|
* Make sure you have added sufficient tests and documentation for your changes.
|
51
|
-
* Test functionality with RSpec;
|
54
|
+
* Test functionality with RSpec; Test features / UI with Capybara.
|
52
55
|
* Run _all_ the tests to assure nothing else was accidentally broken.
|
53
56
|
|
54
57
|
### Documenting Code
|
@@ -60,15 +63,11 @@ You should also add yourself to the `CONTRIBUTORS.md` file in the root of the pr
|
|
60
63
|
* If you don't know exactly what a bit of code does, it is extra likely that it needs to be documented. Take a stab at it and ask for feedback in your pull request. You can use the 'blame' button on GitHub to identify the original developer of the code and @mention them in your comment.
|
61
64
|
* This work greatly increases the usability of the code base and supports the on-ramping of new committers.
|
62
65
|
* We will all be understanding of one another's time constraints in this area.
|
63
|
-
* YARD examples:
|
64
|
-
* [Hydra::Works::RemoveGenericFile](https://github.com/projecthydra-labs/hydra-works/blob/master/lib/hydra/works/services/generic_work/remove_generic_file.rb)
|
65
|
-
* [ActiveTriples::LocalName::Minter](https://github.com/ActiveTriples/active_triples-local_name/blob/master/lib/active_triples/local_name/minter.rb)
|
66
66
|
* [Getting started with YARD](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md)
|
67
67
|
|
68
68
|
### Committing changes
|
69
69
|
|
70
70
|
* Make commits of logical units.
|
71
|
-
* Your commit should include a high level description of your work in HISTORY.textile
|
72
71
|
* Check for unnecessary whitespace with `git diff --check` before committing.
|
73
72
|
* Make sure your commit messages are [well formed](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
|
74
73
|
* If you created an issue, you can close it by including "Closes #issue" in your commit message. See [Github's blog post for more details](https://github.com/blog/1386-closing-issues-via-commit-messages)
|
@@ -103,6 +102,10 @@ You should also add yourself to the `CONTRIBUTORS.md` file in the root of the pr
|
|
103
102
|
long to fit in 72 characters
|
104
103
|
```
|
105
104
|
|
105
|
+
* Make sure you have added the necessary tests for your changes.
|
106
|
+
* Run _all_ the tests to assure nothing else was accidentally broken.
|
107
|
+
* When you are ready to submit a pull request
|
108
|
+
|
106
109
|
### Submitting Changes
|
107
110
|
|
108
111
|
* Read the article ["Using Pull Requests"](https://help.github.com/articles/using-pull-requests) on GitHub.
|
@@ -125,9 +128,7 @@ We adopted [Github's Pull Request Review](https://help.github.com/articles/about
|
|
125
128
|
Common checks that may occur in our repositories:
|
126
129
|
|
127
130
|
1. Travis CI - where our automated tests are running
|
128
|
-
2.
|
129
|
-
3. Approval Required - Github enforces at least one person approve a pull request. Also, all reviewers that have chimed in must approve.
|
130
|
-
4. CodeClimate - is our code remaining healthy (at least according to static code analysis)
|
131
|
+
2. Approval Required - Github enforces at least one person approve a pull request. Also, all reviewers that have chimed in must approve.
|
131
132
|
|
132
133
|
If one or more of the required checks failed (or are incomplete), the code should not be merged (and the UI will not allow it). If all of the checks have passed, then anyone on the project (including the pull request submitter) may merge the code.
|
133
134
|
|
@@ -144,16 +145,17 @@ First, the person contributing the code is putting themselves out there. Be mind
|
|
144
145
|
This is your chance for a mentoring moment of another developer. Take time to give an honest and thorough review of what has changed. Things to consider:
|
145
146
|
|
146
147
|
* Does the commit message explain what is going on?
|
147
|
-
* Does the code changes have tests? _Not all changes need new tests, some changes are
|
148
|
+
* Does the code changes have tests? _Not all changes need new tests, some changes are refactorings_
|
148
149
|
* Do new or changed methods, modules, and classes have documentation?
|
149
150
|
* Does the commit contain more than it should? Are two separate concerns being addressed in one commit?
|
150
151
|
* Does the description of the new/changed specs match your understanding of what the spec is doing?
|
152
|
+
* Did the Travis tests complete successfully?
|
151
153
|
|
152
154
|
If you are uncertain, bring other contributors into the conversation by assigning them as a reviewer.
|
153
155
|
|
154
156
|
# Additional Resources
|
155
157
|
|
156
158
|
* [General GitHub documentation](http://help.github.com/)
|
157
|
-
* [GitHub pull request documentation](
|
159
|
+
* [GitHub pull request documentation](https://help.github.com/articles/about-pull-requests/)
|
158
160
|
* [Pro Git](http://git-scm.com/book) is both a free and excellent book about Git.
|
159
161
|
* [A Git Config for Contributing](http://ndlib.github.io/practices/my-typical-per-project-git-config/)
|
data/README.md
CHANGED
@@ -1,12 +1,36 @@
|
|
1
1
|
# hydra-derivatives
|
2
2
|
|
3
|
+
Code:
|
3
4
|
[![Version](https://badge.fury.io/rb/hydra-derivatives.png)](http://badge.fury.io/rb/hydra-derivatives)
|
4
|
-
[![Build Status](https://travis-ci.org/
|
5
|
-
[![
|
6
|
-
|
5
|
+
[![Build Status](https://travis-ci.org/samvera/hydra-derivatives.png?branch=master)](https://travis-ci.org/samvera/hydra-derivatives)
|
6
|
+
[![Coverage Status](https://coveralls.io/repos/github/samvera/hydra-derivatives/badge.svg?branch=master)](https://coveralls.io/github/samvera/hydra-derivatives?branch=master)
|
7
|
+
|
8
|
+
Docs:
|
9
|
+
[![Contribution Guidelines](http://img.shields.io/badge/CONTRIBUTING-Guidelines-blue.svg)](./CONTRIBUTING.md)
|
10
|
+
[![Apache 2.0 License](http://img.shields.io/badge/APACHE2-license-blue.svg)](./LICENSE.txt)
|
11
|
+
|
12
|
+
Jump In: [![Slack Status](http://slack.samvera.org/badge.svg)](http://slack.samvera.org/)
|
13
|
+
|
14
|
+
# What is hydra-derivatives?
|
7
15
|
|
8
16
|
Derivative generation for hydra
|
9
17
|
|
18
|
+
## Product Owner & Maintenance
|
19
|
+
|
20
|
+
**hydra-derivatives** is a Core Component of the Samvera community. The documentation for
|
21
|
+
what this means can be found
|
22
|
+
[here](http://samvera.github.io/core_components.html#requirements-for-a-core-component).
|
23
|
+
|
24
|
+
### Product Owner
|
25
|
+
|
26
|
+
[jenlindner](https://github.com/jenlindner)
|
27
|
+
|
28
|
+
# Help
|
29
|
+
|
30
|
+
The Samvera community is here to help. Please see our [support guide](./SUPPORT.md).
|
31
|
+
|
32
|
+
# Getting Started
|
33
|
+
|
10
34
|
If you have an ActiveFedora class like this:
|
11
35
|
```ruby
|
12
36
|
class GenericFile < ActiveFedora::Base
|
@@ -188,3 +212,10 @@ Instead, each directive may contain these arguments:
|
|
188
212
|
* `:layers` (Integer) : The number of quality layers. Default: 8
|
189
213
|
* `:compression` (Integer) : The left number of the compression ratio `n:1`, e.g. 12 will apply 12:1 compression. Default: 10.
|
190
214
|
* `:tile_size` (Integer) : Pixel dimension of the tiles. Default: 1024
|
215
|
+
|
216
|
+
# Acknowledgments
|
217
|
+
|
218
|
+
This software has been developed by and is brought to you by the Samvera community. Learn more at the
|
219
|
+
[Samvera website](http://samvera.org/).
|
220
|
+
|
221
|
+
![Samvera Logo](https://wiki.duraspace.org/download/thumbnails/87459292/samvera-fall-font2-200w.png?version=1&modificationDate=1498550535816&api=v2)
|
data/SUPPORT.md
ADDED
@@ -0,0 +1,5 @@
|
|
1
|
+
If you would like to report an issue, first search [the list of issues](https://github.com/samvera/hydra-derivatives/issues/) to see if someone else has already reported it, and then feel free to [create a new issue](https://github.com/samvera/hydra-derivatives/issues/new).
|
2
|
+
|
3
|
+
If you have questions or need help, please email [the Samvera community tech list](https://groups.google.com/forum/#!forum/samvera-tech) or stop by the #dev channel in [the Samvera community Slack team](https://wiki.duraspace.org/pages/viewpage.action?pageId=87460391#Getintouch!-Slack).
|
4
|
+
|
5
|
+
You can learn more about the various Samvera communication channels on the [Get in touch!](https://wiki.duraspace.org/pages/viewpage.action?pageId=87460391) wiki page.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.4.
|
1
|
+
3.4.2
|
data/hydra-derivatives.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
16
16
|
spec.require_paths = ["lib"]
|
17
17
|
|
18
|
-
spec.add_development_dependency 'bundler', '~>
|
18
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
19
19
|
spec.add_development_dependency 'fcrepo_wrapper', '~> 0.2'
|
20
20
|
spec.add_development_dependency 'rake', '~> 10.1'
|
21
21
|
spec.add_development_dependency 'rspec', '~> 3.1'
|
@@ -22,16 +22,23 @@ module Hydra::Derivatives::Processors
|
|
22
22
|
# TODO: this pulls the whole file into memory. We should stream it from Fedora instead
|
23
23
|
# @return [String] the result of calling the extract service
|
24
24
|
def fetch
|
25
|
-
|
26
|
-
req.use_ssl = true if check_for_ssl
|
27
|
-
resp = req.post(uri.to_s, file_content, request_headers)
|
25
|
+
resp = http_request
|
28
26
|
raise "Solr Extract service was unsuccessful. '#{uri}' returned code #{resp.code} for #{source_path}\n#{resp.body}" unless resp.code == '200'
|
29
27
|
file_content.rewind if file_content.respond_to?(:rewind)
|
28
|
+
resp.body.force_encoding(resp.type_params['charset']) if resp.type_params['charset']
|
29
|
+
resp.body
|
30
|
+
end
|
30
31
|
|
31
|
-
|
32
|
-
|
32
|
+
# Send the request to the extract service
|
33
|
+
# @return [Net::HttpResponse] the result of calling the extract service
|
34
|
+
def http_request
|
35
|
+
Net::HTTP.start(uri.host, uri.port) do |http|
|
36
|
+
req = Net::HTTP::Post.new(uri.request_uri, request_headers)
|
37
|
+
req.use_ssl = true if check_for_ssl
|
38
|
+
req.basic_auth uri.user, uri.password unless uri.password.nil?
|
39
|
+
req.body = file_content
|
40
|
+
http.request req
|
33
41
|
end
|
34
|
-
resp.body
|
35
42
|
end
|
36
43
|
|
37
44
|
def file_content
|
@@ -62,9 +62,8 @@ module Hydra::Derivatives::Processors
|
|
62
62
|
err_str = ''
|
63
63
|
stdin, stdout, stderr, wait_thr = popen3(command)
|
64
64
|
context[:pid] = wait_thr[:pid]
|
65
|
+
files = [stderr, stdout]
|
65
66
|
stdin.close
|
66
|
-
stdout.close
|
67
|
-
files = [stderr]
|
68
67
|
|
69
68
|
until all_eof?(files)
|
70
69
|
ready = IO.select(files, nil, nil, 60)
|
@@ -82,11 +81,14 @@ module Hydra::Derivatives::Processors
|
|
82
81
|
err_str << data
|
83
82
|
end
|
84
83
|
rescue EOFError
|
85
|
-
|
84
|
+
Hydra::Derivatives::Logger.debug "Caught an eof error in ShellBasedProcessor"
|
86
85
|
# No big deal.
|
87
86
|
end
|
88
87
|
end
|
89
88
|
end
|
89
|
+
|
90
|
+
stdout.close
|
91
|
+
stderr.close
|
90
92
|
exit_status = wait_thr.value
|
91
93
|
|
92
94
|
raise "Unable to execute command \"#{command}\". Exit code: #{exit_status}\nError message: #{err_str}" unless exit_status.success?
|
@@ -18,13 +18,17 @@ describe Hydra::Derivatives::Processors::FullText do
|
|
18
18
|
describe "fetch" do
|
19
19
|
subject { processor.send(:fetch) }
|
20
20
|
|
21
|
-
let(:request) { double }
|
22
21
|
let(:response_body) { 'returned by Solr' }
|
23
22
|
let(:uri) { URI('https://example.com:99/solr/update') }
|
23
|
+
let(:req) do
|
24
|
+
Net::HTTP::Post.new(
|
25
|
+
'/solr/update',
|
26
|
+
"Content-Type" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Content-Length" => "24244"
|
27
|
+
)
|
28
|
+
end
|
24
29
|
|
25
30
|
before do
|
26
31
|
allow(processor).to receive(:uri).and_return(uri)
|
27
|
-
allow(Net::HTTP).to receive(:new).with('example.com', 99).and_return(request)
|
28
32
|
end
|
29
33
|
|
30
34
|
context "when that is successful" do
|
@@ -32,7 +36,9 @@ describe Hydra::Derivatives::Processors::FullText do
|
|
32
36
|
|
33
37
|
it "calls the extraction service" do
|
34
38
|
expect(processor).to receive(:check_for_ssl)
|
35
|
-
expect(
|
39
|
+
expect(Net::HTTP).to receive(:start).with('example.com', 99).and_yield(req)
|
40
|
+
expect(Net::HTTP::Post).to receive(:new).with('/solr/update', "Content-Type" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Content-Length" => "24244").and_return(req)
|
41
|
+
expect(req).to receive(:request).and_return(resp)
|
36
42
|
expect(subject).to eq response_body
|
37
43
|
end
|
38
44
|
end
|
@@ -44,7 +50,9 @@ describe Hydra::Derivatives::Processors::FullText do
|
|
44
50
|
|
45
51
|
it "calls the extraction service" do
|
46
52
|
expect(processor).to receive(:check_for_ssl)
|
47
|
-
expect(
|
53
|
+
expect(Net::HTTP).to receive(:start).with('example.com', 99).and_yield(req)
|
54
|
+
expect(Net::HTTP::Post).to receive(:new).with('/solr/update', "Content-Type" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Content-Length" => "24244").and_return(req)
|
55
|
+
expect(req).to receive(:request).and_return(resp)
|
48
56
|
expect(subject).to eq response_utf8
|
49
57
|
end
|
50
58
|
end
|
@@ -54,10 +62,39 @@ describe Hydra::Derivatives::Processors::FullText do
|
|
54
62
|
|
55
63
|
it "raises an error" do
|
56
64
|
expect(processor).to receive(:check_for_ssl)
|
57
|
-
expect(
|
65
|
+
expect(Net::HTTP).to receive(:start).with('example.com', 99).and_yield(req)
|
66
|
+
expect(Net::HTTP::Post).to receive(:new).with('/solr/update', "Content-Type" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Content-Length" => "24244").and_return(req)
|
67
|
+
expect(req).to receive(:request).and_return(resp)
|
58
68
|
expect { subject }.to raise_error(RuntimeError, %r{^Solr Extract service was unsuccessful. 'https://example\.com:99/solr/update' returned code 500})
|
59
69
|
end
|
60
70
|
end
|
71
|
+
|
72
|
+
context "with basic_auth" do
|
73
|
+
let(:resp) { double(code: '200', type_params: {}, body: response_body) }
|
74
|
+
let(:uri) { URI('https://user:password@example.com:99/solr/update') }
|
75
|
+
|
76
|
+
it "calls the extraction service with basic auth" do
|
77
|
+
expect(processor).to receive(:check_for_ssl)
|
78
|
+
expect(Net::HTTP).to receive(:start).with('example.com', 99).and_yield(req)
|
79
|
+
expect(Net::HTTP::Post).to receive(:new).with('/solr/update', "Content-Type" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Content-Length" => "24244").and_return(req)
|
80
|
+
expect(req).to receive(:basic_auth).with('user', 'password')
|
81
|
+
expect(req).to receive(:request).and_return(resp)
|
82
|
+
expect(subject).to eq response_body
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
context "with no basic_auth credentials" do
|
87
|
+
let(:resp) { double(code: '401', type_params: {}, body: response_body) }
|
88
|
+
let(:uri) { URI('https://user:password@example.com:99/solr/update') }
|
89
|
+
|
90
|
+
it "raises a 401 error" do
|
91
|
+
req.basic_auth(nil, nil)
|
92
|
+
expect(processor).to receive(:check_for_ssl)
|
93
|
+
expect(Net::HTTP).to receive(:start).with('example.com', 99).and_yield(req)
|
94
|
+
expect(req).to receive(:request).and_return(resp)
|
95
|
+
expect { subject }.to raise_error(RuntimeError, %r{^Solr Extract service was unsuccessful. 'https://user:password@example.com:99/solr/update' returned code 401})
|
96
|
+
end
|
97
|
+
end
|
61
98
|
end
|
62
99
|
|
63
100
|
describe "uri" do
|
@@ -10,10 +10,19 @@ describe Hydra::Derivatives::Processors::ShellBasedProcessor do
|
|
10
10
|
after { Object.send(:remove_const, :TestProcessor) }
|
11
11
|
|
12
12
|
let(:processor) { TestProcessor.new }
|
13
|
+
let(:proc_class) { TestProcessor }
|
13
14
|
|
14
15
|
describe "options_for" do
|
15
16
|
it "returns a hash" do
|
16
17
|
expect(processor.options_for("a")).to be_a Hash
|
17
18
|
end
|
18
19
|
end
|
20
|
+
|
21
|
+
describe ".execute" do
|
22
|
+
context "when an EOF error occurs" do
|
23
|
+
it "doesn't crash" do
|
24
|
+
proc_class.execute("echo foo")
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
19
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hydra-derivatives
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: fcrepo_wrapper
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -214,12 +214,14 @@ files:
|
|
214
214
|
- ".rubocop.yml"
|
215
215
|
- ".rubocop_todo.yml"
|
216
216
|
- ".travis.yml"
|
217
|
+
- CODE_OF_CONDUCT.md
|
217
218
|
- CONTRIBUTING.md
|
218
219
|
- Gemfile
|
219
220
|
- History.md
|
220
221
|
- LICENSE.txt
|
221
222
|
- README.md
|
222
223
|
- Rakefile
|
224
|
+
- SUPPORT.md
|
223
225
|
- TODO
|
224
226
|
- VERSION
|
225
227
|
- config/fcrepo_wrapper_test.yml
|
@@ -336,8 +338,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
336
338
|
- !ruby/object:Gem::Version
|
337
339
|
version: '0'
|
338
340
|
requirements: []
|
339
|
-
|
340
|
-
rubygems_version: 2.5.2
|
341
|
+
rubygems_version: 3.0.2
|
341
342
|
signing_key:
|
342
343
|
specification_version: 4
|
343
344
|
summary: Derivative generation plugin for hydra
|