noid-rails 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.coveralls.yml +1 -0
- data/CODE_OF_CONDUCT.md +36 -0
- data/CONTRIBUTING.md +23 -21
- data/LICENSE +11 -15
- data/README.md +37 -25
- data/SUPPORT.md +5 -0
- data/lib/noid/rails/config.rb +1 -1
- data/lib/noid/rails/version.rb +1 -1
- data/noid-rails.gemspec +1 -1
- data/spec/spec_helper.rb +6 -1
- data/spec/unit/config_spec.rb +27 -0
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b13a0e35d3a36c9ebc1b6decf7437c7b385fed05
|
4
|
+
data.tar.gz: b4f1c4e7f10afd70ff20ecc0398834e28a84234e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aed61c2feb24d3016b71e642c4a08d1c11dac958f3a6add4420c57b8012d95770e0d7097b15dd659b38021e98279b5c9e4fb4f9a316658137fba569b873b79ec
|
7
|
+
data.tar.gz: 397015e442f1aa4ba838e59d550d3fb742b4ad693e9addb6113c601409ba8a38947d5b9a87f4d32dfef9f8a46ecf1bccf05ec6e7c3f630625ec779ded8dbdcb0
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
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/noid-rails/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/LICENSE
CHANGED
@@ -1,15 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
# See the License for the specific language governing permissions and
|
15
|
-
# limitations under the License.
|
1
|
+
Copyright 2015 Penn State University
|
2
|
+
Additional copyright may be held by others, as reflected in the commit history.
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
6
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
7
|
+
Unless required by applicable law or agreed to in writing, software
|
8
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
9
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
See the License for the specific language governing permissions and
|
11
|
+
limitations under the License.
|
data/README.md
CHANGED
@@ -1,21 +1,33 @@
|
|
1
|
-
|
2
|
-
[![Build Status](https://travis-ci.org/projecthydra/noid-rails.png?branch=master)](https://travis-ci.org/projecthydra/noid-rails)
|
3
|
-
[![Coverage Status](https://coveralls.io/repos/github/projecthydra/noid-rails/badge.svg?branch=master)](https://coveralls.io/github/projecthydra/noid-rails?branch=master)
|
4
|
-
[![Code Climate](https://codeclimate.com/github/projecthydra/noid-rails/badges/gpa.svg)](https://codeclimate.com/github/projecthydra/noid-rails)
|
5
|
-
[![Dependency Status](https://gemnasium.com/projecthydra/noid-rails.png)](https://gemnasium.com/projecthydra/noid-rails)
|
1
|
+
# Noid::Rails
|
6
2
|
|
7
|
-
|
8
|
-
[![
|
9
|
-
[![
|
3
|
+
Code:
|
4
|
+
[![Version](https://badge.fury.io/rb/noid-rails.png)](http://badge.fury.io/rb/noid-rails)
|
5
|
+
[![Build Status](https://travis-ci.org/samvera/noid-rails.png?branch=master)](https://travis-ci.org/samvera/noid-rails)
|
6
|
+
[![Coverage Status](https://coveralls.io/repos/github/samvera/noid-rails/badge.svg?branch=master)](https://coveralls.io/github/samvera/noid-rails?branch=master)
|
7
|
+
[![Code Climate](https://codeclimate.com/github/samvera/noid-rails/badges/gpa.svg)](https://codeclimate.com/github/samvera/noid-rails)
|
8
|
+
|
9
|
+
Docs:
|
10
10
|
[![Apache 2.0 License](http://img.shields.io/badge/APACHE2-license-blue.svg)](./LICENSE)
|
11
|
+
[![Contribution Guidelines](http://img.shields.io/badge/CONTRIBUTING-Guidelines-blue.svg)](./CONTRIBUTING.md)
|
12
|
+
[![API Docs](http://img.shields.io/badge/API-docs-blue.svg)](http://rubydoc.info/gems/noid-rails)
|
13
|
+
[![Documentation Status](https://inch-ci.org/github/samvera/noid-rails.svg?branch=master)](https://inch-ci.org/github/samvera/noid-rails)
|
11
14
|
|
12
|
-
|
15
|
+
Jump In: [![Slack Status](http://slack.samvera.org/badge.svg)](http://slack.samvera.org/)
|
16
|
+
|
17
|
+
# What is noid-rails?
|
18
|
+
|
19
|
+
This gem mints identifiers for models in your Rails-based application with opaque [Noid](https://wiki.ucop.edu/display/Curation/NOID)-based identifiers.
|
13
20
|
|
14
|
-
|
21
|
+
**This gem depends only upon Rails, not on ActiveFedora**
|
15
22
|
|
16
|
-
|
23
|
+
## Product Owner & Maintenance
|
24
|
+
**noid-rails** is a Core Component of the Samvera community. The documentation for
|
25
|
+
what this means can be found
|
26
|
+
[here](http://samvera.github.io/core_components.html#requirements-for-a-core-component).
|
27
|
+
### Product Owner
|
28
|
+
[Justin Coyne](https://github.com/jcoyne)
|
17
29
|
|
18
|
-
|
30
|
+
## Table of Contents
|
19
31
|
|
20
32
|
* [Installation](#installation)
|
21
33
|
* [Usage](#usage)
|
@@ -29,7 +41,7 @@ Override your ActiveFedora-based applications with opaque [Noid](https://wiki.uc
|
|
29
41
|
* [Help](#help)
|
30
42
|
* [Acknowledgments](#acknowledgments)
|
31
43
|
|
32
|
-
|
44
|
+
## Installation
|
33
45
|
|
34
46
|
Add this line to your application's Gemfile:
|
35
47
|
|
@@ -43,9 +55,9 @@ Or install it yourself via:
|
|
43
55
|
|
44
56
|
$ gem install noid-rails
|
45
57
|
|
46
|
-
|
58
|
+
## Usage
|
47
59
|
|
48
|
-
|
60
|
+
### Minting and validating identifiers
|
49
61
|
|
50
62
|
Mint a new Noid:
|
51
63
|
|
@@ -61,7 +73,7 @@ noid_service.valid? 'xyz123foobar'
|
|
61
73
|
> false
|
62
74
|
```
|
63
75
|
|
64
|
-
|
76
|
+
### ActiveFedora integration
|
65
77
|
|
66
78
|
To get ActiveFedora to automatically call your Noid service whenever a new ActiveFedora object is saved, include the `Noid::Rails::Model`, e.g.:
|
67
79
|
|
@@ -84,7 +96,7 @@ class MyObject < ActiveFedora::Base
|
|
84
96
|
end
|
85
97
|
```
|
86
98
|
|
87
|
-
|
99
|
+
#### Identifier/URI translation
|
88
100
|
|
89
101
|
As Noid::Rails overrides the default identifier minting strategy in ActiveFedora, you will need to let ActiveFedora know how to translate identifiers into URIs and vice versa so that identifiers are laid out in a sustainable way in Fedora. Add the following to e.g. `config/initializers/active_fedora.rb`:
|
90
102
|
|
@@ -100,13 +112,13 @@ ActiveFedora::Base.translate_id_to_uri = lambda do |id|
|
|
100
112
|
|
101
113
|
This will make sure your objects have Noid-like identifiers (e.g. `bb22bb22b`) that map to URIs in Fedora (e.g. `bb/22/bb/22/bb22bb22b`).
|
102
114
|
|
103
|
-
|
115
|
+
### Overriding default behavior
|
104
116
|
|
105
117
|
The default minter in Noid::Rails is the file-backed minter to preserve default behavior.
|
106
118
|
|
107
119
|
To better support multi-host production installations that expect a shared database but not necessarily a shared filesystem (e.g., between load-balanced Rails applications), we highly recommend swapping in the database-backed minter.
|
108
120
|
|
109
|
-
|
121
|
+
#### Use database-based minter state
|
110
122
|
|
111
123
|
The database-based minter stores minter state information in your application's relational database. To use it, you'll first need to run the install generator:
|
112
124
|
|
@@ -150,7 +162,7 @@ $ rake noid:rails:migrate:file_to_database
|
|
150
162
|
$ rake noid:rails:migrate:database_to_file
|
151
163
|
```
|
152
164
|
|
153
|
-
|
165
|
+
#### Identifier template
|
154
166
|
|
155
167
|
To override the default identifier pattern -- a nine-character string consisting of two alphanumeric digits, two numeric digits, two alphanumeric digits, two numeric digits, and a check digit -- put the following code in e.g. `config/initializers/noid-rails.rb`:
|
156
168
|
|
@@ -164,7 +176,7 @@ end
|
|
164
176
|
|
165
177
|
For more information about the format of Noid patterns, see pages 8-10 of the [Noid documentation](https://wiki.ucop.edu/download/attachments/16744482/noid.pdf).
|
166
178
|
|
167
|
-
|
179
|
+
#### Custom minters
|
168
180
|
|
169
181
|
If you don't want your minter's state to be persisted, you may also write and configure your own minter. First write up a minter class that looks like the following:
|
170
182
|
|
@@ -204,11 +216,11 @@ And the service will delegate minting and validating to an instance of your cust
|
|
204
216
|
|
205
217
|
# Help
|
206
218
|
|
207
|
-
|
219
|
+
The Samvera community is here to help. Please see our [support guide](./SUPPORT.md).
|
208
220
|
|
209
221
|
# Acknowledgments
|
210
222
|
|
211
|
-
This software has been developed by and is brought to you by the
|
212
|
-
[
|
223
|
+
This software has been developed by and is brought to you by the Samvera community. Learn more at the
|
224
|
+
[Samvera website](http://samvera.org/).
|
213
225
|
|
214
|
-
![
|
226
|
+
![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/noid-rails/issues/) to see if someone else has already reported it, and then feel free to [create a new issue](https://github.com/samvera/noid-rails/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/lib/noid/rails/config.rb
CHANGED
data/lib/noid/rails/version.rb
CHANGED
data/noid-rails.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency 'bundler', '~> 1.7'
|
25
25
|
spec.add_development_dependency 'engine_cart', '~> 1.0'
|
26
26
|
spec.add_development_dependency 'rake', '>= 11'
|
27
|
-
spec.add_development_dependency 'rspec', '~> 3.
|
27
|
+
spec.add_development_dependency 'rspec', '~> 3.8'
|
28
28
|
spec.add_development_dependency 'rubocop', '~> 0.52.0'
|
29
29
|
spec.add_development_dependency 'rubocop-rspec', '~> 1.20.1'
|
30
30
|
spec.add_development_dependency 'sqlite3'
|
data/spec/spec_helper.rb
CHANGED
@@ -10,7 +10,12 @@ if coverage_needed?
|
|
10
10
|
require 'simplecov'
|
11
11
|
require 'coveralls'
|
12
12
|
SimpleCov.root(File.expand_path('../..', __FILE__))
|
13
|
-
SimpleCov.formatter =
|
13
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
|
14
|
+
[
|
15
|
+
SimpleCov::Formatter::HTMLFormatter,
|
16
|
+
Coveralls::SimpleCov::Formatter
|
17
|
+
]
|
18
|
+
)
|
14
19
|
SimpleCov.start('rails') do
|
15
20
|
add_filter '/.internal_test_app'
|
16
21
|
add_filter '/lib/generators'
|
data/spec/unit/config_spec.rb
CHANGED
@@ -7,6 +7,7 @@ RSpec.describe Noid::Rails::Config do
|
|
7
7
|
it { is_expected.to respond_to(:statefile) }
|
8
8
|
it { is_expected.to respond_to(:namespace) }
|
9
9
|
it { is_expected.to respond_to(:minter_class) }
|
10
|
+
it { is_expected.to respond_to(:identifier_in_use) }
|
10
11
|
|
11
12
|
describe '#template' do
|
12
13
|
let(:default) { '.reeddeeddk' }
|
@@ -42,4 +43,30 @@ RSpec.describe Noid::Rails::Config do
|
|
42
43
|
end
|
43
44
|
end
|
44
45
|
end
|
46
|
+
|
47
|
+
describe '#identifier_in_use' do
|
48
|
+
it 'defaults to always return false' do
|
49
|
+
expect(subject.identifier_in_use.call('NEW_ID')).to be false
|
50
|
+
expect(subject.identifier_in_use.call('EXISTING_ID')).to be false
|
51
|
+
end
|
52
|
+
|
53
|
+
context 'when overridden' do
|
54
|
+
let(:override_check) do
|
55
|
+
lambda do |id|
|
56
|
+
return true if id == 'EXISTING_ID'
|
57
|
+
false
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
before { subject.identifier_in_use = override_check }
|
62
|
+
|
63
|
+
it 'returns false if id does not exist' do
|
64
|
+
expect(subject.identifier_in_use.call('NEW_ID')).to be false
|
65
|
+
end
|
66
|
+
|
67
|
+
it 'returns true if id exists' do
|
68
|
+
expect(subject.identifier_in_use.call('EXISTING_ID')).to be true
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
45
72
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: noid-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael J. Giarlo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -92,14 +92,14 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '3.
|
95
|
+
version: '3.8'
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '3.
|
102
|
+
version: '3.8'
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: rubocop
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -149,16 +149,19 @@ executables: []
|
|
149
149
|
extensions: []
|
150
150
|
extra_rdoc_files: []
|
151
151
|
files:
|
152
|
+
- ".coveralls.yml"
|
152
153
|
- ".gitignore"
|
153
154
|
- ".rspec"
|
154
155
|
- ".rubocop.yml"
|
155
156
|
- ".rubocop_todo.yml"
|
156
157
|
- ".travis.yml"
|
158
|
+
- CODE_OF_CONDUCT.md
|
157
159
|
- CONTRIBUTING.md
|
158
160
|
- Gemfile
|
159
161
|
- LICENSE
|
160
162
|
- README.md
|
161
163
|
- Rakefile
|
164
|
+
- SUPPORT.md
|
162
165
|
- app/models/minter_state.rb
|
163
166
|
- db/migrate/20160610010003_create_minter_states.rb
|
164
167
|
- db/migrate/20161021203429_rename_minter_state_random_to_rand.rb
|
@@ -207,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
210
|
version: '0'
|
208
211
|
requirements: []
|
209
212
|
rubyforge_project:
|
210
|
-
rubygems_version: 2.
|
213
|
+
rubygems_version: 2.6.14
|
211
214
|
signing_key:
|
212
215
|
specification_version: 4
|
213
216
|
summary: Noid identifier services for Rails-based applications
|