dblpbib 0.1.1 → 0.1.2
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/exe/dblpbib +11 -2
- data/lib/dblpbib/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: bb11cff6e6c5a5e0de7753492269103463c2b753
|
4
|
+
data.tar.gz: 5cbb10562d0aaef481877c4140c14586be213ebd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5baf4207f01cf850b81c8c94d41ac66ffe9781437708848873211bd6e0358569131e102020342a28263584e40cf2f9c961b4fc2de4c88700ef054921bac04c5c
|
7
|
+
data.tar.gz: 1b25c34e76671e71b01cea6d18ae81d54eb2326021458f9ef4183d4ceb5270ba45fe2b41a828c8822e9c5e065990792c393a6e94085280477e4eddd8bcf18da1
|
data/exe/dblpbib
CHANGED
@@ -26,6 +26,8 @@ class DBLPCLI
|
|
26
26
|
.map(&:pop)
|
27
27
|
.flat_map { |keyset| keyset.split(',') }
|
28
28
|
.map(&:strip)
|
29
|
+
.keep_if { |key| key.start_with?('DBLP:') }
|
30
|
+
.map { |key| key.sub('DBLP:', '') }
|
29
31
|
end
|
30
32
|
|
31
33
|
def bib_path(cache, key)
|
@@ -47,7 +49,6 @@ class DBLPCLI
|
|
47
49
|
FileUtils.mkdir_p(options.cache)
|
48
50
|
|
49
51
|
keys = get_keys(args[0])
|
50
|
-
puts keys.inspect
|
51
52
|
|
52
53
|
keys.each do |key|
|
53
54
|
path = bib_path(options.cache, key)
|
@@ -56,7 +57,13 @@ class DBLPCLI
|
|
56
57
|
puts "Fetching #{key}"
|
57
58
|
|
58
59
|
FileUtils.mkdir_p(File.dirname(path))
|
59
|
-
|
60
|
+
|
61
|
+
begin
|
62
|
+
File.write(path, open("http://dblp.uni-trier.de/rec/bib1/#{key}.bib").read)
|
63
|
+
rescue OpenURI::HTTPError => e
|
64
|
+
puts "Failed to fetch key #{key} (#{e}) -- perhaps it is misspelled or doesn't exist?"
|
65
|
+
exit 1
|
66
|
+
end
|
60
67
|
|
61
68
|
# TODO: crossrefs! When I got here I actually realized the 'standard' output is perfectly OK for most situations...
|
62
69
|
end
|
@@ -68,6 +75,8 @@ class DBLPCLI
|
|
68
75
|
keys.each do |key|
|
69
76
|
output.write(File.read(bib_path(options.cache, key)))
|
70
77
|
end
|
78
|
+
|
79
|
+
puts "OK. Compiled #{keys.count} entries to #{output.path}"
|
71
80
|
end
|
72
81
|
end
|
73
82
|
end
|
data/lib/dblpbib/version.rb
CHANGED