dblp 0.5.9 → 0.5.10

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.
data/bin/dblp CHANGED
@@ -13,6 +13,7 @@ options = OpenStruct.new
13
13
  options.output = "dblp.bib"
14
14
  options.bibtex = true
15
15
  options.crossref = false
16
+ options.short = false
16
17
 
17
18
  if ARGV.size == 0
18
19
  ARGV << "-h"
data/lib/dblp/grabber.rb CHANGED
@@ -43,16 +43,20 @@ module Dblp
43
43
  if pres.size > 1
44
44
 
45
45
  if @options && @options.crossref
46
- result << pres[1][0].gsub(/(<.*?>)/, "").gsub(/^\s+title\s+=\s+\{(.*?)\},/m, " title = {{\\1}},")
46
+ result << pres[1][0].gsub(/(<.*?>)/, "").gsub(/^\s+title\s+=\s+\{(.*?)\},$/m, " title = {{\\1}},")
47
47
  else
48
- booktitle = pres[1][0].match(/^\s+title\s+=\s+\{(.*?)\},/m)
48
+ booktitle = pres[1][0].match(/^\s+title\s+=\s+\{(.*?)\},$/m)
49
+
49
50
 
50
51
  # If we find a booktitle, replace the book title with the
51
52
  # one from the crossref
52
53
  if booktitle
53
- unless @options.short
54
- result[0].gsub!(/^\s+booktitle\s+=\s+\{(.*?)\},/m, " booktitle = {{#{booktitle[1]}}},")
55
- end
54
+ unless @options.short
55
+ cleantitle = booktitle[1].gsub(/\n|\t|\s+/, " ")
56
+ result[0].gsub!(/^\s+booktitle\s+=\s+\{(.*?)\},$/m){|match|
57
+ " booktitle = {{#{cleantitle}}},"
58
+ }
59
+ end
56
60
 
57
61
  publisher = pres[1][0].match(/^\s+publisher\s+=\s+\{(.*?)\},/m)
58
62
  publisher_data = publisher ? " publisher = {{#{publisher[1]}}}," : ""
data/lib/dblp/version.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  module Dblp #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 4
5
- TINY = 5
4
+ MINOR = 5
5
+ TINY = 10
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dblp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.9
4
+ version: 0.5.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-11 00:00:00.000000000 Z
12
+ date: 2012-12-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json