cirneco 0.9.10 → 0.9.11
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 +4 -4
- data/Gemfile.lock +2 -2
- data/lib/cirneco/doi.rb +3 -0
- data/lib/cirneco/utils.rb +3 -3
- data/lib/cirneco/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13e62151343da8f6195f5b69a0ab12f78ae00a70
|
4
|
+
data.tar.gz: f767c3c49e1bf5b346203b74e15818d97a353084
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae943d1a2a749c0b681f9c09a5ae62527cebf10bc88433feb2dee664f59749719eb8539b4613c8ca743bc602699ab0c3575c518bbfb223154ef7d8b8650b8645
|
7
|
+
data.tar.gz: 98d88a73500f5244578bebd50fc24c9c6563e7e3dcb2a7cc79b691ca744e79a179ba06cf48430b134cf079e2e99a9f0bae83cf434df798c6a908182d1cce008d
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cirneco (0.9.
|
4
|
+
cirneco (0.9.11)
|
5
5
|
activesupport (~> 4.2, >= 4.2.5)
|
6
6
|
base32-crockford-checksum (~> 0.2.2)
|
7
7
|
bergamasco (~> 0.3)
|
@@ -122,4 +122,4 @@ DEPENDENCIES
|
|
122
122
|
webmock (~> 1.22, >= 1.22.3)
|
123
123
|
|
124
124
|
BUNDLED WITH
|
125
|
-
1.
|
125
|
+
1.13.6
|
data/lib/cirneco/doi.rb
CHANGED
@@ -114,6 +114,7 @@ module Cirneco
|
|
114
114
|
method_option :password, :default => ENV['MDS_PASSWORD']
|
115
115
|
method_option :prefix, :default => ENV['PREFIX']
|
116
116
|
method_option :sandbox, :type => :boolean, :force => false
|
117
|
+
method_option :force, :type => :boolean, :force => false
|
117
118
|
def mint(url)
|
118
119
|
response = mint_dois_for_all_urls(url, options)
|
119
120
|
puts response
|
@@ -132,6 +133,7 @@ module Cirneco
|
|
132
133
|
method_option :password, :default => ENV['MDS_PASSWORD']
|
133
134
|
method_option :prefix, :default => ENV['PREFIX']
|
134
135
|
method_option :sandbox, :type => :boolean, :force => false
|
136
|
+
method_option :force, :type => :boolean, :force => false
|
135
137
|
def mint_and_hide(url)
|
136
138
|
response = mint_and_hide_dois_for_all_urls(url, options)
|
137
139
|
puts response
|
@@ -149,6 +151,7 @@ module Cirneco
|
|
149
151
|
method_option :username, :default => ENV['MDS_USERNAME']
|
150
152
|
method_option :password, :default => ENV['MDS_PASSWORD']
|
151
153
|
method_option :sandbox, :type => :boolean, :force => false
|
154
|
+
method_option :force, :type => :boolean, :force => false
|
152
155
|
def hide(url)
|
153
156
|
response = hide_dois_for_all_urls(url, options)
|
154
157
|
puts response
|
data/lib/cirneco/utils.rb
CHANGED
@@ -108,7 +108,7 @@ module Cirneco
|
|
108
108
|
filename, build_path, source_path = filepath_from_url(url, options)
|
109
109
|
|
110
110
|
metadata = generate_metadata_for_work(build_path, options)
|
111
|
-
return "DOI #{metadata["doi"]} not changed for #{filename}" if metadata["doi"] && metadata["date_updated"] == metadata["date_issued"]
|
111
|
+
return "DOI #{metadata["doi"]} not changed for #{filename}" if metadata["doi"] && metadata["date_updated"] == metadata["date_issued"] && options[:force].blank?
|
112
112
|
|
113
113
|
response = post_metadata_for_work(metadata, options)
|
114
114
|
return "Errors for DOI #{metadata["doi"]}: #{response.body['errors'].first['title']}\n" if response.body['errors'].present?
|
@@ -122,7 +122,7 @@ module Cirneco
|
|
122
122
|
filename, build_path, source_path = filepath_from_url(url, options)
|
123
123
|
|
124
124
|
metadata = generate_metadata_for_work(build_path, options)
|
125
|
-
return "DOI #{metadata["doi"]} not changed for #{filename}" if metadata["doi"] && metadata["date_updated"] == metadata["date_issued"]
|
125
|
+
return "DOI #{metadata["doi"]} not changed for #{filename}" if metadata["doi"] && metadata["date_updated"] == metadata["date_issued"] && options[:force].blank?
|
126
126
|
|
127
127
|
response = post_metadata_for_work(metadata, options)
|
128
128
|
return "Errors for DOI #{metadata["doi"]}: #{response.body['errors'].first['title']}\n" if response.body['errors'].present?
|
@@ -138,7 +138,7 @@ module Cirneco
|
|
138
138
|
|
139
139
|
metadata = generate_metadata_for_work(build_path, options)
|
140
140
|
return "No DOI for #{filename}" unless metadata["doi"]
|
141
|
-
return "DOI #{metadata["doi"]} not active for #{filename}" unless metadata["date_issued"]
|
141
|
+
return "DOI #{metadata["doi"]} not active for #{filename}" unless metadata["date_issued"] || options[:force].present?
|
142
142
|
|
143
143
|
response = hide_metadata_for_work(metadata, options)
|
144
144
|
return "Errors for DOI #{metadata["doi"]}: #{response.body['errors'].first['title']}\n" if response.body['errors'].present?
|
data/lib/cirneco/version.rb
CHANGED