quickcite 1.0.2 → 1.0.3

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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- quickcite (1.0.0)
4
+ quickcite (1.0.2)
5
5
  bibtex-ruby (>= 2.0)
6
6
  json
7
7
 
data/README.md CHANGED
@@ -38,4 +38,6 @@ the paper you intended:
38
38
  (3) Impact of Chosen Error Criteria in RSS-based Localization: Power vs Distance vs Relative Distance Error Minimization.
39
39
  Giuseppe Bianchi, Nicola Blefari-Melazzi, Francesca Lo Piccolo
40
40
 
41
- Questions or suggestions: power@cs.nyu.edu.
41
+ QuickCite relies on the excellent [bibtex-ruby](https://github.com/inukshuk/bibtex-ruby/) package.
42
+
43
+ Questions or suggestions: [power@cs.nyu.edu](mailto:power@cs.nyu.edu)
@@ -1,17 +1,27 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'quickcite'
3
+ require "rubygems"
4
+ require "bundler/setup"
5
+ require "quickcite"
4
6
 
5
7
  flags = {}
6
8
  optparse = OptionParser.new do|opts|
7
9
  opts.banner = "Usage: quickrite -b <bibtex file> latex1 latex2 ... "
8
10
 
9
11
  flags[:bibtex] = nil
10
- opts.on( '-b', '--bibtex FILE', 'Extract/generate references to FILE' ) do|file|
12
+ opts.on( "-b", "--bibtex FILE", "Extract/generate references to FILE" ) do|file|
11
13
  flags[:bibtex] = file
12
14
  end
13
15
  end
14
16
 
15
17
  optparse.parse!
16
18
 
19
+ if flags[:bibtex] == nil then
20
+ puts "Bibtex file must be specified (-b paper.bib)"
21
+ exit 1
22
+ elsif ARGV.length == 0 then
23
+ puts "No latex files specified."
24
+ exit 1
25
+ end
26
+
17
27
  QuickCite::run(ARGV, flags[:bibtex])
@@ -40,6 +40,12 @@ module QuickCite
40
40
  include QuickCite
41
41
  def initialize(latex_files, bibtex_file)
42
42
  @source = DBLP.new
43
+
44
+ if !File.exists?(bibtex_file) then
45
+ puts "Bibtex file #{bibtex_file} does not exist. Creating an empty file."
46
+ open(bibtex_file, "w").write("")
47
+ end
48
+
43
49
  @bib = BibTeX.open(bibtex_file, :include => [:meta_content])
44
50
 
45
51
  latex_files.each do|f|
@@ -90,4 +96,4 @@ module QuickCite
90
96
  def self.run(latex_files, bibtex_file)
91
97
  Main.new(latex_files, bibtex_file)
92
98
  end
93
- end
99
+ end
@@ -1,3 +1,3 @@
1
1
  module QuickCite
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -9,6 +9,7 @@ spec = Gem::Specification.new do |s|
9
9
  s.homepage = "https://github.com/rjpower/quickcite"
10
10
  s.email = "power@cs.nyu.edu"
11
11
  s.require_path = "lib"
12
+ s.executables << "quickcite"
12
13
  s.files = `git ls-files`.split("\n")
13
14
  s.description = <<-END
14
15
  Simplify your (academic) life.
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quickcite
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 2
10
- version: 1.0.2
9
+ - 3
10
+ version: 1.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Russell Power
@@ -68,8 +68,8 @@ description: |
68
68
  Visit https://github.com/rjpower/quickcite for install instructions.
69
69
 
70
70
  email: power@cs.nyu.edu
71
- executables: []
72
-
71
+ executables:
72
+ - quickcite
73
73
  extensions: []
74
74
 
75
75
  extra_rdoc_files: []