hydra-pcdm 0.11.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +9 -52
- data/.rubocop_todo.yml +31 -0
- data/CODE_OF_CONDUCT.md +36 -0
- data/CONTRIBUTING.md +23 -21
- data/Gemfile +1 -2
- data/LICENSE +14 -12
- data/README.md +29 -6
- data/SUPPORT.md +5 -0
- data/hydra-pcdm.gemspec +1 -0
- data/lib/hydra/pcdm/version.rb +1 -1
- data/spec/hydra/pcdm/collection_indexer_spec.rb +4 -4
- data/spec/hydra/pcdm/models/collection_spec.rb +1 -1
- data/spec/hydra/pcdm/models/object_spec.rb +14 -11
- data/spec/hydra/pcdm/object_indexer_spec.rb +1 -1
- data/spec/hydra/pcdm/pcdm_indexer_spec.rb +3 -3
- metadata +20 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0e25251f3d10d3c98e030b26f87e59a3e30821e4
|
4
|
+
data.tar.gz: 22d3991f4921e797626eb8365b34509bd35f4af8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cecbc63fa5774fd30f3fb41e70ade5101c437b79d2393335ece27a712c2abb7ce588e1ec6494b06bf224cc808d0774a4e04edcb8011a920f47b8f6bfd4609826
|
7
|
+
data.tar.gz: b092d974b6273dfbf83aad5231214d5c88be8d5db77f93916171d74625fbb2774ba9326abbb44c950b99634ad84b0f0a8d43cf9b9650e73b98c5a93abb03bc14
|
data/.rubocop.yml
CHANGED
@@ -1,57 +1,14 @@
|
|
1
|
-
|
1
|
+
inherit_gem:
|
2
|
+
bixby: bixby_default.yml
|
2
3
|
|
3
|
-
|
4
|
-
DisplayCopNames: true
|
5
|
-
Include:
|
6
|
-
- '**/Rakefile'
|
4
|
+
inherit_from: .rubocop_todo.yml
|
7
5
|
|
8
|
-
|
9
|
-
Enabled: false
|
10
|
-
|
11
|
-
Metrics/AbcSize:
|
12
|
-
Max: 17
|
13
|
-
|
14
|
-
Style/CollectionMethods:
|
15
|
-
PreferredMethods:
|
16
|
-
collect: 'map'
|
17
|
-
collect!: 'map!'
|
18
|
-
inject: 'reduce'
|
19
|
-
detect: 'find'
|
20
|
-
find_all: 'select'
|
21
|
-
|
22
|
-
Style/ClassAndModuleChildren:
|
23
|
-
Enabled: false
|
24
|
-
|
25
|
-
Style/Documentation:
|
26
|
-
Enabled: false
|
27
|
-
|
28
|
-
RSpec/ExampleWording:
|
29
|
-
CustomTransform:
|
30
|
-
be: is
|
31
|
-
have: has
|
32
|
-
not: does not
|
33
|
-
NOT: does NOT
|
34
|
-
IgnoredWords:
|
35
|
-
- only
|
36
|
-
|
37
|
-
RSpec/FilePath:
|
38
|
-
Enabled: false
|
39
|
-
|
40
|
-
RSpec/InstanceVariable:
|
41
|
-
Enabled: false
|
42
|
-
|
43
|
-
RSpec/NamedSubject:
|
44
|
-
Enabled: false
|
45
|
-
|
46
|
-
RSpec/MultipleExpectations:
|
6
|
+
Naming/FileName:
|
47
7
|
Exclude:
|
48
|
-
-
|
49
|
-
-
|
50
|
-
-
|
8
|
+
- '**/Gemfile'
|
9
|
+
- '**/*.rake'
|
10
|
+
- 'hydra-pcdm.gemspec'
|
51
11
|
|
52
|
-
|
12
|
+
Metrics/BlockLength:
|
53
13
|
Exclude:
|
54
|
-
- spec
|
55
|
-
|
56
|
-
RSpec/NestedGroups:
|
57
|
-
Enabled: false
|
14
|
+
- 'spec/**/*.rb'
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2018-07-16 07:38:44 -0500 using RuboCop version 0.52.1.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 7
|
10
|
+
# Configuration parameters: Max.
|
11
|
+
RSpec/ExampleLength:
|
12
|
+
Exclude:
|
13
|
+
- 'spec/hydra/pcdm/models/collection_spec.rb'
|
14
|
+
- 'spec/hydra/pcdm/models/object_spec.rb'
|
15
|
+
|
16
|
+
# Offense count: 69
|
17
|
+
# Configuration parameters: AssignmentOnly.
|
18
|
+
RSpec/InstanceVariable:
|
19
|
+
Exclude:
|
20
|
+
- 'spec/hydra/pcdm/models/collection_spec.rb'
|
21
|
+
- 'spec/hydra/pcdm/models/object_spec.rb'
|
22
|
+
|
23
|
+
# Offense count: 199
|
24
|
+
RSpec/NamedSubject:
|
25
|
+
Exclude:
|
26
|
+
- 'spec/hydra/pcdm/collection_indexer_spec.rb'
|
27
|
+
- 'spec/hydra/pcdm/models/collection_spec.rb'
|
28
|
+
- 'spec/hydra/pcdm/models/file_spec.rb'
|
29
|
+
- 'spec/hydra/pcdm/models/object_spec.rb'
|
30
|
+
- 'spec/hydra/pcdm/object_indexer_spec.rb'
|
31
|
+
- 'spec/hydra/pcdm/pcdm_indexer_spec.rb'
|
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-pcdm/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
data/LICENSE
CHANGED
@@ -1,12 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
1
|
+
Copyright 2015 Cornell University Library
|
2
|
+
Additional copyright may be held by others, as reflected in the commit history.
|
3
|
+
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
you may not use this file except in compliance with the License.
|
6
|
+
You may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
See the License for the specific language governing permissions and
|
14
|
+
limitations under the License.
|
data/README.md
CHANGED
@@ -1,14 +1,35 @@
|
|
1
1
|
# Hydra::PCDM
|
2
2
|
|
3
|
+
Code:
|
3
4
|
[![Version](https://badge.fury.io/rb/hydra-pcdm.png)](http://badge.fury.io/rb/hydra-pcdm)
|
4
|
-
[![Build Status](https://travis-ci.org/
|
5
|
-
[![Coverage Status](https://coveralls.io/repos/
|
5
|
+
[![Build Status](https://travis-ci.org/samvera/hydra-pcdm.svg?branch=master)](https://travis-ci.org/samvera/hydra-pcdm)
|
6
|
+
[![Coverage Status](https://coveralls.io/repos/samvera/hydra-pcdm/badge.svg?branch=master)](https://coveralls.io/r/samvera/hydra-pcdm?branch=master)
|
6
7
|
[![Code Climate](https://codeclimate.com/github/projecthydra/hydra-pcdm/badges/gpa.svg)](https://codeclimate.com/github/projecthydra/hydra-pcdm)
|
8
|
+
|
9
|
+
Docs:
|
7
10
|
[![Apache 2.0 License](http://img.shields.io/badge/APACHE2-license-blue.svg)](./LICENSE)
|
8
11
|
[![Contribution Guidelines](http://img.shields.io/badge/CONTRIBUTING-Guidelines-blue.svg)](./CONTRIBUTING.md)
|
9
12
|
[![API Docs](http://img.shields.io/badge/API-docs-blue.svg)](http://rubydoc.info/gems/hydra-pcdm)
|
10
13
|
|
11
|
-
|
14
|
+
Jump In: [![Slack Status](http://slack.samvera.org/badge.svg)](http://slack.samvera.org/)
|
15
|
+
|
16
|
+
# What is hydra-pcdm?
|
17
|
+
|
18
|
+
Samvera implementation of the Portland Common Data Model (PCDM)
|
19
|
+
|
20
|
+
## Product Owner & Maintenance
|
21
|
+
|
22
|
+
**hydra-pcdm** is a Core Component of the Samvera community. The documentation for
|
23
|
+
what this means can be found
|
24
|
+
[here](http://samvera.github.io/core_components.html#requirements-for-a-core-component).
|
25
|
+
|
26
|
+
### Product Owner
|
27
|
+
|
28
|
+
[mark-dce](https://github.com/mark-dce)
|
29
|
+
|
30
|
+
# Help
|
31
|
+
|
32
|
+
The Samvera community is here to help. Please see our [support guide](./SUPPORT.md).
|
12
33
|
|
13
34
|
## Installation
|
14
35
|
|
@@ -29,7 +50,7 @@ Or install it yourself:
|
|
29
50
|
|
30
51
|
## Access Controls
|
31
52
|
|
32
|
-
We are using [Web ACL](http://www.w3.org/wiki/WebAccessControl) as implemented in [hydra-access-controls](https://github.com/
|
53
|
+
We are using [Web ACL](http://www.w3.org/wiki/WebAccessControl) as implemented in [hydra-access-controls](https://github.com/samvera/hydra-head/tree/master/hydra-access-controls).
|
33
54
|
|
34
55
|
## Portland Common Data Model
|
35
56
|
|
@@ -73,7 +94,9 @@ file = book.files.build
|
|
73
94
|
file.content = "The quick brown fox jumped over the lazy dog."
|
74
95
|
book.save
|
75
96
|
```
|
97
|
+
# Acknowledgments
|
76
98
|
|
77
|
-
|
99
|
+
This software has been developed by and is brought to you by the Samvera community. Learn more at the
|
100
|
+
[Samvera website](http://samvera.org/).
|
78
101
|
|
79
|
-
|
102
|
+
![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-pcdm/issues/) to see if someone else has already reported it, and then feel free to [create a new issue](https://github.com/samvera/hydra-pcdm/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/hydra-pcdm.gemspec
CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ['lib']
|
21
21
|
|
22
22
|
spec.add_dependency 'active-fedora', '>= 10', '< 13'
|
23
|
+
spec.add_dependency 'activesupport', '< 5.2'
|
23
24
|
spec.add_dependency 'mime-types', '>= 1'
|
24
25
|
|
25
26
|
spec.add_development_dependency 'bundler', '~> 1.6'
|
data/lib/hydra/pcdm/version.rb
CHANGED
@@ -2,9 +2,9 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Hydra::PCDM::CollectionIndexer do
|
4
4
|
let(:collection) { Hydra::PCDM::Collection.new }
|
5
|
-
let(:collection_ids) { %w
|
5
|
+
let(:collection_ids) { %w[123 456] }
|
6
6
|
let(:object_ids) { ['789'] }
|
7
|
-
let(:member_ids) { %w
|
7
|
+
let(:member_ids) { %w[123 456 789] }
|
8
8
|
let(:indexer) { described_class.new(collection) }
|
9
9
|
|
10
10
|
before do
|
@@ -17,9 +17,9 @@ describe Hydra::PCDM::CollectionIndexer do
|
|
17
17
|
subject { indexer.generate_solr_document }
|
18
18
|
|
19
19
|
it 'has fields' do
|
20
|
-
expect(subject[Hydra::PCDM::Config.indexing_collection_ids_key]).to eq %w
|
20
|
+
expect(subject[Hydra::PCDM::Config.indexing_collection_ids_key]).to eq %w[123 456]
|
21
21
|
expect(subject[Hydra::PCDM::Config.indexing_object_ids_key]).to eq ['789']
|
22
|
-
expect(subject[Hydra::PCDM::Config.indexing_member_ids_key]).to eq %w
|
22
|
+
expect(subject[Hydra::PCDM::Config.indexing_member_ids_key]).to eq %w[123 456 789]
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -12,7 +12,7 @@ describe Hydra::PCDM::Object do
|
|
12
12
|
object.ordered_members << child2
|
13
13
|
end
|
14
14
|
|
15
|
-
it { is_expected.to eq %w
|
15
|
+
it { is_expected.to eq %w[1 2] }
|
16
16
|
end
|
17
17
|
|
18
18
|
describe '#ordered_member_ids' do
|
@@ -79,19 +79,22 @@ describe Hydra::PCDM::Object do
|
|
79
79
|
expect { object3.ordered_members = [object1] }.to raise_error(error_type, error_message)
|
80
80
|
expect { object3.ordered_members += [object1] }.to raise_error(error_type, error_message)
|
81
81
|
end
|
82
|
+
end
|
82
83
|
|
83
|
-
|
84
|
-
|
84
|
+
context 'with a more complicated example' do
|
85
|
+
before do
|
86
|
+
object2.ordered_members = [object3]
|
87
|
+
object3.ordered_members = [object4, object5]
|
88
|
+
end
|
85
89
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
+
it 'raises errors' do
|
91
|
+
expect { object4.ordered_members = [object1] }.to raise_error(error_type, error_message)
|
92
|
+
expect { object4.ordered_members += [object1] }.to raise_error(error_type, error_message)
|
93
|
+
expect { object4.ordered_members << [object1] }.to raise_error(error_type, error_message)
|
90
94
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
end
|
95
|
+
expect { object4.ordered_members = [object2] }.to raise_error(error_type, error_message)
|
96
|
+
expect { object4.ordered_members += [object2] }.to raise_error(error_type, error_message)
|
97
|
+
expect { object4.ordered_members << [object2] }.to raise_error(error_type, error_message)
|
95
98
|
end
|
96
99
|
end
|
97
100
|
end
|
@@ -14,7 +14,7 @@ describe Hydra::PCDM::ObjectIndexer do
|
|
14
14
|
subject { indexer.generate_solr_document }
|
15
15
|
|
16
16
|
it 'has fields' do
|
17
|
-
expect(subject[Hydra::PCDM::Config.indexing_object_ids_key]).to eq %w
|
17
|
+
expect(subject[Hydra::PCDM::Config.indexing_object_ids_key]).to eq %w[123 456]
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Hydra::PCDM::PCDMIndexer do
|
4
4
|
let(:collection) { Hydra::PCDM::Collection.new }
|
5
|
-
let(:member_ids) { %w
|
5
|
+
let(:member_ids) { %w[123 456 789] }
|
6
6
|
let(:indexer) { described_class.new(collection) }
|
7
7
|
let(:collection1) { Hydra::PCDM::Collection.new(id: 'abc') }
|
8
8
|
let(:collection2) { Hydra::PCDM::Collection.new(id: 'def') }
|
@@ -16,8 +16,8 @@ describe Hydra::PCDM::PCDMIndexer do
|
|
16
16
|
subject { indexer.generate_solr_document }
|
17
17
|
|
18
18
|
it 'has fields' do
|
19
|
-
expect(subject[Hydra::PCDM::Config.indexing_member_ids_key]).to eq %w
|
20
|
-
expect(subject[Hydra::PCDM::Config.indexing_member_of_collection_ids_key]).to eq %w
|
19
|
+
expect(subject[Hydra::PCDM::Config.indexing_member_ids_key]).to eq %w[123 456 789]
|
20
|
+
expect(subject[Hydra::PCDM::Config.indexing_member_of_collection_ids_key]).to eq %w[abc def]
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hydra-pcdm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- E. Lynette Rayle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active-fedora
|
@@ -30,6 +30,20 @@ dependencies:
|
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '13'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: activesupport
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "<"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '5.2'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '5.2'
|
33
47
|
- !ruby/object:Gem::Dependency
|
34
48
|
name: mime-types
|
35
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -139,12 +153,15 @@ files:
|
|
139
153
|
- ".gitignore"
|
140
154
|
- ".rspec"
|
141
155
|
- ".rubocop.yml"
|
156
|
+
- ".rubocop_todo.yml"
|
142
157
|
- ".travis.yml"
|
158
|
+
- CODE_OF_CONDUCT.md
|
143
159
|
- CONTRIBUTING.md
|
144
160
|
- Gemfile
|
145
161
|
- LICENSE
|
146
162
|
- README.md
|
147
163
|
- Rakefile
|
164
|
+
- SUPPORT.md
|
148
165
|
- config/jetty.yml
|
149
166
|
- hydra-pcdm.gemspec
|
150
167
|
- lib/hydra/pcdm.rb
|
@@ -216,7 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
216
233
|
version: '0'
|
217
234
|
requirements: []
|
218
235
|
rubyforge_project:
|
219
|
-
rubygems_version: 2.
|
236
|
+
rubygems_version: 2.6.14
|
220
237
|
signing_key:
|
221
238
|
specification_version: 4
|
222
239
|
summary: Portland Common Data Model (PCDM)
|