hydra-derivatives 3.3.2 → 3.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +69 -0
- data/.rubocop.yml +53 -34
- data/.rubocop_todo.yml +42 -9
- data/.solr_wrapper +2 -0
- data/CODE_OF_CONDUCT.md +36 -0
- data/CONTRIBUTING.md +23 -21
- data/Gemfile +5 -3
- data/README.md +74 -5
- data/Rakefile +13 -1
- data/SUPPORT.md +5 -0
- data/VERSION +1 -1
- data/config/fcrepo_wrapper_test.yml +6 -0
- data/config/solr_wrapper_test.yml +2 -0
- data/hydra-derivatives.gemspec +16 -16
- data/lib/hydra/derivatives.rb +2 -2
- data/lib/hydra/derivatives/audio_encoder.rb +1 -1
- data/lib/hydra/derivatives/config.rb +1 -1
- data/lib/hydra/derivatives/io_decorator.rb +13 -6
- data/lib/hydra/derivatives/logger.rb +5 -1
- data/lib/hydra/derivatives/processors/active_encode.rb +1 -1
- data/lib/hydra/derivatives/processors/document.rb +4 -1
- data/lib/hydra/derivatives/processors/full_text.rb +20 -6
- data/lib/hydra/derivatives/processors/jpeg2k_image.rb +7 -16
- data/lib/hydra/derivatives/processors/processor.rb +0 -7
- data/lib/hydra/derivatives/processors/shell_based_processor.rb +5 -3
- data/lib/hydra/derivatives/runners/full_text_extract.rb +1 -1
- data/lib/hydra/derivatives/services/capability_service.rb +1 -1
- data/lib/hydra/derivatives/services/persist_basic_contained_output_file_service.rb +5 -1
- data/lib/hydra/derivatives/services/persist_output_file_service.rb +5 -3
- data/solr/config/schema.xml +0 -2
- data/solr/config/xslt/example.xsl +1 -1
- data/solr/config/xslt/luke.xsl +1 -1
- metadata +187 -138
- data/.travis.yml +0 -26
- data/spec/fixtures/FlashPix.ppt +0 -0
- data/spec/fixtures/adobe1998.tif +0 -0
- data/spec/fixtures/countdown.avi +0 -0
- data/spec/fixtures/jpeg2k_config.yml +0 -20
- data/spec/fixtures/piano_note.wav +0 -0
- data/spec/fixtures/sample.rtf +0 -68
- data/spec/fixtures/test.dng +0 -0
- data/spec/fixtures/test.doc +0 -0
- data/spec/fixtures/test.docx +0 -0
- data/spec/fixtures/test.pdf +0 -0
- data/spec/fixtures/test.pptx +0 -0
- data/spec/fixtures/test.tif +0 -0
- data/spec/fixtures/test.xls +0 -0
- data/spec/fixtures/test.xlsx +0 -0
- data/spec/fixtures/world.png +0 -0
- data/spec/processors/active_encode_spec.rb +0 -132
- data/spec/processors/document_spec.rb +0 -41
- data/spec/processors/full_text_spec.rb +0 -70
- data/spec/processors/image_spec.rb +0 -122
- data/spec/processors/jpeg2k_spec.rb +0 -82
- data/spec/processors/processor_spec.rb +0 -35
- data/spec/processors/shell_based_processor_spec.rb +0 -19
- data/spec/processors/video_spec.rb +0 -40
- data/spec/runners/active_encode_derivatives_spec.rb +0 -38
- data/spec/services/audio_derivatives_spec.rb +0 -78
- data/spec/services/persist_basic_contained_output_file_service_spec.rb +0 -40
- data/spec/services/persist_external_file_output_file_service_spec.rb +0 -26
- data/spec/services/remote_source_file_spec.rb +0 -33
- data/spec/services/retrieve_source_file_service_spec.rb +0 -60
- data/spec/services/tempfile_service_spec.rb +0 -30
- data/spec/spec_helper.rb +0 -33
- data/spec/units/audio_encoder_spec.rb +0 -23
- data/spec/units/config_spec.rb +0 -50
- data/spec/units/derivatives_spec.rb +0 -62
- data/spec/units/io_decorator_spec.rb +0 -33
- data/spec/units/logger_spec.rb +0 -22
- data/spec/units/transcoding_spec.rb +0 -346
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 124f992a28f2883d1c8d762ae0232957645923e145c48ec75bfe33280f0683ab
|
4
|
+
data.tar.gz: 02336f270677e9e55e768c8c03bf71afc62fb759c5f48ee7eaddc1033345e07f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 675ccaa54a34cdf812c295d9e937a29041053526f69a8eb7d68c6b162939cbc0a1e973c4b8176274af9fbbc1e45fd804121d7fffa860a0958ede78d47d454057
|
7
|
+
data.tar.gz: 49815c8d5efe8fb0d5eb8aa83fbec991e4bc86454087b773c2a4556a7028680a4d6a0bafd568a4af1a81bb9dded89bc703d99161eafe97940706e94321c3ca47
|
@@ -0,0 +1,69 @@
|
|
1
|
+
version: 2.1
|
2
|
+
orbs:
|
3
|
+
samvera: samvera/circleci-orb@0
|
4
|
+
jobs:
|
5
|
+
bundle_lint_test:
|
6
|
+
parameters:
|
7
|
+
ruby_version:
|
8
|
+
type: string
|
9
|
+
project:
|
10
|
+
type: string
|
11
|
+
bundler_version:
|
12
|
+
type: string
|
13
|
+
default: 2.1.4
|
14
|
+
executor:
|
15
|
+
name: 'samvera/ruby_fcrepo_solr'
|
16
|
+
ruby_version: << parameters.ruby_version >>
|
17
|
+
steps:
|
18
|
+
- samvera/cached_checkout
|
19
|
+
- run:
|
20
|
+
name: Install dependencies
|
21
|
+
command: |
|
22
|
+
sudo apt-get update
|
23
|
+
sudo apt-get install ghostscript ufraw-batch libpng-dev imagemagick ffmpeg libreoffice
|
24
|
+
- run:
|
25
|
+
name: Install Kakadu
|
26
|
+
command: |
|
27
|
+
if [ ! -d "kakadu" ]; then
|
28
|
+
mkdir ~/downloads
|
29
|
+
wget http://kakadusoftware.com/wp-content/uploads/2014/06/KDU77_Demo_Apps_for_Linux-x86-64_150710.zip -O ~/downloads/kakadu.zip
|
30
|
+
unzip ~/downloads/kakadu.zip
|
31
|
+
mv KDU77_Demo_Apps_for_Linux-x86-64_150710 kakadu
|
32
|
+
fi
|
33
|
+
sudo cp kakadu/*.so /usr/lib
|
34
|
+
sudo cp kakadu/* /usr/bin
|
35
|
+
- run:
|
36
|
+
name: Modify ImageMagick security policy
|
37
|
+
command: sudo sed -i 's/policy domain="coder" rights="none" pattern="PDF"/policy domain="coder" rights="read|write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml
|
38
|
+
|
39
|
+
- samvera/bundle_for_gem:
|
40
|
+
ruby_version: << parameters.ruby_version >>
|
41
|
+
bundler_version: << parameters.bundler_version >>
|
42
|
+
project: << parameters.project >>
|
43
|
+
cache_version: '2'
|
44
|
+
|
45
|
+
- samvera/install_solr_core
|
46
|
+
|
47
|
+
- samvera/rubocop
|
48
|
+
|
49
|
+
- samvera/parallel_rspec
|
50
|
+
|
51
|
+
workflows:
|
52
|
+
ci:
|
53
|
+
jobs:
|
54
|
+
- bundle_lint_test:
|
55
|
+
name: ruby2-4
|
56
|
+
ruby_version: 2.4.10
|
57
|
+
project: hydra-derivatives
|
58
|
+
- bundle_lint_test:
|
59
|
+
name: ruby2-5
|
60
|
+
ruby_version: 2.5.8
|
61
|
+
project: hydra-derivatives
|
62
|
+
- bundle_lint_test:
|
63
|
+
name: ruby2-6
|
64
|
+
ruby_version: 2.6.6
|
65
|
+
project: hydra-derivatives
|
66
|
+
- bundle_lint_test:
|
67
|
+
name: ruby2-7
|
68
|
+
ruby_version: 2.7.1
|
69
|
+
project: hydra-derivatives
|
data/.rubocop.yml
CHANGED
@@ -3,42 +3,35 @@ inherit_from: .rubocop_todo.yml
|
|
3
3
|
|
4
4
|
AllCops:
|
5
5
|
DisplayCopNames: true
|
6
|
-
Include:
|
7
|
-
- '**/Rakefile'
|
8
6
|
Exclude:
|
9
7
|
- 'vendor/**/*'
|
10
8
|
- 'spec/internal/bin/*'
|
11
9
|
- 'spec/internal/db/schema.rb'
|
10
|
+
- Gemfile
|
11
|
+
- hydra-derivatives.gemspec
|
12
|
+
- Rakefile
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
Style/CollectionMethods:
|
17
|
-
PreferredMethods:
|
18
|
-
collect: 'map'
|
19
|
-
collect!: 'map!'
|
20
|
-
inject: 'reduce'
|
21
|
-
detect: 'find'
|
22
|
-
find_all: 'select'
|
23
|
-
|
24
|
-
Style/ClassAndModuleChildren:
|
25
|
-
Enabled: false
|
14
|
+
Layout/IndentationConsistency:
|
15
|
+
EnforcedStyle: rails
|
26
16
|
|
27
|
-
|
28
|
-
|
17
|
+
Metrics/AbcSize:
|
18
|
+
Max: 42
|
19
|
+
Exclude:
|
20
|
+
- lib/hydra/derivatives/processors/document.rb
|
21
|
+
- lib/hydra/derivatives/processors/full_text.rb
|
22
|
+
- lib/hydra/derivatives/processors/jpeg2k_image.rb
|
23
|
+
- lib/hydra/derivatives/processors/shell_based_processor.rb
|
24
|
+
- lib/hydra/derivatives/services/persist_basic_contained_output_file_service.rb
|
25
|
+
- lib/hydra/derivatives/services/tempfile_service.rb
|
29
26
|
|
30
|
-
|
31
|
-
|
27
|
+
Metrics/BlockLength:
|
28
|
+
Max: 320
|
32
29
|
|
33
|
-
|
30
|
+
Metrics/LineLength:
|
34
31
|
Enabled: false
|
35
32
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
Style/PredicateName:
|
40
|
-
Exclude:
|
41
|
-
- spec/services/tempfile_service_spec.rb
|
33
|
+
RSpec/ExampleLength:
|
34
|
+
Max: 10
|
42
35
|
|
43
36
|
RSpec/ExampleWording:
|
44
37
|
CustomTransform:
|
@@ -52,15 +45,41 @@ RSpec/ExampleWording:
|
|
52
45
|
RSpec/FilePath:
|
53
46
|
Enabled: false
|
54
47
|
|
48
|
+
RSpec/HookArgument:
|
49
|
+
Exclude:
|
50
|
+
- spec/spec_helper.rb
|
51
|
+
|
55
52
|
RSpec/InstanceVariable:
|
56
53
|
Enabled: false
|
57
54
|
|
58
|
-
RSpec/
|
59
|
-
|
60
|
-
- spec/units/config_spec.rb
|
61
|
-
- spec/units/transcoding_spec.rb
|
55
|
+
RSpec/MessageSpies:
|
56
|
+
Enabled: false
|
62
57
|
|
63
|
-
RSpec/
|
64
|
-
|
65
|
-
|
66
|
-
|
58
|
+
RSpec/MultipleExpectations:
|
59
|
+
Max: 10
|
60
|
+
|
61
|
+
RSpec/NamedSubject:
|
62
|
+
Enabled: false
|
63
|
+
|
64
|
+
RSpec/NestedGroups:
|
65
|
+
Max: 4
|
66
|
+
|
67
|
+
Style/ClassAndModuleChildren:
|
68
|
+
Enabled: false
|
69
|
+
|
70
|
+
Style/CollectionMethods:
|
71
|
+
PreferredMethods:
|
72
|
+
collect: 'map'
|
73
|
+
collect!: 'map!'
|
74
|
+
inject: 'reduce'
|
75
|
+
detect: 'find'
|
76
|
+
find_all: 'select'
|
77
|
+
|
78
|
+
Style/Documentation:
|
79
|
+
Enabled: false
|
80
|
+
|
81
|
+
Style/SignalException:
|
82
|
+
Enabled: false
|
83
|
+
|
84
|
+
Style/StringLiterals:
|
85
|
+
Enabled: false
|
data/.rubocop_todo.yml
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# List of files that we ought to fix based on what Rubocop is complaining about them
|
2
2
|
|
3
|
+
Layout/SpaceBeforeBlockBraces:
|
4
|
+
Exclude:
|
5
|
+
- lib/hydra/derivatives/processors/jpeg2k_image.rb
|
6
|
+
- lib/hydra/derivatives/processors/shell_based_processor.rb
|
7
|
+
|
8
|
+
Metrics/ClassLength:
|
9
|
+
Exclude:
|
10
|
+
- lib/hydra/derivatives/processors/jpeg2k_image.rb
|
11
|
+
|
3
12
|
Metrics/CyclomaticComplexity:
|
4
13
|
Exclude:
|
5
14
|
- spec/units/transcoding_spec.rb
|
@@ -12,18 +21,42 @@ Metrics/MethodLength:
|
|
12
21
|
- lib/hydra/derivatives/processors/shell_based_processor.rb
|
13
22
|
- lib/hydra/derivatives/processors/video/processor.rb
|
14
23
|
- lib/hydra/derivatives/services/tempfile_service.rb
|
24
|
+
- spec/**/*.rb
|
25
|
+
|
26
|
+
Naming/PredicateName:
|
27
|
+
Exclude:
|
28
|
+
- spec/services/tempfile_service_spec.rb
|
29
|
+
|
30
|
+
RSpec/AnyInstance:
|
31
|
+
Exclude:
|
32
|
+
- spec/processors/image_spec.rb
|
15
33
|
- spec/units/transcoding_spec.rb
|
16
34
|
|
17
|
-
|
35
|
+
RSpec/BeforeAfterAll:
|
18
36
|
Exclude:
|
19
|
-
-
|
37
|
+
- spec/**/*.rb
|
20
38
|
|
21
|
-
|
39
|
+
RSpec/DescribeClass:
|
22
40
|
Exclude:
|
23
|
-
-
|
24
|
-
- lib/hydra/derivatives/processors/full_text.rb
|
25
|
-
- lib/hydra/derivatives/processors/jpeg2k_image.rb
|
26
|
-
- lib/hydra/derivatives/processors/shell_based_processor.rb
|
27
|
-
- lib/hydra/derivatives/services/persist_basic_contained_output_file_service.rb
|
28
|
-
- lib/hydra/derivatives/services/tempfile_service.rb
|
41
|
+
- spec/units/config_spec.rb
|
29
42
|
- spec/units/transcoding_spec.rb
|
43
|
+
|
44
|
+
RSpec/PredicateMatcher:
|
45
|
+
Exclude:
|
46
|
+
- spec/**/*.rb
|
47
|
+
|
48
|
+
RSpec/ReturnFromStub:
|
49
|
+
Exclude:
|
50
|
+
- spec/processors/jpeg2k_spec.rb
|
51
|
+
|
52
|
+
RSpec/SubjectStub:
|
53
|
+
Exclude:
|
54
|
+
- spec/**/*.rb
|
55
|
+
|
56
|
+
RSpec/VerifiedDoubles:
|
57
|
+
Exclude:
|
58
|
+
- spec/processors/full_text_spec.rb
|
59
|
+
|
60
|
+
Style/EvalWithLocation:
|
61
|
+
Exclude:
|
62
|
+
- lib/hydra/derivatives.rb
|
data/.solr_wrapper
ADDED
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/Gemfile
CHANGED
@@ -3,10 +3,12 @@ source 'https://rubygems.org'
|
|
3
3
|
# Please see hydra-derivatives.gemspec for dependency information.
|
4
4
|
gemspec
|
5
5
|
|
6
|
+
gem 'sprockets', '~> 3.7'
|
7
|
+
|
6
8
|
group :development, :test do
|
7
|
-
gem 'simplecov'
|
8
9
|
gem 'coveralls'
|
9
|
-
gem '
|
10
|
-
gem 'rubocop', '~> 0.
|
10
|
+
gem 'rspec_junit_formatter'
|
11
|
+
gem 'rubocop', '~> 0.52.0', require: false
|
11
12
|
gem 'rubocop-rspec', require: false
|
13
|
+
gem 'simplecov'
|
12
14
|
end
|
data/README.md
CHANGED
@@ -1,11 +1,35 @@
|
|
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://
|
5
|
-
[![
|
6
|
-
[![Coverage Status](https://coveralls.io/repos/github/projecthydra/hydra-derivatives/badge.svg?branch=master)](https://coveralls.io/github/projecthydra/hydra-derivatives?branch=master)
|
5
|
+
[![Build Status](https://circleci.com/gh/samvera/hydra-derivatives.svg?style=svg)](https://circleci.com/gh/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
7
|
|
8
|
-
|
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?
|
15
|
+
|
16
|
+
Derivative generation for Samvera applications.
|
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
|
9
33
|
|
10
34
|
If you have an ActiveFedora class like this:
|
11
35
|
```ruby
|
@@ -80,6 +104,8 @@ Hydra::Derivatives::Processors::ActiveEncode.timeout = 5.minutes
|
|
80
104
|
|
81
105
|
```
|
82
106
|
|
107
|
+
You can add this to a `config/initializers/` file ([see Scholarsphere as an example](https://github.com/psu-stewardship/scholarsphere/blob/e16586c4bf6f7aed652924acc47dbe4ec774ff00/config/initializers/hydra_derivatives_config.rb#L5)). Another possibility, though unverified, is that you may try adding it to your `config/application.rb` or even vary by environments (e.g. `config/environments/test.rb`).
|
108
|
+
|
83
109
|
### Video Processing configuration
|
84
110
|
|
85
111
|
Flags can be set for using different video codes. Default codecs are shown below
|
@@ -169,6 +195,11 @@ MAGICK_TEMPDIR
|
|
169
195
|
```
|
170
196
|
YMMV as to where setting them will take effect in your app; the application's web server's vhost directives are a location known to work with an Apache web server set up.
|
171
197
|
|
198
|
+
ImageMagick by default disables reading and writing of PDFs due to a [vulnerability in ghostscript](https://www.kb.cert.org/vuls/id/332928/). Make sure to install a fixed version of ghostscript and modify ImageMagick's security policy to allow reading and writing PDFs:
|
199
|
+
```
|
200
|
+
sudo sed -i 's/policy domain="coder" rights="none" pattern="PDF"/policy domain="coder" rights="read|write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml
|
201
|
+
```
|
202
|
+
|
172
203
|
## JPEG2k Directives
|
173
204
|
|
174
205
|
Unlike the other processors, the `Jpeg2kImage` processor does not generally accept arguments that directly (or nearly so) translate to the arguments you would give to the corresponding command line utility.
|
@@ -179,10 +210,48 @@ Instead, each directive may contain these arguments:
|
|
179
210
|
* `:to_srgb` (Boolean) : If `true` and the image is a color image it will map the source image color profile to sRGB. Default: `true`
|
180
211
|
* `:resize` (String) : Geometry; the same syntax as the `Hydra::Derivatives::Image` processor
|
181
212
|
* `:recipe` :
|
182
|
-
- If a Symbol the recipe will be read from the `Hydra::Derivatives.kdu_compress_recipes` hash. You can override this, or a couple of samples are supplied. The symbol in the config file should be the name in the model + `_{quality}`, e.g. `recipe: :default` will look `:default_color` or `:
|
213
|
+
- If a Symbol the recipe will be read from the `Hydra::Derivatives.kdu_compress_recipes` hash. You can override this, or a couple of samples are supplied. The symbol in the config file should be the name in the model + `_{quality}`, e.g. `recipe: :default` will look `:default_color` or `:default_gray` in the hash.
|
183
214
|
- If a String the recipe in the string will be used. You may include anything the command line utility will accept except `-i` or `-o`. See `$ kdu_compress -usage` in your shell.
|
184
215
|
- If no `:recipe` is provided the processor will examine the image and make a best guess, but you can set a few basic options (the remainder of this list). Note that these are ignored if you provided a recipe via either of the first two methods described.
|
185
216
|
* `:levels` (Integer) : The number of decomposition levels. The default is the number of times the long dimension can be divided by two, down to 96, e.g. a 7200 pixel image would have 6 levels (3600, 1800, 900, 450, 225, 112)
|
186
217
|
* `:layers` (Integer) : The number of quality layers. Default: 8
|
187
218
|
* `:compression` (Integer) : The left number of the compression ratio `n:1`, e.g. 12 will apply 12:1 compression. Default: 10.
|
188
219
|
* `:tile_size` (Integer) : Pixel dimension of the tiles. Default: 1024
|
220
|
+
|
221
|
+
# Development Environment
|
222
|
+
|
223
|
+
## Dependencies
|
224
|
+
|
225
|
+
* [ImageMagick](https://www.imagemagick.org)
|
226
|
+
* On a mac, do `brew install imagemagick`
|
227
|
+
* [LibreOffice](https://www.libreoffice.org/)
|
228
|
+
* * On a mac, do `brew cask install libreoffice`
|
229
|
+
* [Kakadu](http://kakadusoftware.com/)
|
230
|
+
* On a mac, extract the file and run the pkg installer therein (don't get distracted by the files called kdu_show)
|
231
|
+
* [Ghostscript](https://www.ghostscript.com/)
|
232
|
+
* On a mac, `brew install ghostscript`
|
233
|
+
* ufraw
|
234
|
+
* On a mac, `brew install ufraw`
|
235
|
+
* libvpx
|
236
|
+
* On a mac, `brew install libvpx`
|
237
|
+
* ffmpeg
|
238
|
+
* On a mac, `brew install ffmpeg`
|
239
|
+
* Ensure `libvpx` is installed first
|
240
|
+
|
241
|
+
## Running Tests
|
242
|
+
|
243
|
+
1. Run tests with `RAILS_ENV=test bundle exec rake ci`
|
244
|
+
|
245
|
+
## Running specific tests
|
246
|
+
|
247
|
+
If you don't want to run the whole suite all at once like CI, do the following:
|
248
|
+
|
249
|
+
1. Run the test servers with `rake derivatives:test_server`
|
250
|
+
2. Run the tests.
|
251
|
+
|
252
|
+
# Acknowledgments
|
253
|
+
|
254
|
+
This software has been developed by and is brought to you by the Samvera community. Learn more at the
|
255
|
+
[Samvera website](http://samvera.org/).
|
256
|
+
|
257
|
+
![Samvera Logo](https://wiki.duraspace.org/download/thumbnails/87459292/samvera-fall-font2-200w.png?version=1&modificationDate=1498550535816&api=v2)
|