active_fedora-noid 2.0.0.beta4 → 2.0.0.beta5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -6
- data/lib/active_fedora/noid/config.rb +1 -1
- data/lib/active_fedora/noid/rspec.rb +7 -0
- data/lib/active_fedora/noid/version.rb +1 -1
- data/spec/unit/config_spec.rb +1 -1
- data/spec/unit/service_spec.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46a4ec828c77c893dd8fade4ab2cc8bf69c1a5d2
|
4
|
+
data.tar.gz: d711fda28782d2a779cd3cc0a50e1b8d42aae48f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5306a476358ae3063a3b5bac116c4c33fdf242638837dcd571558f7b72d28ada8511ba5bbbe97d263a5e4c2b14ed727ac810ab63ffd85da90ffb52cce2114f74
|
7
|
+
data.tar.gz: a048a5717613df9efafc4f525d6ce5693ce52c2b9e087fe0602eab09d45d6521ab74f1a69655fe36322f5e2b85355698497215b35f1ef96866a951a328e1c9ac
|
data/README.md
CHANGED
@@ -97,22 +97,23 @@ This will make sure your objects have Noid-like identifiers (e.g. `bb22bb22b`) t
|
|
97
97
|
|
98
98
|
## Overriding default behavior
|
99
99
|
|
100
|
-
The default minter in ActiveFedora::Noid 2.x is the
|
100
|
+
The default minter in ActiveFedora::Noid 2.x is the file-backed minter to preserve default behavior.
|
101
101
|
|
102
|
-
|
102
|
+
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.
|
103
103
|
|
104
|
-
|
104
|
+
### Use database-based minter state
|
105
|
+
|
106
|
+
The database-based minter stores minter state information in your application's relational database. To use it, override the AF::Noid configuration in e.g. `config/initializers/active_fedora-noid.rb`:
|
105
107
|
|
106
108
|
```ruby
|
107
109
|
require 'active_fedora/noid'
|
108
110
|
|
109
111
|
ActiveFedora::Noid.configure do |config|
|
110
|
-
config.minter_class = ActiveFedora::Noid::Minter::
|
111
|
-
config.statefile = '/var/foo/bar'
|
112
|
+
config.minter_class = ActiveFedora::Noid::Minter::Db
|
112
113
|
end
|
113
114
|
```
|
114
115
|
|
115
|
-
**NOTE**: If you switch to a new minter, it will not automatically start with the same state as the old minter. AF::Noid does include a couple of rake tasks for copying state from database-backed minters to file-backed ones and vice versa:
|
116
|
+
**NOTE 1**: If you switch to a new minter, it will not automatically start with the same state as the old minter. AF::Noid does include a couple of rake tasks for copying state from database-backed minters to file-backed ones and vice versa:
|
116
117
|
|
117
118
|
``` bash
|
118
119
|
# For migrating minter state from a file to a database
|
@@ -121,6 +122,12 @@ $ rake active_fedora:noid:migrate:file_to_database
|
|
121
122
|
$ rake active_fedora:noid:migrate:database_to_file
|
122
123
|
```
|
123
124
|
|
125
|
+
**NOTE 2**: If you decide to use the database-backed minter, you may notice that your test suite now fails miserably if it is configured to clear out the application database between tests. If so, you may add the following to e.g. `spec/spec_helper.rb` to set the default minter in the test suite as the file-backed one:
|
126
|
+
|
127
|
+
``` ruby
|
128
|
+
require 'active_fedora/noid/rspec'
|
129
|
+
```
|
130
|
+
|
124
131
|
### Identifier template
|
125
132
|
|
126
133
|
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/active_fedora-noid.rb`:
|
data/spec/unit/config_spec.rb
CHANGED
data/spec/unit/service_spec.rb
CHANGED
@@ -5,7 +5,7 @@ describe ActiveFedora::Noid::Service do
|
|
5
5
|
end
|
6
6
|
|
7
7
|
it 'has a default minter' do
|
8
|
-
expect(subject.minter).to be_instance_of ActiveFedora::Noid::Minter::
|
8
|
+
expect(subject.minter).to be_instance_of ActiveFedora::Noid::Minter::File
|
9
9
|
end
|
10
10
|
|
11
11
|
context 'with a custom minter' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_fedora-noid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.beta5
|
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: 2016-10-
|
11
|
+
date: 2016-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active-fedora
|
@@ -160,6 +160,7 @@ files:
|
|
160
160
|
- lib/active_fedora/noid/minter/base.rb
|
161
161
|
- lib/active_fedora/noid/minter/db.rb
|
162
162
|
- lib/active_fedora/noid/minter/file.rb
|
163
|
+
- lib/active_fedora/noid/rspec.rb
|
163
164
|
- lib/active_fedora/noid/service.rb
|
164
165
|
- lib/active_fedora/noid/version.rb
|
165
166
|
- lib/generators/active_fedora/noid/install_generator.rb
|