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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 709c8e18225adbbd00041373fc45c436166ffa50
4
- data.tar.gz: 4b4a569df3483bf994dc154ed986fc4bf700561c
3
+ metadata.gz: 46a4ec828c77c893dd8fade4ab2cc8bf69c1a5d2
4
+ data.tar.gz: d711fda28782d2a779cd3cc0a50e1b8d42aae48f
5
5
  SHA512:
6
- metadata.gz: 8ad9a677d42550c1fa40545ab19b5f872da006971a73cdbe9cf8788667316da5fee10541779f155d156ba772eca59f79d0a9c7db5262c07bb97e0f0320b506d1
7
- data.tar.gz: db77507d045c565b2c7aa1ea351f4112405f0dcbaef0f47081f5589e6a56c2099cb1639dd6fda906ac621ec9a30a4229c3607db728a676674f01fa770159477d
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 database-backed minter 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).
100
+ The default minter in ActiveFedora::Noid 2.x is the file-backed minter to preserve default behavior.
101
101
 
102
- ### Use file-based minter state (for replayability)
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
- The file-based minter -- which was the default and only minter in 1.x -- creates a Noid and dumps it to a statefile in the /tmp directory. You can override the location or name of this statefile as follows in e.g. `config/initializers/active_fedora-noid.rb`:
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::File
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`:
@@ -17,7 +17,7 @@ module ActiveFedora
17
17
  end
18
18
 
19
19
  def minter_class
20
- @minter_class ||= Minter::Db
20
+ @minter_class ||= Minter::File
21
21
  end
22
22
 
23
23
  def translate_uri_to_id
@@ -0,0 +1,7 @@
1
+ RSpec.configure do |config|
2
+ config.before(:suite) do
3
+ ActiveFedora::Noid.configure do |noid_config|
4
+ noid_config.minter_class = ActiveFedora::Noid::Minter::File
5
+ end
6
+ end
7
+ end
@@ -1,5 +1,5 @@
1
1
  module ActiveFedora
2
2
  module Noid
3
- VERSION = '2.0.0.beta4'.freeze
3
+ VERSION = '2.0.0.beta5'.freeze
4
4
  end
5
5
  end
@@ -27,7 +27,7 @@ describe ActiveFedora::Noid::Config do
27
27
  end
28
28
 
29
29
  describe '#minter_class' do
30
- let(:default) { ActiveFedora::Noid::Minter::Db }
30
+ let(:default) { ActiveFedora::Noid::Minter::File }
31
31
 
32
32
  it 'has a default' do
33
33
  expect(subject.minter_class).to eq default
@@ -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::Db
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.beta4
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-21 00:00:00.000000000 Z
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