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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff8d6f8a690c5b342a861c193d2a92bd44e7a566
4
- data.tar.gz: 4ecb864c32c56954b329499356bd3a42294645f6
3
+ metadata.gz: 0ee10a504b080072f5f8a39162d3214a329b0984
4
+ data.tar.gz: 3049ed21366a33d4b5dc3d91cc96c1ffe59529ac
5
5
  SHA512:
6
- metadata.gz: 0e149987bd0d758fcf5776d31bbe1413eb0345ceb0c00d8a7ca79ff7ee768af2304470e27841ff55b9fb554d107918cbd66143de93bb709b158ba33311851817
7
- data.tar.gz: ea4c9b11477f8685c915773ba4246ecc518f959bf0ebda548dbf4590f73aad5b363639329b6d147bc2ccee03d9b7148eb474de0c27f2f1b30ad1339051d292ac
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.3)
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.13.6
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
@@ -1,3 +1,3 @@
1
1
  module Cirneco
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cirneco
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner