nist-pubid 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/nist-pubid +34 -9
- data/lib/nist_pubid/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f6379a8019bfb88a5197b581ff3e479f76e4bc9d3c5c7305b8875c88aee54de
|
4
|
+
data.tar.gz: 8f6be1a669a2f215b846360fd7d475872a0ae084ba39b251e1a264636c2afc8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3f46dfe0b0123faccd91f54133870800da21671b1487858e4121187eb15785d567303ab1e3883e6dc4f94e40b4b54ac8900745987c0c8c6ac79b4b6a8c294c8
|
7
|
+
data.tar.gz: 87c323d372da641c4d1ba4c1a8c7c7b7c15324b1a84ca8b31ca419b6debfe611f924d73f7299184ce55abf1f90a9b35baeedd62354f55b8319024975c9f9eac1
|
data/exe/nist-pubid
CHANGED
@@ -10,17 +10,42 @@ class NistPubidCLI < Thor
|
|
10
10
|
desc "report", "Create report for NIST Tech Pubs database (fetches from GitHub)"
|
11
11
|
option :csv, type: :boolean, desc: "Export to CSV format"
|
12
12
|
def report
|
13
|
+
heading = %w(
|
14
|
+
ID\ changed?
|
15
|
+
New\ PubID
|
16
|
+
Document\ ID
|
17
|
+
DOI\ changed?
|
18
|
+
New\ PubID-MR
|
19
|
+
DOI
|
20
|
+
Title
|
21
|
+
)
|
13
22
|
if options[:csv]
|
23
|
+
puts heading.to_csv
|
24
|
+
|
14
25
|
NistPubid::NistTechPubs.status.each do |doc|
|
15
|
-
puts [
|
16
|
-
|
17
|
-
|
26
|
+
puts [
|
27
|
+
doc[:finalPubId] == doc[:id] ? false : true,
|
28
|
+
doc[:finalPubId],
|
29
|
+
doc[:id],
|
30
|
+
doc[:mr] == doc[:doi] ? false : true,
|
31
|
+
doc[:mr],
|
32
|
+
doc[:doi],
|
33
|
+
doc[:title]
|
34
|
+
].to_csv
|
18
35
|
end
|
19
36
|
else
|
20
|
-
puts
|
37
|
+
puts heading.join(' | ')
|
38
|
+
|
21
39
|
NistPubid::NistTechPubs.status.each do |doc|
|
22
|
-
puts
|
23
|
-
|
40
|
+
puts [
|
41
|
+
doc[:finalPubId] == doc[:id] ? ' -' : '✅',
|
42
|
+
doc[:finalPubId],
|
43
|
+
doc[:id],
|
44
|
+
doc[:mr] == doc[:doi] ? ' -' : '✅',
|
45
|
+
doc[:mr],
|
46
|
+
doc[:doi],
|
47
|
+
doc[:title]
|
48
|
+
].join(' | ')
|
24
49
|
end
|
25
50
|
end
|
26
51
|
end
|
@@ -30,14 +55,14 @@ class NistPubidCLI < Thor
|
|
30
55
|
desc: "Convert to PubID style (short|long|mr|abbrev)",
|
31
56
|
default: "short"
|
32
57
|
option :format, aliases: "-f", type: :string,
|
33
|
-
desc: "Render in format (
|
58
|
+
desc: "Render in format (json|string)",
|
34
59
|
default: "string"
|
35
60
|
def convert(code)
|
36
|
-
unless %w[mr long short abbrev].include?(options[:style])
|
61
|
+
unless %w[mr long short abbrev].include?(options[:style].downcase)
|
37
62
|
raise "Invalid PubID style"
|
38
63
|
end
|
39
64
|
|
40
|
-
raise "
|
65
|
+
raise "Invalid render format" unless %w[string json].include? options[:format].downcase
|
41
66
|
|
42
67
|
unless code.empty?
|
43
68
|
if options[:format] == "string"
|
data/lib/nist_pubid/version.rb
CHANGED