cirneco 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/cirneco/doi.rb +15 -0
- data/lib/cirneco/utils.rb +2 -1
- 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: 0ee10a504b080072f5f8a39162d3214a329b0984
|
4
|
+
data.tar.gz: 3049ed21366a33d4b5dc3d91cc96c1ffe59529ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e50ef5e66962d94abeaa63e2393dfb9ffc59d70091119aef254de4578dfdfbc840ecddd216e259136950632b83ed50b5e66434611a1deac9b413befe8499b930
|
7
|
+
data.tar.gz: db865c76ed473557205febd2f62c7f31c2a7f2d9511b3bc5613ec287e48613a02232979849ceb1bc5514a660d060e6ae2126117744b745193ebcc69e05b2bd0c
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cirneco (0.5.
|
4
|
+
cirneco (0.5.4)
|
5
5
|
activesupport (~> 4.2, >= 4.2.5)
|
6
6
|
base32-crockford-checksum (~> 0.2.2)
|
7
7
|
bergamasco (~> 0.1.1)
|
@@ -128,4 +128,4 @@ DEPENDENCIES
|
|
128
128
|
webmock (~> 1.22, >= 1.22.3)
|
129
129
|
|
130
130
|
BUNDLED WITH
|
131
|
-
1.
|
131
|
+
1.12.5
|
data/lib/cirneco/doi.rb
CHANGED
@@ -62,5 +62,20 @@ module Cirneco
|
|
62
62
|
|
63
63
|
puts response
|
64
64
|
end
|
65
|
+
|
66
|
+
desc "unregister DOCUMENTS", "unregister documents"
|
67
|
+
method_option :username, :default => ENV['MDS_USERNAME']
|
68
|
+
method_option :password, :default => ENV['MDS_PASSWORD']
|
69
|
+
method_option :sandbox, :default => ENV['SANDBOX']
|
70
|
+
def unregister(filepath)
|
71
|
+
|
72
|
+
if File.directory?(filepath)
|
73
|
+
response = register_all_files(filepath, options.merge(unregister: true))
|
74
|
+
else
|
75
|
+
response = register_file(filepath, options.merge(unregister: true))
|
76
|
+
end
|
77
|
+
|
78
|
+
puts response
|
79
|
+
end
|
65
80
|
end
|
66
81
|
end
|
data/lib/cirneco/utils.rb
CHANGED
@@ -23,7 +23,7 @@ module Cirneco
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def encode_doi(prefix, options={})
|
26
|
-
number = options[:number] || SecureRandom.random_number(UPPER_LIMIT)
|
26
|
+
number = options[:number] || SecureRandom.random_number(UPPER_LIMIT).to_i
|
27
27
|
prefix.to_s + "/" + Base32::Crockford.encode(number, split: 4, length: 8, checksum: true)
|
28
28
|
end
|
29
29
|
|
@@ -33,6 +33,7 @@ module Cirneco
|
|
33
33
|
return "File #{filename} ignored: not a markdown file" unless File.extname(filepath) == ".md"
|
34
34
|
|
35
35
|
file = IO.read(filepath)
|
36
|
+
|
36
37
|
if options[:unregister]
|
37
38
|
doi = nil
|
38
39
|
else
|
data/lib/cirneco/version.rb
CHANGED