rubbr 1.0.5 → 1.0.6
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/History.txt +6 -0
- data/README.txt +8 -5
- data/lib/rubbr.rb +7 -2
- data/lib/rubbr/builder/tex.rb +10 -7
- data/lib/rubbr/options.rb +1 -0
- data/lib/rubbr/runner.rb +4 -8
- data/lib/rubbr/runner/bibtex.rb +1 -1
- data/lib/rubbr/runner/dvips.rb +1 -1
- data/lib/rubbr/runner/latex.rb +1 -1
- data/lib/rubbr/runner/pdflatex.rb +1 -1
- data/lib/rubbr/runner/ps2pdf.rb +1 -1
- metadata +2 -2
data/History.txt
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
== 1.0.6 / 2008-04-01
|
2
|
+
|
3
|
+
* New option: more verbose output.
|
4
|
+
* Somehow a graphic files were not copied to the builddir. This
|
5
|
+
was unnoticed since I've used the \graphicspath{} macro.
|
6
|
+
|
1
7
|
== 1.0.5 / 2008-03-30
|
2
8
|
|
3
9
|
* Small bugfixes and no default output on successful builds.
|
data/README.txt
CHANGED
@@ -9,11 +9,14 @@ Build LaTeX documents.
|
|
9
9
|
|
10
10
|
== SYNOPSIS:
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
Usage: rubbr [options]
|
13
|
+
-f, --format [FORMAT] Select output format (dvi, ps, pdf)
|
14
|
+
-e, --engine [ENGINE] Select processing engine (latex, pdflatex)
|
15
|
+
-d, --display Display the document
|
16
|
+
-s, --spell Spell check source files
|
17
|
+
-v, --verbose Enable verbose feedback
|
18
|
+
-V, --verboser Enable very verbose feedback
|
19
|
+
-h, --help Show this help message
|
17
20
|
|
18
21
|
Standard project layout:
|
19
22
|
|
data/lib/rubbr.rb
CHANGED
@@ -2,7 +2,7 @@ require 'optparse'
|
|
2
2
|
$:.unshift File.dirname(__FILE__)
|
3
3
|
|
4
4
|
module Rubbr
|
5
|
-
VERSION = '1.0.
|
5
|
+
VERSION = '1.0.6'
|
6
6
|
|
7
7
|
autoload :Options, 'rubbr/options'
|
8
8
|
autoload :Cli, 'rubbr/cli'
|
@@ -24,7 +24,7 @@ module Rubbr
|
|
24
24
|
def run(args = ARGV)
|
25
25
|
opts = OptionParser.new do |opts|
|
26
26
|
opts.version = Rubbr::VERSION
|
27
|
-
opts.banner = 'Usage: rubbr [
|
27
|
+
opts.banner = 'Usage: rubbr [options]'
|
28
28
|
|
29
29
|
opts.on('-f', '--format [FORMAT]', [:dvi, :ps, :pdf],
|
30
30
|
'Select output format (dvi, ps, pdf)') do |format|
|
@@ -48,6 +48,11 @@ module Rubbr
|
|
48
48
|
@@cmd_opts[:verbose] = true
|
49
49
|
end
|
50
50
|
|
51
|
+
opts.on('-V', '--verboser', 'Enable very verbose feedback') do
|
52
|
+
@@cmd_opts[:verbose] = true
|
53
|
+
@@cmd_opts[:verboser] = true
|
54
|
+
end
|
55
|
+
|
51
56
|
opts.on('-h', '--help', 'Show this help message') do
|
52
57
|
puts opts
|
53
58
|
exit 1
|
data/lib/rubbr/builder/tex.rb
CHANGED
@@ -21,24 +21,23 @@ module Rubbr
|
|
21
21
|
build_dir do
|
22
22
|
copy_source_files
|
23
23
|
copy_vendor_files
|
24
|
+
copy_graphic_files
|
24
25
|
|
25
|
-
latex = preprocessor.new(base_latex_file
|
26
|
+
latex = preprocessor.new(base_latex_file)
|
26
27
|
if base_bibtex_file && latex.warnings.join =~ /No file .+\.bbl/
|
27
|
-
bibtex = Rubbr::Runner::BibTeX.new(base_bibtex_file
|
28
|
+
bibtex = Rubbr::Runner::BibTeX.new(base_bibtex_file)
|
28
29
|
end
|
29
30
|
if latex.warnings.join =~ /No file .+\.(aux|toc)/
|
30
|
-
latex = preprocessor.new(base_latex_file
|
31
|
+
latex = preprocessor.new(base_latex_file)
|
31
32
|
end
|
32
33
|
if latex.warnings.join =~ /There were undefined citations/
|
33
|
-
latex = preprocessor.new(base_latex_file
|
34
|
+
latex = preprocessor.new(base_latex_file)
|
34
35
|
end
|
35
36
|
if latex.warnings.join =~ /Label\(s\) may have changed\. Rerun/
|
36
|
-
latex = preprocessor.new(base_latex_file
|
37
|
+
latex = preprocessor.new(base_latex_file)
|
37
38
|
end
|
38
|
-
latex.silent = false
|
39
39
|
latex.feedback
|
40
40
|
if bibtex
|
41
|
-
bibtex.silent = false
|
42
41
|
bibtex.feedback
|
43
42
|
end
|
44
43
|
end
|
@@ -63,6 +62,10 @@ module Rubbr
|
|
63
62
|
copy_files(Rubbr.options[:vendor_dir], %w(sty clo cls cfg))
|
64
63
|
end
|
65
64
|
|
65
|
+
def copy_graphic_files
|
66
|
+
copy_files(Rubbr.options[:graphics_dir], %w(eps png))
|
67
|
+
end
|
68
|
+
|
66
69
|
def copy_files(source_dir, file_extensions)
|
67
70
|
file_extensions.each do |file_extension|
|
68
71
|
Dir["#{source_dir}/*.#{file_extension}"].each do |file|
|
data/lib/rubbr/options.rb
CHANGED
data/lib/rubbr/runner.rb
CHANGED
@@ -10,9 +10,6 @@ module Rubbr
|
|
10
10
|
# The file to be run trough the latex process.
|
11
11
|
attr_accessor :input_file
|
12
12
|
|
13
|
-
# If true no messages is sendt to standard out. Defaults to false.
|
14
|
-
attr_accessor :silent
|
15
|
-
|
16
13
|
# The executable to be run.
|
17
14
|
attr_accessor :executable
|
18
15
|
|
@@ -22,10 +19,9 @@ module Rubbr
|
|
22
19
|
# Contains a list of possible errors after a run.
|
23
20
|
attr_accessor :errors
|
24
21
|
|
25
|
-
def initialize(input_file,
|
22
|
+
def initialize(input_file, executable)
|
26
23
|
@input_file = input_file
|
27
24
|
@executable = valid_executable executable
|
28
|
-
@silent = silent
|
29
25
|
@errors = []
|
30
26
|
|
31
27
|
if File.exists? @input_file
|
@@ -37,9 +33,10 @@ module Rubbr
|
|
37
33
|
end
|
38
34
|
|
39
35
|
def run
|
40
|
-
disable_stdinn do
|
36
|
+
disable_stdinn do # No input in case of error correction dialogue
|
41
37
|
messages = /^(Overfull|Underfull|No file|Package \w+ Warning:|LaTeX Warning:)/
|
42
38
|
run = `#@executable #@input_file`
|
39
|
+
puts run if Rubbr.options[:verboser]
|
43
40
|
@warnings = run.grep(messages).sort
|
44
41
|
lines = run.split("\n")
|
45
42
|
while lines.shift
|
@@ -47,12 +44,11 @@ module Rubbr
|
|
47
44
|
3.times { @errors << lines.shift }
|
48
45
|
end
|
49
46
|
end
|
50
|
-
feedback
|
51
47
|
end
|
52
48
|
end
|
53
49
|
|
54
50
|
def feedback
|
55
|
-
return if
|
51
|
+
return if Rubbr.options[:verboser] # No preformatted output.
|
56
52
|
unless @warnings.empty?
|
57
53
|
notice "Warnings from #@executable:"
|
58
54
|
@warnings.each do |message|
|
data/lib/rubbr/runner/bibtex.rb
CHANGED
data/lib/rubbr/runner/dvips.rb
CHANGED
data/lib/rubbr/runner/latex.rb
CHANGED
data/lib/rubbr/runner/ps2pdf.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubbr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eivind Uggedal
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-04-01 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|