aurels-rbib 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ #
4
+ # Download your CiteULike bibliography and strip
5
+ # unnecessary fields.
6
+ #
7
+
8
+ ##### YOUR SETTINGS HERE #####
9
+ User = 'NickGasson'
10
+ BadFields = [:url]
11
+ ##### NO NEED TO EDIT BELOW HERE #####
12
+
13
+ require 'net/http'
14
+ require 'uri'
15
+ require 'bibtex/parser'
16
+
17
+ bibtex = Net::HTTP.get URI.parse("http://www.citeulike.org/bibtex/user/#{User}")
18
+ BibTeX::Parser.parse_string(bibtex).map do |entry|
19
+ entry.reject_fields BadFields
20
+ end.save("#{User}.bib")
21
+
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ #
4
+ # Run all the unit tests in the current directory.
5
+ #
6
+
7
+ require 'test/unit'
8
+
9
+ Dir.glob('bibtex/test_*.rb').each do |file|
10
+ require file
11
+ end
12
+
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ #
4
+ # Strip URL fields from each BibTeX file on the command line.
5
+ # Write the output to filename.stripped.bib
6
+ #
7
+
8
+ require 'bibtex/parser'
9
+
10
+ ARGV.each do |file|
11
+ BibTeX::Parser.parse(file).map do |entry|
12
+ entry.reject_fields [:url]
13
+ end.save(file.sub(/\.bib$/, '.stripped.bib'))
14
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aurels-rbib
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Nick Gasson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-05-07 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: BibTeX parser in Ruby
17
+ email: aurelien.malisart@gmail.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - README
26
+ - glom_citeulike.rb
27
+ - run_unit_tests.rb
28
+ - example.bib
29
+ - tara_no_url.rb
30
+ - bibtex/bibliography.rb
31
+ - bibtex/entry.rb
32
+ - bibtex/field.rb
33
+ - bibtex/lexer.rb
34
+ - bibtex/parser.rb
35
+ - bibtex/test_bibliography.rb
36
+ - bibtex/test_entry.rb
37
+ - bibtex/test_field.rb
38
+ - bibtex/test_lexer.rb
39
+ - bibtex/test_parser.rb
40
+ has_rdoc: false
41
+ homepage: http://github.com/aurels/rbib
42
+ post_install_message:
43
+ rdoc_options: []
44
+
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: "0"
52
+ version:
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: "0"
58
+ version:
59
+ requirements: []
60
+
61
+ rubyforge_project:
62
+ rubygems_version: 1.2.0
63
+ signing_key:
64
+ specification_version: 2
65
+ summary: BibTeX parser in Ruby
66
+ test_files: []
67
+