rubbr 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
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
- Usage: rubbr [options]
13
- -f, --format [FORMAT] Select output format (dvi, ps, pdf)
14
- -v, --view View the document
15
- -s, --spell Spell check source files
16
- -h, --help Show this help message
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'
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 [@@cmd_opts]'
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
@@ -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, true)
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, true)
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, true)
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, true)
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, true)
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
@@ -18,6 +18,7 @@ module Rubbr
18
18
  :spell_file => 'dictionary.ispell',
19
19
  :distribution_name => distribution_name(root_dir),
20
20
  :verbose => false,
21
+ :verboser => false,
21
22
  :format => :dvi,
22
23
  :engine => :latex
23
24
  }
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, silent, executable)
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 @silent
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|
@@ -1,7 +1,7 @@
1
1
  module Rubbr
2
2
  module Runner
3
3
  class BibTeX < Base
4
- def initialize(input_file, silent=false, executable='bibtex')
4
+ def initialize(input_file, executable='bibtex')
5
5
  super
6
6
  end
7
7
 
@@ -1,7 +1,7 @@
1
1
  module Rubbr
2
2
  module Runner
3
3
  class DviPs < Base
4
- def initialize(input_file, silent=false, executable='dvips')
4
+ def initialize(input_file, executable='dvips')
5
5
  super
6
6
  end
7
7
 
@@ -1,7 +1,7 @@
1
1
  module Rubbr
2
2
  module Runner
3
3
  class LaTeX < Base
4
- def initialize(input_file, silent=false, executable='latex')
4
+ def initialize(input_file, executable='latex')
5
5
  super
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Rubbr
2
2
  module Runner
3
3
  class PdfLaTeX < Base
4
- def initialize(input_file, silent=false, executable='pdflatex')
4
+ def initialize(input_file, executable='pdflatex')
5
5
  super
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Rubbr
2
2
  module Runner
3
3
  class Ps2Pdf < Base
4
- def initialize(input_file, silent=false, executable='ps2pdf')
4
+ def initialize(input_file, executable='ps2pdf')
5
5
  super
6
6
  end
7
7
 
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.5
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-03-29 23:00:00 +01:00
12
+ date: 2008-04-01 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency