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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/exe/dblpbib +11 -2
  3. data/lib/dblpbib/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c64fe42d8ab66c81dd9ebf5e80872f795952a78
4
- data.tar.gz: 9bf6a593a2e3bda4fc653f28988f366cab5b37a8
3
+ metadata.gz: bb11cff6e6c5a5e0de7753492269103463c2b753
4
+ data.tar.gz: 5cbb10562d0aaef481877c4140c14586be213ebd
5
5
  SHA512:
6
- metadata.gz: 3047826951687c5bbd95f6a1d1b3d1e9643c61c0a4065bafaab430363ecb31bd27ec541b31f83c9dc30308abcf621a6ea3cc21597bdab853c71d10e4fbe2f05c
7
- data.tar.gz: 2c226587e17ac44f69af2bdf5bdbaf6d4ef4542924a9c9173a62ad9e54af8196ebc29e0ed29faf644e962a2b96f796febb9fd45ef1062057317d9fba274ce800
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
- File.write(path, open("http://dblp.uni-trier.de/rec/bib1/#{key}.bib").read)
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
@@ -1,4 +1,4 @@
1
1
  module Dblpbib
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  DESCRIPTION = %q{Automatically create bibliographies for BibTeX DBLP references.}
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dblpbib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - PJK