dblp 0.4.5 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/dblp +22 -17
- data/lib/dblp/grabber.rb +32 -6
- data/lib/dblp/query.rb +133 -0
- data/lib/dblp.rb +6 -1
- metadata +40 -109
- data/History.txt +0 -12
- data/License.txt +0 -20
- data/Manifest.txt +0 -20
- data/PostInstall.txt +0 -7
- data/README.txt +0 -46
- data/Rakefile +0 -4
- data/config/hoe.rb +0 -73
- data/config/requirements.rb +0 -15
- data/setup.rb +0 -1585
- data/tasks/deployment.rake +0 -34
- data/tasks/environment.rake +0 -7
- data/tasks/website.rake +0 -17
- data/test/test.aux +0 -56
- data/test/test_dblp.rb +0 -44
- data/test/test_helper.rb +0 -2
data/bin/dblp
CHANGED
@@ -1,29 +1,31 @@
|
|
1
|
-
|
2
|
-
#
|
3
|
-
# Created on 2008-5-28.
|
4
|
-
# Copyright (c) 2008. All rights reserved.
|
5
|
-
|
1
|
+
#!/usr/bin/env ruby
|
6
2
|
begin
|
7
3
|
require 'rubygems'
|
8
4
|
rescue LoadError
|
9
5
|
# no rubygems to load, so we fail silently
|
10
6
|
end
|
11
7
|
|
12
|
-
|
8
|
+
begin
|
9
|
+
require 'dblp'
|
10
|
+
rescue LoadError
|
11
|
+
require File.dirname(__FILE__) + '/../lib/dblp'
|
12
|
+
end
|
13
|
+
|
13
14
|
require 'optparse'
|
14
15
|
require 'ostruct'
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
17
|
+
options = OpenStruct.new
|
18
|
+
options.output = "dblp.bib"
|
19
|
+
options.bibtex = true
|
20
|
+
options.crossref = false
|
19
21
|
|
20
22
|
if ARGV.size == 0
|
21
23
|
ARGV << "-h"
|
22
24
|
end
|
23
25
|
|
24
|
-
unless ARGV[0] == "-h"
|
25
|
-
file_to_parse = ARGV.shift
|
26
|
-
end
|
26
|
+
#unless ARGV[0] == "-h"
|
27
|
+
# file_to_parse = ARGV.shift
|
28
|
+
#end
|
27
29
|
|
28
30
|
OptionParser.new do |opts|
|
29
31
|
|
@@ -38,20 +40,23 @@ BANNER
|
|
38
40
|
opts.separator("Specific Options:")
|
39
41
|
|
40
42
|
opts.on("-o", "--output [FILENAME]", "Specify FILENAME for output instead of dblp.bib") do |fn|
|
41
|
-
|
43
|
+
options.output = fn
|
44
|
+
end
|
45
|
+
|
46
|
+
opts.on("-c", "--[no-]crossref", "Generate full cross-references when fetching the data from DBLP") do |c|
|
47
|
+
options.crossref = c
|
42
48
|
end
|
43
49
|
|
44
50
|
opts.on("-b", "--[no-]bibtex", "Run Bibtex after fetching bib entries") do |b|
|
45
|
-
|
51
|
+
options.bibtex = b
|
46
52
|
end
|
47
53
|
|
48
54
|
opts.on_tail("-h", "--help", "Show this message") do
|
49
55
|
puts opts
|
50
56
|
exit
|
51
57
|
end
|
52
|
-
end.parse!
|
58
|
+
end.parse!(ARGV)
|
53
59
|
|
60
|
+
Dblp::run(ARGV[0], options)
|
54
61
|
|
55
|
-
Dblp::run(file_to_parse, opt)
|
56
62
|
|
57
|
-
# do stuff
|
data/lib/dblp/grabber.rb
CHANGED
@@ -8,6 +8,10 @@ module Dblp
|
|
8
8
|
|
9
9
|
# Const url to fetch from
|
10
10
|
DBLP_URL = "http://dblp.uni-trier.de/rec/bibtex/"
|
11
|
+
|
12
|
+
def initialize(options = nil)
|
13
|
+
@options = options
|
14
|
+
end
|
11
15
|
|
12
16
|
def read_html(url)
|
13
17
|
content = ""
|
@@ -17,6 +21,11 @@ module Dblp
|
|
17
21
|
content
|
18
22
|
end
|
19
23
|
|
24
|
+
# Extracts all relevant information from the <pre> elements from
|
25
|
+
# the dblp page. There is one special case to handle. If there are
|
26
|
+
# multiple <pre> elements there is a cross reference used. We have
|
27
|
+
# to check if we include the cross reference or extract the short
|
28
|
+
# version.
|
20
29
|
def extract_pre(content)
|
21
30
|
# extract the bibtex code, that is in pre tags
|
22
31
|
pres = content.scan(/<pre>(.*?)<.pre>/mix)
|
@@ -25,14 +34,29 @@ module Dblp
|
|
25
34
|
|
26
35
|
# First handle main entry
|
27
36
|
result = []
|
37
|
+
return [] if pres.size == 0
|
38
|
+
|
28
39
|
result << pres[0][0].gsub(/(<.*?>)/, "").gsub(/^\s+title\s+=\s+\{(.*?)\},/m, " title = {{\\1}},")
|
29
40
|
|
30
|
-
# Find the crossref
|
41
|
+
# Find the crossref in the second <pre>
|
31
42
|
if pres.size > 1
|
32
|
-
|
33
|
-
if
|
34
|
-
result[0].gsub
|
35
|
-
|
43
|
+
|
44
|
+
if @options && @options.crossref
|
45
|
+
result << pres[1][0].gsub(/(<.*?>)/, "").gsub(/^\s+title\s+=\s+\{(.*?)\},/m, " title = {{\\1}},")
|
46
|
+
else
|
47
|
+
booktitle = pres[1][0].match(/^\s+title\s+=\s+\{(.*?)\},/m)
|
48
|
+
|
49
|
+
# If we find a booktitle, replace the book title with the
|
50
|
+
# one from the crossref
|
51
|
+
if booktitle
|
52
|
+
result[0].gsub!(/^\s+booktitle\s+=\s+\{(.*?)\},/m, " booktitle = {{#{booktitle[1]}}},")
|
53
|
+
|
54
|
+
publisher = pres[1][0].match(/^\s+publisher\s+=\s+\{(.*?)\},/m)
|
55
|
+
publisher_data = publisher ? " publisher = {{#{publisher[1]}}}," : ""
|
56
|
+
|
57
|
+
# TODO make cross ref handling configurable
|
58
|
+
result[0].gsub!(/^\s+crossref\s+=\s+\{(.*?)\},/m, publisher_data)
|
59
|
+
end
|
36
60
|
end
|
37
61
|
end
|
38
62
|
result
|
@@ -52,7 +76,9 @@ module Dblp
|
|
52
76
|
#CiteseerGrabber.new.grab(key)
|
53
77
|
[]
|
54
78
|
end
|
55
|
-
rescue
|
79
|
+
rescue Exception => e
|
80
|
+
puts e.message
|
81
|
+
puts e.backtrace.inspect
|
56
82
|
[]
|
57
83
|
end
|
58
84
|
end
|
data/lib/dblp/query.rb
ADDED
@@ -0,0 +1,133 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'rubygems'
|
3
|
+
require 'json'
|
4
|
+
require 'ostruct'
|
5
|
+
|
6
|
+
class DBLPQuery
|
7
|
+
|
8
|
+
BASE_URI = "http://dblp.mpi-inf.mpg.de/autocomplete-php/autocomplete/ajax.php"
|
9
|
+
|
10
|
+
attr_accessor :params, :result
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
@result = []
|
14
|
+
|
15
|
+
@params = {
|
16
|
+
:name => "dblpmirror",
|
17
|
+
:path => "/dblp-mirror/",
|
18
|
+
:page => "index.php",
|
19
|
+
:log => "/var/opt/completesearch/log/completesearch.error_log",
|
20
|
+
:qid => 6,
|
21
|
+
:navigation_mode => "history",
|
22
|
+
:language => "en",
|
23
|
+
:mcsr => 40,
|
24
|
+
:mcc => 0,
|
25
|
+
:mcl => 80,
|
26
|
+
:hpp => 20,
|
27
|
+
:eph => 1,
|
28
|
+
:er => 20,
|
29
|
+
:dm => 3,
|
30
|
+
:bnm => "R",
|
31
|
+
:ll => 2,
|
32
|
+
:mo => 100,
|
33
|
+
:accc => ":",
|
34
|
+
:syn => 0,
|
35
|
+
:deb => 0,
|
36
|
+
:hrd => "1a",
|
37
|
+
:hrw => "1d",
|
38
|
+
:qi => 1,
|
39
|
+
:fh => 1,
|
40
|
+
:fhs => 1,
|
41
|
+
:mcs => 20,
|
42
|
+
:rid => 0,
|
43
|
+
:qt => "H"
|
44
|
+
}
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
def query(what)
|
50
|
+
|
51
|
+
# Make some simple means of caching
|
52
|
+
return if @params["query"] == what
|
53
|
+
|
54
|
+
@params["query"] = what
|
55
|
+
|
56
|
+
url = URI.parse(BASE_URI)
|
57
|
+
req = Net::HTTP::Post.new(url.path)
|
58
|
+
|
59
|
+
req.set_form_data(@params)
|
60
|
+
res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }
|
61
|
+
|
62
|
+
case res
|
63
|
+
when Net::HTTPSuccess, Net::HTTPRedirection
|
64
|
+
# OK
|
65
|
+
puts "Success"
|
66
|
+
body = extreact_from_body(res.body)
|
67
|
+
parse_table(body)
|
68
|
+
@result = parse_table(body)
|
69
|
+
else
|
70
|
+
res.error!
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
|
76
|
+
def extreact_from_body(body)
|
77
|
+
raw = body.split("\n")[27][11..-2].gsub("'", "\"")
|
78
|
+
full = JSON.parse(raw)
|
79
|
+
full["body"]
|
80
|
+
end
|
81
|
+
|
82
|
+
def parse_table(body)
|
83
|
+
result = []
|
84
|
+
|
85
|
+
body.scan(/<tr>(.*?)<\/tr>/m) do |match|
|
86
|
+
|
87
|
+
cells = match[0].scan(/<td.*?>(.*?)<\/td>/m)
|
88
|
+
next unless cells.size == 3
|
89
|
+
|
90
|
+
obj = OpenStruct.new
|
91
|
+
# First Cell is the cite key
|
92
|
+
obj.cite = "DBLP:" << cells[0][0].match(/href="http:\/\/dblp\.uni-trier\.de\/rec\/bibtex\/(.*?)">/)[1]
|
93
|
+
|
94
|
+
# second cell the link to the electronic version
|
95
|
+
|
96
|
+
# Third cell is author + title
|
97
|
+
obj.title = cells[2][0].gsub(/<.*?>/,"")
|
98
|
+
|
99
|
+
result << obj
|
100
|
+
end
|
101
|
+
result
|
102
|
+
end
|
103
|
+
|
104
|
+
# Based on the last result that was fetched, a new cite key is returned
|
105
|
+
# based on the position inside the result.
|
106
|
+
def select(num)
|
107
|
+
return if @result.size == 0 || @result.size < num
|
108
|
+
return @result[num.abs].cite
|
109
|
+
end
|
110
|
+
|
111
|
+
def present
|
112
|
+
@result.each_with_index do |item, i|
|
113
|
+
puts "\t#{i+1}\t#{item.title}\n"
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
def cite(num)
|
118
|
+
"\\cite{#{select(num)}}"
|
119
|
+
end
|
120
|
+
|
121
|
+
end
|
122
|
+
|
123
|
+
if __FILE__ == $0
|
124
|
+
|
125
|
+
q = DBLPQuery.new
|
126
|
+
q.query("Kossmann")
|
127
|
+
|
128
|
+
q.present
|
129
|
+
|
130
|
+
puts q.select(3)
|
131
|
+
puts q.cite(3)
|
132
|
+
|
133
|
+
end
|
data/lib/dblp.rb
CHANGED
@@ -10,13 +10,18 @@ module Dblp
|
|
10
10
|
class << self
|
11
11
|
|
12
12
|
def run(file, options)
|
13
|
+
|
14
|
+
if !file || !File.exists?(file)
|
15
|
+
puts "You need to specify a filename"
|
16
|
+
exit
|
17
|
+
end
|
13
18
|
|
14
19
|
# Clean file to parse
|
15
20
|
file = File.basename(file, File.extname(file)) + ".aux"
|
16
21
|
overall_size = 0
|
17
22
|
|
18
23
|
parser = Dblp::Parser.new(file)
|
19
|
-
grabber = Dblp::Grabber.new
|
24
|
+
grabber = Dblp::Grabber.new(options)
|
20
25
|
File.open(options.output, "w+") do |f|
|
21
26
|
f.puts parser.parse.inject([]) {|m, l|
|
22
27
|
m << grabber.grab(l)
|
metadata
CHANGED
@@ -1,131 +1,62 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: dblp
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 4
|
9
|
-
- 5
|
10
|
-
version: 0.4.5
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.0
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Martin Grund
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
name: rubyforge
|
23
|
-
prerelease: false
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
12
|
+
date: 2011-11-28 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: json
|
16
|
+
requirement: &70336630568860 !ruby/object:Gem::Requirement
|
25
17
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
|
31
|
-
- 2
|
32
|
-
- 0
|
33
|
-
- 4
|
34
|
-
version: 2.0.4
|
35
|
-
type: :development
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: hoe
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.4.0
|
22
|
+
type: :runtime
|
39
23
|
prerelease: false
|
40
|
-
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ">="
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 19
|
46
|
-
segments:
|
47
|
-
- 2
|
48
|
-
- 6
|
49
|
-
- 2
|
50
|
-
version: 2.6.2
|
51
|
-
type: :development
|
52
|
-
version_requirements: *id002
|
24
|
+
version_requirements: *70336630568860
|
53
25
|
description: Dynamically generate the bibtex file from your citations
|
54
|
-
email:
|
55
|
-
|
56
|
-
executables:
|
26
|
+
email: grundprinzip@gmail.com
|
27
|
+
executables:
|
57
28
|
- dblp
|
58
29
|
extensions: []
|
59
|
-
|
60
|
-
|
61
|
-
- History.txt
|
62
|
-
- License.txt
|
63
|
-
- Manifest.txt
|
64
|
-
- PostInstall.txt
|
65
|
-
- README.txt
|
66
|
-
files:
|
67
|
-
- History.txt
|
68
|
-
- License.txt
|
69
|
-
- Manifest.txt
|
70
|
-
- PostInstall.txt
|
71
|
-
- README.txt
|
72
|
-
- Rakefile
|
73
|
-
- bin/dblp
|
74
|
-
- config/hoe.rb
|
75
|
-
- config/requirements.rb
|
30
|
+
extra_rdoc_files: []
|
31
|
+
files:
|
76
32
|
- lib/dblp.rb
|
77
33
|
- lib/dblp/grabber.rb
|
78
34
|
- lib/dblp/parser.rb
|
35
|
+
- lib/dblp/query.rb
|
79
36
|
- lib/dblp/version.rb
|
80
|
-
-
|
81
|
-
|
82
|
-
- tasks/environment.rake
|
83
|
-
- tasks/website.rake
|
84
|
-
- test/test.aux
|
85
|
-
- test/test_dblp.rb
|
86
|
-
- test/test_helper.rb
|
87
|
-
has_rdoc: true
|
88
|
-
homepage: http://github.com/grundprinzip/dblp
|
37
|
+
- bin/dblp
|
38
|
+
homepage: http://www.grundprinzip.de/tags/dblp
|
89
39
|
licenses: []
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
For more information on dblp, see http://dblp.rubyforge.org
|
94
|
-
|
95
|
-
NOTE: Change this information in PostInstall.txt
|
96
|
-
You can also delete it if you don't want it.
|
97
|
-
|
98
|
-
|
99
|
-
rdoc_options:
|
100
|
-
- --main
|
101
|
-
- README.txt
|
102
|
-
require_paths:
|
40
|
+
post_install_message:
|
41
|
+
rdoc_options: []
|
42
|
+
require_paths:
|
103
43
|
- lib
|
104
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
105
45
|
none: false
|
106
|
-
requirements:
|
107
|
-
- -
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
|
110
|
-
|
111
|
-
- 0
|
112
|
-
version: "0"
|
113
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ! '>='
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
51
|
none: false
|
115
|
-
requirements:
|
116
|
-
- -
|
117
|
-
- !ruby/object:Gem::Version
|
118
|
-
|
119
|
-
segments:
|
120
|
-
- 0
|
121
|
-
version: "0"
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
122
56
|
requirements: []
|
123
|
-
|
124
|
-
|
125
|
-
rubygems_version: 1.3.7
|
57
|
+
rubyforge_project:
|
58
|
+
rubygems_version: 1.8.11
|
126
59
|
signing_key:
|
127
60
|
specification_version: 3
|
128
|
-
summary:
|
129
|
-
test_files:
|
130
|
-
- test/test_dblp.rb
|
131
|
-
- test/test_helper.rb
|
61
|
+
summary: DBLP
|
62
|
+
test_files: []
|
data/History.txt
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
== 0.3.2 2008-06-29
|
2
|
-
* refactored interface for grabbing data from different sources
|
3
|
-
* added citeseer for finding the right bibtex entry
|
4
|
-
|
5
|
-
== 0.2.0 2008-05-29
|
6
|
-
|
7
|
-
* added documentation and more command line options
|
8
|
-
|
9
|
-
== 0.1.0 2008-05-28
|
10
|
-
|
11
|
-
* 1 major enhancement:
|
12
|
-
* Initial release
|
data/License.txt
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2008 FIXME full name
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Manifest.txt
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
History.txt
|
2
|
-
License.txt
|
3
|
-
Manifest.txt
|
4
|
-
PostInstall.txt
|
5
|
-
README.txt
|
6
|
-
Rakefile
|
7
|
-
bin/dblp
|
8
|
-
config/hoe.rb
|
9
|
-
config/requirements.rb
|
10
|
-
lib/dblp.rb
|
11
|
-
lib/dblp/grabber.rb
|
12
|
-
lib/dblp/parser.rb
|
13
|
-
lib/dblp/version.rb
|
14
|
-
setup.rb
|
15
|
-
tasks/deployment.rake
|
16
|
-
tasks/environment.rake
|
17
|
-
tasks/website.rake
|
18
|
-
test/test.aux
|
19
|
-
test/test_dblp.rb
|
20
|
-
test/test_helper.rb
|
data/PostInstall.txt
DELETED
data/README.txt
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
# dblp
|
2
|
-
|
3
|
-
## DESCRIPTION:
|
4
|
-
|
5
|
-
DBLP is a command line tool to fetch required bibtex entries directly from the DBLP servers. The idea is, that you don't have to maintain all entries in your own file, but youse well known bibtex identifiers instead and then fetch them from DBLP.
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
## SYNOPSIS:
|
11
|
-
|
12
|
-
The first step is to build your latex document, so that dblp can parse the aux file for your document. Now call
|
13
|
-
|
14
|
-
dblp my_tex_file[|.tex|.aux]
|
15
|
-
|
16
|
-
and this will scan for the citation commands in the aux file. The defined keys will be used to query DBLP. If an entry is available it is saved and as a result stored in the dblp.bib file. To use it in your Latex document just use \bibliography{my_own_file,..., dblp}
|
17
|
-
|
18
|
-
For more command line options see
|
19
|
-
|
20
|
-
dblp --help
|
21
|
-
|
22
|
-
|
23
|
-
## LICENSE:
|
24
|
-
|
25
|
-
(The MIT License)
|
26
|
-
|
27
|
-
Copyright (c) 2008 FIX
|
28
|
-
|
29
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
30
|
-
a copy of this software and associated documentation files (the
|
31
|
-
'Software'), to deal in the Software without restriction, including
|
32
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
33
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
34
|
-
permit persons to whom the Software is furnished to do so, subject to
|
35
|
-
the following conditions:
|
36
|
-
|
37
|
-
The above copyright notice and this permission notice shall be
|
38
|
-
included in all copies or substantial portions of the Software.
|
39
|
-
|
40
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
41
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
42
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
43
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
44
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
45
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
46
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
DELETED
data/config/hoe.rb
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
require 'dblp/version'
|
2
|
-
|
3
|
-
AUTHOR = 'Martin Grund' # can also be an array of Authors
|
4
|
-
EMAIL = "grundprinzip@gmail.com"
|
5
|
-
DESCRIPTION = "Dynamically generate the bibtex file from your citations"
|
6
|
-
GEM_NAME = 'dblp' # what ppl will type to install your gem
|
7
|
-
RUBYFORGE_PROJECT = 'rug-b' # The unix name for your project
|
8
|
-
HOMEPATH = "http://github.com/grundprinzip/dblp"
|
9
|
-
DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
|
10
|
-
EXTRA_DEPENDENCIES = [
|
11
|
-
# ['activesupport', '>= 1.3.1']
|
12
|
-
] # An array of rubygem dependencies [name, version]
|
13
|
-
|
14
|
-
@config_file = "~/.rubyforge/user-config.yml"
|
15
|
-
@config = nil
|
16
|
-
RUBYFORGE_USERNAME = "unknown"
|
17
|
-
def rubyforge_username
|
18
|
-
unless @config
|
19
|
-
begin
|
20
|
-
@config = YAML.load(File.read(File.expand_path(@config_file)))
|
21
|
-
rescue
|
22
|
-
puts <<-EOS
|
23
|
-
ERROR: No rubyforge config file found: #{@config_file}
|
24
|
-
Run 'rubyforge setup' to prepare your env for access to Rubyforge
|
25
|
-
- See http://newgem.rubyforge.org/rubyforge.html for more details
|
26
|
-
EOS
|
27
|
-
exit
|
28
|
-
end
|
29
|
-
end
|
30
|
-
RUBYFORGE_USERNAME.replace @config["username"]
|
31
|
-
end
|
32
|
-
|
33
|
-
|
34
|
-
REV = nil
|
35
|
-
# UNCOMMENT IF REQUIRED:
|
36
|
-
# REV = YAML.load(`svn info`)['Revision']
|
37
|
-
VERS = Dblp::VERSION::STRING + (REV ? ".#{REV}" : "")
|
38
|
-
RDOC_OPTS = ['--quiet', '--title', 'dblp documentation',
|
39
|
-
"--opname", "index.html",
|
40
|
-
"--line-numbers",
|
41
|
-
"--main", "README",
|
42
|
-
"--inline-source"]
|
43
|
-
|
44
|
-
class Hoe
|
45
|
-
def extra_deps
|
46
|
-
@extra_deps.reject! { |x| Array(x).first == 'hoe' }
|
47
|
-
@extra_deps
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
# Generate all the Rake tasks
|
52
|
-
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
53
|
-
$hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
54
|
-
p.developer(AUTHOR, EMAIL)
|
55
|
-
p.description = DESCRIPTION
|
56
|
-
p.summary = DESCRIPTION
|
57
|
-
p.url = HOMEPATH
|
58
|
-
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
59
|
-
p.test_globs = ["test/**/test_*.rb"]
|
60
|
-
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
|
61
|
-
|
62
|
-
# == Optional
|
63
|
-
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
64
|
-
#p.extra_deps = EXTRA_DEPENDENCIES
|
65
|
-
|
66
|
-
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
67
|
-
end
|
68
|
-
|
69
|
-
CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
|
70
|
-
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
|
71
|
-
$hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
72
|
-
$hoe.rsync_args = '-av --delete --ignore-errors'
|
73
|
-
$hoe.spec.post_install_message = File.open(File.dirname(__FILE__) + "/../PostInstall.txt").read rescue ""
|
data/config/requirements.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
include FileUtils
|
3
|
-
|
4
|
-
require 'rubygems'
|
5
|
-
%w[rake hoe newgem rubigen].each do |req_gem|
|
6
|
-
begin
|
7
|
-
require req_gem
|
8
|
-
rescue LoadError
|
9
|
-
puts "This Rakefile requires the '#{req_gem}' RubyGem."
|
10
|
-
puts "Installation: gem install #{req_gem} -y"
|
11
|
-
exit
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
|