hydra-remote_identifier 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd5ebaf5e75ba163755a2f32c2c68be67356055c
4
- data.tar.gz: 044e7aa00ad6079cb05f47251b48782b29061fe3
3
+ metadata.gz: 3ad9b2a31edae34b37fafca1d7cef7292ff37bab
4
+ data.tar.gz: 65e362d4c8eec8f4c1ecc20bcdf7fb75f5bb0c4c
5
5
  SHA512:
6
- metadata.gz: e3fe0b25361efc0dad12e9cd85587423221412acea745ba7df2145e85ec387108e1518bb929bdc0a05d820fccfe28c77485dc949d58fd89002458d4887531fa6
7
- data.tar.gz: ca390ae0f68802254da1839102e468fe69d81ddb21a59a38902ac1c51ffa8a2557d79eae83623d209c67c3fd6ae68a62926651fca457826708cf02fcce97c717
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 call when DOI is set"
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.load("/path/to/doi_credentials.yml")'
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(configuration = {})
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)
@@ -1,5 +1,5 @@
1
1
  module Hydra
2
2
  module RemoteIdentifier
3
- VERSION = "0.5.2"
3
+ VERSION = "0.5.3"
4
4
  end
5
5
  end
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.2
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-09 00:00:00.000000000 Z
11
+ date: 2013-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport