hydra-remote_identifier 0.5.2 → 0.5.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ad9b2a31edae34b37fafca1d7cef7292ff37bab
|
4
|
+
data.tar.gz: 65e362d4c8eec8f4c1ecc20bcdf7fb75f5bb0c4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aeb034f74327c96718859cea5ce998b7ec6f2c01bb4174c625067b44e68120a7e4cb25f4604043d8ce7dac19b03dd8499ece4183909b5f6dc77cf5385c2dc61f
|
7
|
+
data.tar.gz: aa4f0b58c3c76c41222c6485dedc778551401ffbc6a8c06a80b68816af85138e5b1aaafcb7e04cab9a30ce41f6ed2b9992d04eaef9d35a0bec71618680d03825
|
@@ -10,7 +10,7 @@ class Hydra::RemoteIdentifier::DoiGenerator < Rails::Generators::Base
|
|
10
10
|
class_option :title, type: :string, default: ":title", desc: "Title of the created object"
|
11
11
|
class_option :publisher, type: :string, default: ":publisher", desc: "Publisher of the created object"
|
12
12
|
class_option :publication_year, type: :string, default: ":publication_year", desc: "Year the created object was published"
|
13
|
-
class_option :set_identifier, type: :string, default: ":set_doi_identifier", desc: "Method on object to
|
13
|
+
class_option :set_identifier, type: :string, default: ":set_doi_identifier", desc: "Method on object that will be called to both set and persist the newly minted DOI"
|
14
14
|
argument :targets, :type => :array, :default => [], :banner => "class_name class_name"
|
15
15
|
|
16
16
|
def insert_doi
|
@@ -30,6 +30,7 @@ class Hydra::RemoteIdentifier::DoiGenerator < Rails::Generators::Base
|
|
30
30
|
data << %( map.title #{options.fetch('title')})
|
31
31
|
data << %( map.publisher #{options.fetch('publisher')})
|
32
32
|
data << %( map.publicationyear #{options.fetch('publication_year')})
|
33
|
+
data << %( # Make sure that this method both sets the identifier and persists the change!)
|
33
34
|
data << %( map.set_identifier #{options.fetch('set_identifier')})
|
34
35
|
data << %( end)
|
35
36
|
data << %( end)
|
@@ -7,7 +7,7 @@ class Hydra::RemoteIdentifier::InstallGenerator < Rails::Generators::Base
|
|
7
7
|
|
8
8
|
data << '# Register and configure remote identifiers for persisted objects'
|
9
9
|
data << 'Hydra::RemoteIdentifier.configure do |config|'
|
10
|
-
data << ' # doi_credentials = Psych.
|
10
|
+
data << ' # doi_credentials = Psych.load_file("/path/to/doi_credentials.yml")'
|
11
11
|
data << ' # config.remote_service(:doi, doi_credentials) do |doi|'
|
12
12
|
data << ' # doi.register(PersistedObject) do |map|'
|
13
13
|
data << ' # map.target :url'
|
@@ -15,6 +15,8 @@ class Hydra::RemoteIdentifier::InstallGenerator < Rails::Generators::Base
|
|
15
15
|
data << ' # map.title :title'
|
16
16
|
data << ' # map.publisher :publisher'
|
17
17
|
data << ' # map.publicationyear :publicationyear'
|
18
|
+
data << ' #'
|
19
|
+
data << ' # # Make sure that this method persists the value'
|
18
20
|
data << ' # map.set_identifier :set_doi_identifier='
|
19
21
|
data << ' # end'
|
20
22
|
data << ' # end'
|
@@ -15,7 +15,8 @@ module Hydra::RemoteIdentifier
|
|
15
15
|
}
|
16
16
|
|
17
17
|
attr_reader :username, :password, :shoulder, :url
|
18
|
-
def initialize(
|
18
|
+
def initialize(options = {})
|
19
|
+
configuration = options.with_indifferent_access
|
19
20
|
@username = configuration.fetch(:username)
|
20
21
|
@password = configuration.fetch(:password)
|
21
22
|
@shoulder = configuration.fetch(:shoulder)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hydra-remote_identifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Friesen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|