trex 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/trex.rb +17 -3
  2. metadata +4 -4
data/lib/trex.rb CHANGED
@@ -8,9 +8,10 @@
8
8
  # ./trex clean # removes all generated files
9
9
  # ./trex tex # compiles the latex sources
10
10
  # ./trex count # gives different word approximations of the latex file
11
+ # ./trex check # run afterthedeadline / latex checker on the document
11
12
  #
12
13
  # == Usage
13
- # trex [options] [view|compile|tex|clean]
14
+ # trex [options] [view|compile|tex|clean|check]
14
15
  # For help use: trex -h
15
16
  #
16
17
  # == Options
@@ -66,7 +67,7 @@ Term::ANSIColor::coloring = color_terminal?
66
67
  # ============================================================================
67
68
  #TODO track changed files and only recompile then...
68
69
  class TReX
69
- VERSION = '1.0.1'
70
+ VERSION = '1.0.4'
70
71
 
71
72
  attr_reader :options
72
73
 
@@ -80,6 +81,8 @@ class TReX
80
81
  "bibtex" => :bibtex,
81
82
  "bib" => :bibtex,
82
83
  "v" => :view,
84
+ "spell" => :spell_check,
85
+ "check" => :spell_check,
83
86
  }
84
87
 
85
88
  # ------------------------------------------------------------------------
@@ -242,6 +245,17 @@ class TReX
242
245
 
243
246
  end
244
247
 
248
+ # ------------------------------------------------------------------------
249
+ def spell_check
250
+ self.check_source
251
+ # strip all the latex commands using detex
252
+ detexed = "#{@options.source}_detex.txt"
253
+ `detex #{@options.source} > #{detexed}`
254
+ output = `atdtool #{detexed}`
255
+ `rm #{detexed}`
256
+ puts output
257
+ end
258
+
245
259
  # ------------------------------------------------------------------------
246
260
  protected
247
261
 
@@ -250,7 +264,7 @@ class TReX
250
264
  return @opts unless @opts.nil?
251
265
 
252
266
  @opts = OptionParser.new do |opts|
253
- opts.banner = "#{executable_name} [options] [view|compile|tex|clean]"
267
+ opts.banner = "#{executable_name} [options] [view|compile|tex|clean|spell]"
254
268
 
255
269
  opts.separator ''
256
270
  opts.separator 'Automate compilation of LaTeX documents, making the output human-readable.'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-04-22 00:00:00.000000000 Z
14
+ date: 2012-04-23 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: term-ansicolor
18
- requirement: &70313404537440 !ruby/object:Gem::Requirement
18
+ requirement: &70271264454800 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,7 +23,7 @@ dependencies:
23
23
  version: 1.0.7
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *70313404537440
26
+ version_requirements: *70271264454800
27
27
  description: trex is script simplifying the compilation of latex files by creating
28
28
  proper human-readable error output with repeating patterns. Unlike the original
29
29
  latex output which is oververbosified.