dblp 0.3.2 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
File without changes
data/License.txt CHANGED
File without changes
data/Manifest.txt CHANGED
File without changes
data/PostInstall.txt CHANGED
File without changes
data/README.txt CHANGED
File without changes
data/Rakefile CHANGED
File without changes
data/bin/dblp CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby
1
+ #! /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
2
2
  #
3
3
  # Created on 2008-5-28.
4
4
  # Copyright (c) 2008. All rights reserved.
data/config/hoe.rb CHANGED
File without changes
File without changes
data/lib/dblp/grabber.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  require 'open-uri'
2
2
 
3
+
4
+
3
5
  module Dblp
4
6
 
5
7
  class Grabber
@@ -17,13 +19,23 @@ module Dblp
17
19
 
18
20
  def extract_pre(content)
19
21
  # extract the bibtex code, that is in pre tags
20
- result = content.scan(/<pre>(.*?)<.pre>/mix)
21
- if result
22
- result.inject([]) do |m, k|
23
- #m[k[0].match(/@.*\{(.*?),/)[1].gsub(/(<.*?>)/, "")] = k[0].gsub(/(<.*?>)/, "")
24
- m << k[0].gsub(/(<.*?>)/, "")
25
- m
22
+ pres = content.scan(/<pre>(.*?)<.pre>/mix)
23
+
24
+ if pres
25
+
26
+ # First handle main entry
27
+ result = []
28
+ result << pres[0][0].gsub(/(<.*?>)/, "").gsub(/^\s+title\s+=\s+\{(.*?)\},/m, " title = {{\\1}},")
29
+
30
+ # Find the crossref
31
+ if pres.size > 1
32
+ booktitle = pres[1][0].match(/^\s+title\s+=\s+\{(.*?)\},/m)
33
+ if booktitle
34
+ result[0].gsub!(/^\s+booktitle\s+=\s+\{(.*?)\},/m, " booktitle = {{#{booktitle[1]}}},")
35
+ result[0].gsub!(/^\s+crossref\s+=\s+\{(.*?)\},/m, "")
36
+ end
26
37
  end
38
+ result
27
39
  else
28
40
  []
29
41
  end
@@ -37,7 +49,8 @@ module Dblp
37
49
  content = read_html(DBLP_URL + key.gsub("DBLP:", ""))
38
50
  extract_pre(content)
39
51
  else
40
- CiteseerGrabber.new.grab(key)
52
+ #CiteseerGrabber.new.grab(key)
53
+ []
41
54
  end
42
55
  rescue
43
56
  []
@@ -61,4 +74,4 @@ module Dblp
61
74
 
62
75
  end
63
76
 
64
- end
77
+ end
data/lib/dblp/parser.rb CHANGED
File without changes
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 = 3
5
- TINY = 2
4
+ MINOR = 4
5
+ TINY = 4
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/lib/dblp.rb CHANGED
@@ -4,6 +4,7 @@ $:.unshift(File.dirname(__FILE__)) unless
4
4
  require File.dirname(__FILE__) + '/dblp/parser'
5
5
  require File.dirname(__FILE__) + '/dblp/grabber'
6
6
 
7
+
7
8
  module Dblp
8
9
 
9
10
  class << self
data/setup.rb CHANGED
File without changes
File without changes
File without changes
data/tasks/website.rake CHANGED
File without changes
data/test/test.aux CHANGED
File without changes
data/test/test_dblp.rb CHANGED
@@ -21,7 +21,7 @@ class TestDblp < Test::Unit::TestCase
21
21
  g = Dblp::Grabber.new
22
22
 
23
23
  res = g.grab("DBLP:conf/btw/JacobsA07")
24
- assert res.size == 2
24
+ assert res.size == 1
25
25
 
26
26
  res = g.grab("DBLP:conf/icde/ZukowskiHNB06")
27
27
 
@@ -30,15 +30,15 @@ class TestDblp < Test::Unit::TestCase
30
30
  end
31
31
 
32
32
 
33
- def test_citeseer
33
+ # def test_citeseer
34
34
 
35
- g = Dblp::CiteseerGrabber.new
36
- res = g.grab("graefe91data")
37
- assert res.size == 1
35
+ # g = Dblp::CiteseerGrabber.new
36
+ # res = g.grab("graefe91data")
37
+ # assert res.size == 1
38
38
 
39
- res = g.grab("nixnurnix")
40
- assert res.size == 0
39
+ # res = g.grab("nixnurnix")
40
+ # assert res.size == 0
41
41
 
42
- end
42
+ # end
43
43
 
44
44
  end
data/test/test_helper.rb CHANGED
File without changes
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.3.2
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Grund
@@ -9,10 +9,29 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-06-12 00:00:00 +02:00
12
+ date: 2010-10-10 00:00:00 +02:00
13
13
  default_executable:
14
- dependencies: []
15
-
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rubyforge
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 2.0.4
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: hoe
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 2.6.2
34
+ version:
16
35
  description: Dynamically generate the bibtex file from your citations
17
36
  email:
18
37
  - grundprinzip@gmail.com
@@ -49,6 +68,8 @@ files:
49
68
  - test/test_helper.rb
50
69
  has_rdoc: true
51
70
  homepage: http://blog.grundprinzip.de
71
+ licenses: []
72
+
52
73
  post_install_message: |+
53
74
 
54
75
  For more information on dblp, see http://dblp.rubyforge.org
@@ -77,9 +98,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
98
  requirements: []
78
99
 
79
100
  rubyforge_project: rug-b
80
- rubygems_version: 1.0.1
101
+ rubygems_version: 1.3.5
81
102
  signing_key:
82
- specification_version: 2
103
+ specification_version: 3
83
104
  summary: Dynamically generate the bibtex file from your citations
84
105
  test_files:
85
106
  - test/test_dblp.rb