runtex 0.2.1 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. data/lib/runtex.rb +12 -3
  2. data/lib/runtex_job_chain.rb +67 -39
  3. data/lib/runtex_latex.rb +16 -4
  4. data/lib/runtex_pathes.yaml +4 -0
  5. data/lib/runtex_tool.rb +4 -0
  6. data/readme +4 -3
  7. data/unittest/expected/test_bibliography_babelbib.debug1.txt +15 -4
  8. data/unittest/expected/test_bibliography_babelbib.debug2.txt +14 -4
  9. data/unittest/expected/test_bibliography_babelbib.tex.runtex_summary.txt +1 -1
  10. data/unittest/expected/test_bibliography_babelbib_1.txt +1 -1
  11. data/unittest/expected/test_bibliography_babelbib_2.txt +1 -1
  12. data/unittest/expected/test_bibliography_plain.debug1.txt +13 -4
  13. data/unittest/expected/test_bibliography_plain.debug2.txt +12 -4
  14. data/unittest/expected/test_bibliography_plain.tex.runtex_summary.txt +1 -1
  15. data/unittest/expected/test_bibliography_plain_1.txt +1 -1
  16. data/unittest/expected/test_bibliography_plain_2.txt +1 -1
  17. data/unittest/expected/test_context.debug1.txt +14 -0
  18. data/unittest/expected/test_context.debug2.txt +13 -0
  19. data/unittest/expected/test_context.tex.runtex_summary.txt +12 -0
  20. data/unittest/expected/test_context_1.txt +10 -0
  21. data/unittest/expected/test_context_2.txt +10 -0
  22. data/unittest/expected/test_error.debug1.txt +10 -4
  23. data/unittest/expected/test_error.debug2.txt +9 -4
  24. data/unittest/expected/test_error.tex.runtex_summary.txt +1 -1
  25. data/unittest/expected/test_error_1.txt +1 -1
  26. data/unittest/expected/test_error_2.txt +1 -1
  27. data/unittest/expected/test_gloss.debug1.txt +15 -4
  28. data/unittest/expected/test_gloss.debug2.txt +14 -4
  29. data/unittest/expected/test_gloss.tex.runtex_summary.txt +1 -1
  30. data/unittest/expected/test_gloss_1.txt +1 -1
  31. data/unittest/expected/test_gloss_2.txt +1 -1
  32. data/unittest/expected/test_gloss_newgloss.debug1.txt +20 -4
  33. data/unittest/expected/test_gloss_newgloss.debug2.txt +19 -4
  34. data/unittest/expected/test_gloss_newgloss.tex.runtex_summary.txt +1 -1
  35. data/unittest/expected/test_gloss_newgloss_1.txt +1 -1
  36. data/unittest/expected/test_gloss_newgloss_2.txt +1 -1
  37. data/unittest/expected/test_glossaries.debug1.txt +20 -4
  38. data/unittest/expected/test_glossaries.debug2.txt +19 -4
  39. data/unittest/expected/test_glossaries.tex.runtex_summary.txt +1 -1
  40. data/unittest/expected/test_glossaries_1.txt +1 -1
  41. data/unittest/expected/test_glossaries_2.txt +1 -1
  42. data/unittest/expected/test_index.debug1.txt +15 -4
  43. data/unittest/expected/test_index.debug2.txt +14 -4
  44. data/unittest/expected/test_index.tex.runtex_summary.txt +1 -1
  45. data/unittest/expected/test_index2.debug1.txt +20 -4
  46. data/unittest/expected/test_index2.debug2.txt +19 -4
  47. data/unittest/expected/test_index2.tex.runtex_summary.txt +1 -1
  48. data/unittest/expected/test_index2_1.txt +1 -1
  49. data/unittest/expected/test_index2_2.txt +1 -1
  50. data/unittest/expected/test_index_1.txt +1 -1
  51. data/unittest/expected/test_index_2.txt +1 -1
  52. data/unittest/expected/test_makeindex.debug1.txt +15 -4
  53. data/unittest/expected/test_makeindex.debug2.txt +14 -4
  54. data/unittest/expected/test_makeindex.tex.runtex_summary.txt +1 -1
  55. data/unittest/expected/test_makeindex_1.txt +1 -1
  56. data/unittest/expected/test_makeindex_2.txt +1 -1
  57. data/unittest/expected/test_packagedoc_dtx.debug1.txt +20 -4
  58. data/unittest/expected/test_packagedoc_dtx.debug2.txt +19 -4
  59. data/unittest/expected/test_packagedoc_dtx.dtx.runtex_summary.txt +1 -1
  60. data/unittest/expected/test_packagedoc_dtx_1.txt +1 -1
  61. data/unittest/expected/test_packagedoc_dtx_2.txt +1 -1
  62. data/unittest/expected/test_rail.debug1.txt +14 -4
  63. data/unittest/expected/test_rail.debug2.txt +13 -4
  64. data/unittest/expected/test_rail.tex.runtex_summary.txt +1 -1
  65. data/unittest/expected/test_rail_1.txt +1 -1
  66. data/unittest/expected/test_rail_2.txt +1 -1
  67. data/unittest/expected/test_rail_error.debug1.txt +10 -4
  68. data/unittest/expected/test_rail_error.debug2.txt +9 -4
  69. data/unittest/expected/test_rail_error.tex.runtex_summary.txt +1 -1
  70. data/unittest/expected/test_rail_error_1.txt +1 -1
  71. data/unittest/expected/test_rail_error_2.txt +1 -1
  72. data/unittest/expected/test_splitindex.debug1.txt +22 -4
  73. data/unittest/expected/test_splitindex.debug2.txt +21 -4
  74. data/unittest/expected/test_splitindex.tex.runtex_summary.txt +1 -1
  75. data/unittest/expected/test_splitindex_1.txt +1 -1
  76. data/unittest/expected/test_splitindex_2.txt +1 -1
  77. data/unittest/expected/test_test.debug1.txt +12 -4
  78. data/unittest/expected/test_test.debug2.txt +11 -4
  79. data/unittest/expected/test_test.tex.runtex_summary.txt +1 -1
  80. data/unittest/expected/test_test_1.txt +1 -1
  81. data/unittest/expected/test_test_2.txt +1 -1
  82. data/unittest/testcases.yaml +5 -1
  83. data/unittest/unittest_runtex.rb +20 -5
  84. metadata +75 -47
  85. data/lib/Code_zum_Pluendern_rtex4newrtex.rb +0 -275
  86. data/lib/catch_output.rb +0 -99
@@ -1,5 +1,5 @@
1
1
  INFO test_splitindex.tex: Start job chain for test/test_splitindex.tex
2
- DEBUG test_splitindex.tex: Re-Create log/help-zip test_splitindex.log.zip
2
+ DEBUG test_splitindex.tex: Re-Create log/help-zip test_splitindex.runtex.zip
3
3
  INFO test_splitindex.tex: 01 Start TeX-run 1
4
4
  INFO test_splitindex.tex: 01-01 Call (La)TeX<pdflatex>
5
5
  DEBUG test_splitindex.tex: 01-01 Start LaTeX pdflatex -interaction=batchmode test_splitindex.tex
@@ -27,6 +27,23 @@ DEBUG test_splitindex.tex: 01-03 -> Info: input file test_splitindex-aut.idx. (2
27
27
  DEBUG test_splitindex.tex: 01-04 Start Makeindex: makeindex -o test_splitindex-idx.ind -t test_splitindex-idx.ilg test_splitindex-idx.idx
28
28
  DEBUG test_splitindex.tex: 01-04 Analyse log-file
29
29
  DEBUG test_splitindex.tex: 01-04 -> Info: input file test_splitindex-idx.idx. (2 entries accepted, 0 rejected)
30
- DEBUG test_splitindex.tex: Zip help files for later use (test_splitindex.aux, test_splitindex.out, test_splitindex.idx, test_splitindex-aut.idx, test_splitindex-aut.ind, test_splitindex-idx.idx, test_splitindex-idx.ind, test_splitindex.toc, test_splitindex.lof, test_splitindex.lot, test_splitindex.lox, test_splitindex.nav)
31
- DEBUG test_splitindex.tex: Delete log files test_splitindex.log, test_splitindex-aut.ilg, test_splitindex-idx.ilg, test_splitindex.log, test_splitindex-aut.ilg, test_splitindex-idx.ilg, test_splitindex.log, test_splitindex-aut.ilg, test_splitindex-idx.ilg
32
- DEBUG test_splitindex.tex: Delete helpfiles test_splitindex.aux, test_splitindex.out, test_splitindex.idx, test_splitindex-aut.idx, test_splitindex-aut.ind, test_splitindex-idx.idx, test_splitindex-idx.ind
30
+ DEBUG test_splitindex.tex: Zip help files for later use
31
+ DEBUG test_splitindex.tex: -> zip test_splitindex.aux for later use
32
+ DEBUG test_splitindex.tex: -> zip test_splitindex.out for later use
33
+ DEBUG test_splitindex.tex: -> zip test_splitindex.idx for later use
34
+ DEBUG test_splitindex.tex: -> zip test_splitindex-aut.idx for later use
35
+ DEBUG test_splitindex.tex: -> zip test_splitindex-aut.ind for later use
36
+ DEBUG test_splitindex.tex: -> zip test_splitindex-idx.idx for later use
37
+ DEBUG test_splitindex.tex: -> zip test_splitindex-idx.ind for later use
38
+ DEBUG test_splitindex.tex: Delete helpfiles
39
+ DEBUG test_splitindex.tex: -> Delete help file test_splitindex.aux
40
+ DEBUG test_splitindex.tex: -> Delete help file test_splitindex.out
41
+ DEBUG test_splitindex.tex: -> Delete help file test_splitindex.idx
42
+ DEBUG test_splitindex.tex: -> Delete help file test_splitindex-aut.idx
43
+ DEBUG test_splitindex.tex: -> Delete help file test_splitindex-aut.ind
44
+ DEBUG test_splitindex.tex: -> Delete help file test_splitindex-idx.idx
45
+ DEBUG test_splitindex.tex: -> Delete help file test_splitindex-idx.ind
46
+ DEBUG test_splitindex.tex: Delete log files
47
+ DEBUG test_splitindex.tex: -> Delete log-file test_splitindex-idx.ilg
48
+ DEBUG test_splitindex.tex: -> Delete log-file test_splitindex-aut.ilg
49
+ DEBUG test_splitindex.tex: -> Delete log-file test_splitindex.log
@@ -1,5 +1,5 @@
1
1
  ==================================================
2
- | Report for TeX-Job test_splitindex.tex"
2
+ | Report for TeX-Job "test_splitindex.tex"
3
3
  | 2000-01-01 12:00, TeX-run 1
4
4
  ==================================================
5
5
 
@@ -18,4 +18,4 @@ Start job chain for test_splitindex.tex
18
18
  SplitIndex<>: Information: 2;
19
19
  Makeindex<Sub-Index aut>: Information: 1;
20
20
  Makeindex<Sub-Index idx>: Information: 1;
21
- More Details see test_splitindex.tex.runtex_summary.txt or test_splitindex.log.zip
21
+ More Details see test_splitindex.tex.runtex_summary.txt or test_splitindex.runtex.zip
@@ -12,4 +12,4 @@ Start job chain for test_splitindex.tex
12
12
  SplitIndex<>: Information: 2;
13
13
  Makeindex<Sub-Index aut>: Information: 1;
14
14
  Makeindex<Sub-Index idx>: Information: 1;
15
- More Details see test_splitindex.tex.runtex_summary.txt or test_splitindex.log.zip
15
+ More Details see test_splitindex.tex.runtex_summary.txt or test_splitindex.runtex.zip
@@ -1,5 +1,5 @@
1
1
  INFO test_test.tex: Start job chain for test/test_test.tex
2
- DEBUG test_test.tex: Create log/help-zip test_test.log.zip
2
+ DEBUG test_test.tex: Create log/help-zip test_test.runtex.zip
3
3
  INFO test_test.tex: 01 Start TeX-run 1
4
4
  INFO test_test.tex: 01-01 Call (La)TeX<pdflatex>
5
5
  DEBUG test_test.tex: 01-01 Start LaTeX pdflatex -interaction=batchmode test_test.tex
@@ -27,6 +27,14 @@ DEBUG test_test.tex: 03-01 LaTeX finished
27
27
  DEBUG test_test.tex: 03-01 Analyse aux-file
28
28
  DEBUG test_test.tex: 03-01 Analyse log-file
29
29
  DEBUG test_test.tex: 03-01 -> File: test_test.pdf, 15 Pages, 72KB
30
- DEBUG test_test.tex: Zip help files for later use (test_test.aux, test_test.out, test_test.toc, test_test.lof, test_test.lot, test_test.lox, test_test.nav)
31
- DEBUG test_test.tex: Delete log files test_test.log, test_test.log, test_test.log
32
- DEBUG test_test.tex: Delete helpfiles test_test.aux, test_test.out, test_test.toc
30
+ DEBUG test_test.tex: Zip help files for later use
31
+ DEBUG test_test.tex: -> zip test_test.aux for later use
32
+ DEBUG test_test.tex: -> zip test_test.out for later use
33
+ DEBUG test_test.tex: -> zip test_test.toc for later use
34
+ DEBUG test_test.tex: Delete helpfiles
35
+ DEBUG test_test.tex: -> Delete help file test_test.aux
36
+ DEBUG test_test.tex: -> Delete help file test_test.out
37
+ DEBUG test_test.tex: -> Delete help file test_test.toc
38
+ DEBUG test_test.tex: Delete log files
39
+ DEBUG test_test.tex: -> Delete log-file test_test.log
40
+ DEBUG test_test.tex: -> Delete log-file test_test.tex.runtex.log
@@ -1,5 +1,5 @@
1
1
  INFO test_test.tex: Start job chain for test/test_test.tex
2
- DEBUG test_test.tex: Re-Create log/help-zip test_test.log.zip
2
+ DEBUG test_test.tex: Re-Create log/help-zip test_test.runtex.zip
3
3
  INFO test_test.tex: 01 Start TeX-run 1
4
4
  INFO test_test.tex: 01-01 Call (La)TeX<pdflatex>
5
5
  DEBUG test_test.tex: 01-01 Start LaTeX pdflatex -interaction=batchmode test_test.tex
@@ -7,6 +7,13 @@ DEBUG test_test.tex: 01-01 LaTeX finished
7
7
  DEBUG test_test.tex: 01-01 Analyse aux-file
8
8
  DEBUG test_test.tex: 01-01 Analyse log-file
9
9
  DEBUG test_test.tex: 01-01 -> File: test_test.pdf, 15 Pages, 72KB
10
- DEBUG test_test.tex: Zip help files for later use (test_test.aux, test_test.out, test_test.toc, test_test.lof, test_test.lot, test_test.lox, test_test.nav)
11
- DEBUG test_test.tex: Delete log files test_test.log, test_test.log, test_test.log, test_test.log
12
- DEBUG test_test.tex: Delete helpfiles test_test.aux, test_test.out, test_test.toc
10
+ DEBUG test_test.tex: Zip help files for later use
11
+ DEBUG test_test.tex: -> zip test_test.aux for later use
12
+ DEBUG test_test.tex: -> zip test_test.out for later use
13
+ DEBUG test_test.tex: -> zip test_test.toc for later use
14
+ DEBUG test_test.tex: Delete helpfiles
15
+ DEBUG test_test.tex: -> Delete help file test_test.aux
16
+ DEBUG test_test.tex: -> Delete help file test_test.out
17
+ DEBUG test_test.tex: -> Delete help file test_test.toc
18
+ DEBUG test_test.tex: Delete log files
19
+ DEBUG test_test.tex: -> Delete log-file test_test.log
@@ -1,5 +1,5 @@
1
1
  ==================================================
2
- | Report for TeX-Job test_test.tex"
2
+ | Report for TeX-Job "test_test.tex"
3
3
  | 2000-01-01 12:00, TeX-run 1
4
4
  ==================================================
5
5
 
@@ -12,4 +12,4 @@ Start job chain for test_test.tex
12
12
  - test_test.pdf
13
13
  - 15 Pages
14
14
  - 72KB
15
- More Details see test_test.tex.runtex_summary.txt or test_test.log.zip
15
+ More Details see test_test.tex.runtex_summary.txt or test_test.runtex.zip
@@ -6,4 +6,4 @@ Start job chain for test_test.tex
6
6
  - test_test.pdf
7
7
  - 15 Pages
8
8
  - 72KB
9
- More Details see test_test.tex.runtex_summary.txt or test_test.log.zip
9
+ More Details see test_test.tex.runtex_summary.txt or test_test.runtex.zip
@@ -424,4 +424,8 @@ packagedoc_dtx: |
424
424
  %\iffalse
425
425
  %</package>
426
426
  %\fi
427
- % \end{document}
427
+ % \end{document}
428
+ context: |
429
+ \starttext
430
+ Hello World
431
+ \stoptext
@@ -33,13 +33,15 @@ include RunTeX
33
33
  #~ bibliography.bib
34
34
  #~ packagedoc_dtx
35
35
  #~ $testonly = %w{
36
- #~ rail_error
36
+ #~ test
37
37
  #~ }
38
38
 
39
39
  puts <<xx
40
40
  Missing tests:
41
41
  - Test Documente with errors (see testcases_log.yaml, -> more)
42
42
  - Test overfull/underfull
43
+
44
+ context
43
45
  Missing Code:
44
46
  - Gui (runtex_gui.rb)
45
47
  xx
@@ -229,7 +231,13 @@ class Test_Document < Test::Unit::TestCase
229
231
  }
230
232
  else
231
233
  filename = "test/test_#{testcase}.tex"
232
- filename = "test/test_#{testcase}.dtx" if testcase =~ /_dtx/
234
+ format = :pdflatex
235
+ case testcase
236
+ when /_dtx/
237
+ filename = "test/test_#{testcase}.dtx"
238
+ when /context/
239
+ format = :context
240
+ end #testcase
233
241
  File.open( filename, 'w'){|texfile|
234
242
  texfile << testcode
235
243
  }
@@ -238,12 +246,15 @@ class Test_Document < Test::Unit::TestCase
238
246
  debuglog2 = "test_#{testcase}.debug2.txt"
239
247
  summary = File.basename("#{filename}.runtex_summary.txt")
240
248
  testcode = <<code
249
+ #
250
+ #Testcase #{testcase}
251
+ #
241
252
  def test_#{testcase}()
242
253
  job = Job_chain.new('#{filename}')
243
254
 
244
255
  #1st run - a lot of work
245
256
  job.log.add(Log4r::FileOutputter.new('log_file_debug', :filename => 'test/#{debuglog1}', :level => Log4r::DEBUG ) )
246
- stdout, stderr = catch_screen_output{ job.start(:pdflatex) }
257
+ stdout, stderr = catch_screen_output{ job.start(#{format.inspect}) }
247
258
  job.log.outputters.last.close
248
259
 
249
260
  assert_equal_filecontent( 'expected/test_#{testcase}_1.txt', stdout )
@@ -253,7 +264,7 @@ class Test_Document < Test::Unit::TestCase
253
264
 
254
265
  #2nd run -should be shorter
255
266
  job.log.add(Log4r::FileOutputter.new('log_file_debug2', :filename => 'test/#{debuglog2}', :level => Log4r::DEBUG ) )
256
- stdout, stderr = catch_screen_output{ job.start(:pdflatex) }
267
+ stdout, stderr = catch_screen_output{ job.start(#{format.inspect}) }
257
268
  job.log.outputters.last.close
258
269
  assert_equal_filecontent( 'expected/test_#{testcase}_2.txt', stdout )
259
270
  assert_equal_filecontent( 'expected/#{debuglog2}', File.readlines('test/#{debuglog2}').to_s )
@@ -264,13 +275,17 @@ class Test_Document < Test::Unit::TestCase
264
275
  File.delete('test/#{debuglog1}')
265
276
  File.delete('test/#{debuglog2}')
266
277
  end
278
+
267
279
  code
280
+ #~ puts testcase
281
+ #~ puts testcode
268
282
  #Add testcode for this test case to the test class
269
283
  self.module_eval( testcode ) #<===Here's the test
270
284
  end #case testcase
271
285
  #~ puts testcode
272
286
  }
273
287
  }
288
+ #~ puts "Tests defined"
274
289
 
275
290
  #~ def test_test()
276
291
  #~ job = Job_chain.new('test/test_test.tex')
@@ -278,5 +293,5 @@ code
278
293
  #~ stdout, stderr = catch_screen_output{ job.start(:pdflatex) }
279
294
  #~ assert_equal_filecontent( 'expected/test_test.txt', stdout )
280
295
  #~ end
281
-
296
+
282
297
  end #Test_Configuration
metadata CHANGED
@@ -1,36 +1,50 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: runtex
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.2.1
7
- date: 2009-05-20 00:00:00 +02:00
8
- summary: runTeX - Translate (La)TeX-files as often as needed
9
- require_paths:
10
- - lib
11
- email: knut@lickert.net
12
- homepage: http://ruby.lickert.net/runtex
13
- rubyforge_project: runtex
14
- description: "runtex is a ruby script which allows you to translate a (La)TeX file. The program runs LaTeX as often as necessary, it checks for the need to start BibTeX, Makeindex, Rail... After finishing the script you get an overview on all errors (from each program the script used). It is possible to define by switches to define the way of processing: - LaTeX - pdfLaTeX - XeLaTeX - LuaLaTeX There are different reasons for additional tex runs. Beside the 'normal' LaTeX reasons for multiple TeX-calls, the following packages from CTAN are supported by runtex: - longtable: Allow tables to flow over page boundaries. http://www.ctan.org/tex-archive/help/Catalogue/entries/longtable.html http://www.ctan.org/cgi-bin/ctanPackageInformation.py?id=longtable - glossaries: Create glossaries and lists of acronyms. (uses makeindex) http://www.ctan.org/tex-archive/macros/latex/contrib/glossaries/ - gloss: Create glossaries using BibTeX. http://www.ctan.org/tex-archive/macros/latex/contrib/gloss/ - splitindex: Unlimited number of indexes http://www.ctan.org/tex-archive/macros/latex/contrib/splitindex/ (runtex replaces the other splitindex-programms like splitindex.pl, splitindex.jar, splitindex.exe, splitindex.tex). - index: Extended index for LaTeX including multiple indexes. http://www.ctan.org/tex-archive/macros/latex/contrib/index/ (works proper only in addition with index2.sty) - rail: Syntax specification in EBNF. http://www.ctan.org/tex-archive/support/rail/ Bugs, Wishes and new Features This program is tested on a WIN2K System with TeXLive 2008 and ruby 1.8.6. The results of the unit test depends on your TeX-installation. No panic if there are errors! If it does not work on your system: 1) Please check the configuration runtex_pathes.yaml. (where are the programs like makeindex, bibtex, rail...) Perhaps you must adapt it. There is no configuration for different systems. If you need another configuration, send me please your adaption, I will think about different configurations. 2) It does not work with Style X. Please inform me about it, send a minimal example, where the script does not enough runs. 3) The Error/Warning X is not reported/detected Please send a minimal example an the log-file The Files of this contribution: runtex-0.2.1.gem: Gem on Rubyforge runtex-0.2.1_CTAN.zip: - runtex.exe: The 'compiled' programm start runtex.exe -h for the switches - runtex-0.2.1.gem - Also available at Rubyforge - index2.sty: Minor modification of index.sty More details: http://ruby.lickert.net/runtex http://rubyforge.org/projects/runtex/ knut@lickert.net"
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 0.2.3
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Knut Lickert
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-01-03 00:00:00 +01:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: log4r
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: more_unit_test
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ description: |
36
+ runTeX - Translate (La)TeX-files as often as needed.
37
+ The further development for this gem is stopped,
38
+ please take a look to rake4latex.
39
+
40
+ email: knut@lickert.net
41
+ executables: []
42
+
43
+ extensions: []
44
+
45
+ extra_rdoc_files:
46
+ - readme
31
47
  files:
32
- - lib/catch_output.rb
33
- - lib/Code_zum_Pluendern_rtex4newrtex.rb
34
48
  - lib/runtex.rb
35
49
  - lib/runtex_bibtex.rb
36
50
  - lib/runtex_job_chain.rb
@@ -42,6 +56,36 @@ files:
42
56
  - lib/runtex_pathes.yaml
43
57
  - lppl.txt
44
58
  - readme
59
+ has_rdoc: true
60
+ homepage: http://ruby.lickert.net/runtex
61
+ licenses: []
62
+
63
+ post_install_message:
64
+ rdoc_options:
65
+ - --main
66
+ - lib/runtex.rb
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: "0"
74
+ version:
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: "0"
80
+ version:
81
+ requirements:
82
+ - TeX, LaTeX, ...
83
+ - BibTeX, Makeindex, ...
84
+ rubyforge_project: runtex
85
+ rubygems_version: 1.3.5
86
+ signing_key:
87
+ specification_version: 3
88
+ summary: runTeX - Translate (La)TeX-files as often as needed
45
89
  test_files:
46
90
  - unittest/unittest_catch_output.rb
47
91
  - unittest/unittest_runtex.rb
@@ -56,6 +100,11 @@ test_files:
56
100
  - unittest/expected/test_bibliography_plain.tex.runtex_summary.txt
57
101
  - unittest/expected/test_bibliography_plain_1.txt
58
102
  - unittest/expected/test_bibliography_plain_2.txt
103
+ - unittest/expected/test_context.debug1.txt
104
+ - unittest/expected/test_context.debug2.txt
105
+ - unittest/expected/test_context.tex.runtex_summary.txt
106
+ - unittest/expected/test_context_1.txt
107
+ - unittest/expected/test_context_2.txt
59
108
  - unittest/expected/test_error.debug1.txt
60
109
  - unittest/expected/test_error.debug2.txt
61
110
  - unittest/expected/test_error.tex.runtex_summary.txt
@@ -126,24 +175,3 @@ test_files:
126
175
  - unittest/expected/test_test_rail.debug1.txt
127
176
  - unittest/expected/test_test_splitindex.debug1.txt
128
177
  - unittest/expected/test_test_test.debug1.txt
129
- rdoc_options: []
130
-
131
- extra_rdoc_files:
132
- - readme
133
- executables: []
134
-
135
- extensions: []
136
-
137
- requirements:
138
- - TeX, LaTeX, ...
139
- - BibTeX, Makeindex, ...
140
- dependencies:
141
- - !ruby/object:Gem::Dependency
142
- name: log4r
143
- version_requirement:
144
- version_requirements: !ruby/object:Gem::Version::Requirement
145
- requirements:
146
- - - ">"
147
- - !ruby/object:Gem::Version
148
- version: 0.0.0
149
- version:
@@ -1,275 +0,0 @@
1
- puts <<xx
2
- Kopiervorlage aus alter Version
3
- Sollte am Ende der Umsetzung leer sein.
4
- ------------------------------
5
- xx
6
-
7
- require 'yaml'
8
- File.open('runtex_pathes.yaml'){|f| $conf = YAML.load(f)}
9
-
10
- #~ puts $conf.inspect
11
- basename = 'basename'
12
-
13
- exit
14
- #
15
- #Things to get better:
16
- #- class Configuration is platform depending and only defined for Win2K
17
- # - path and program for each tool
18
- # - stdout/stderr/Log->Files
19
- #- Error and Warning-Analyses must be enforced
20
- #- support multibib.sty (bibtex)
21
- #- support multind.sty
22
- #- Option -c to remove all auxiliary files.
23
- #- Check in which source-file an error/warning occurs (input-list)
24
- #- Check on which output page an error/warning occurs (input-list)
25
-
26
- #
27
- #This class allows some precompile on the given TeX-File(s)
28
- #Actual a method for listings.sty is implemented.
29
- class Precompile
30
- #This method overwrites the given file with the replacements for listings
31
- def Precompile.mix_references!( filename )
32
-
33
- Logger.add(2, '', "Precompile #{filename} for cross-references")
34
- pre = new( filename)
35
- pre.listings_mix_references()
36
-
37
- new = File.new(filename, 'w')
38
- new.puts pre.text() #write the converted text
39
- new.close
40
- end #mix_references( template )
41
- #Read the contents of the file
42
- def initialize( filename)
43
- @text = ''
44
- File.open( filename ){ |f|
45
- @text = f.readlines.to_s
46
- }
47
- end
48
- attr_reader :text
49
- #This function supports the handling of the package listings.
50
- #Listings.sty allows you the insertion of external lsitings with the command
51
- # \lstinputlisting[firstline=<first>,lastline=<last>]{Programm}
52
- #There is one Problem: Whats the value of <first> and <last>?
53
- #Once a programm is finished, it is no problem. But when the program is still in develpment,
54
- #you have to adapt the line numbering.
55
- #It would be much nicer, if you could use something like
56
- # \lstinputlisting[fromlabel=<first>,tolabel=<last>]{Programm}
57
- #Well, I understand why it is dificult to make it in listings.sty.
58
- #This method makes this work. It scans the listing file for the label and replaces it in the source.
59
- def listings_mix_references( template = @text )
60
- #This method scan a program file for the string TeXlabel{<label>} or LABEL{<label>} and stores the linenumber.
61
- #The string can be redefined by a regular expression, $1 must be the label.
62
- def scan_source( source, r = /[(TeXlabel)|(LABEL)]\{(.*?)?\}/ )
63
- Logger.add(4, self.class, "Read File #{source} for cross-references")
64
- labels = Hash.new( 0 )
65
- if !File.exist?( source )
66
- Logger.add(3, self.class, "Sourcecode #{source} nicht gefunden" )
67
- return labels
68
- end
69
- #extend this Hash with a method get_label
70
- File.open(source){ |f|
71
- linenumber = 0
72
- f.each{|l|
73
- linenumber += 1
74
- while l =~ r #Perhaps there are mor then one label on a line
75
- labels[$1] = linenumber
76
- l.sub!( r ,'') #delete label for next Regex-check
77
- end
78
- #Idee f�r ABAP: FORM/Endform automatisch mit Labels versehen?
79
- }
80
- }
81
- Logger.add(5, self.class, "Found labels in #{source}: #{labels.inspect}")
82
- return labels
83
- end
84
- def get_label( hash, key, source )
85
- pos = hash.fetch(key, 0)
86
- Logger.add(3, self.class, "Label #{key} not found in #{source}") if pos == 0
87
- return pos
88
- end
89
- #If this script is running more the once, the inputlistings would increase.
90
- #So we clear it here to a "virgin" state.
91
- @text.gsub!(
92
- /%(lstinputlisting\[.*?\]\{(.*?)\})\n.lstinputlisting\[.*?\]\{.*?\}/m,
93
- '\\\\\1'
94
- )
95
- #\ABAPinput is a macro used in a privat package of the author ;-)
96
- @text.gsub!(
97
- /%(ABAPinput\[.*?\]\{(.*?)\})\n.ABAPinpu\[.*?\]\{.*?\}/m,
98
- '\\\\\1'
99
- )
100
-
101
- sources = Hash.new() #all Sources
102
- #Replace all from/tolabe-listings with the new first/lastline version.
103
- #Remember the original labels in a TeX-comment (needed next time, the programm could change.
104
- r = Regexp.new('\\\\(lstinputlisting|ABAPinput)\[.*(?:fromlabel=(.*?))(,.*)*(?:tolabel=(.*?))(,.*)*\]{(.*)}')
105
- while m = r.match(@text)
106
- old = m[0]
107
- source = m[6]
108
- Logger.add(5, self.class, "Found lstinputlisting #{source}")
109
- if ! sources.has_key?(source)
110
- sources[source] = scan_source( source )
111
- end
112
- pos1 = get_label(sources[source], m[2], source ) + 1
113
- pos2 = get_label(sources[source], m[4], source ) - 1
114
- new = '\\' + m[1] + '[' + 'firstline=' + pos1.to_s + m[3] +
115
- 'lastline=' + pos2.to_s + m[5].to_s + "]{" + source + '}'
116
- Logger.add(5, self.class, "Command old:\t#{old}\nCommand new\t#{new}" )
117
- @text = m.pre_match + "%#{old[1..-1]}\n" + new + m.post_match
118
- end
119
- return @text
120
- end #mix_references
121
- end #Precompile
122
-
123
-
124
- class DVIPS< Tool
125
- def initialize( filename )
126
- super()
127
- @filename = filename
128
- @logInclude = false #Add log-Files
129
- @stdoutInclude = false #Add the stdout-Files
130
- @stderrInclude = true #Add the stderr-Files same as ilg-file
131
- @first = true
132
- end
133
- def rerun?( log = nil )
134
- return @first #Postprocessor runs only once
135
- end
136
- def execute()
137
- @first = false
138
- Logger.add( 5, self.class, "Execute #{Configuration.dvips}")
139
- @dataChanged = false #clear flag
140
- stderrOff()
141
- result = system( Configuration.dvips(@filename) )
142
- stderrOn()
143
- @log = get_stderr()
144
- put_analyse( analyse( @log ) )
145
- if !result
146
- Logger.add(1, self.class, "Error executing #{self.class}")
147
- end
148
- add_stdout( self.class ) if @stdoutInclude
149
- add_stderr( self.class ) if @stderrInclude
150
- return result
151
- end
152
- def analyse( log=@log )
153
- result = { 'Error' => 0,
154
- 'Warning' => 0,
155
- 'Informationlist' => [],
156
- 'Errorlist' => [],
157
- 'Warninglist' => [],
158
- }
159
- log.each{ |l|
160
- if /This is (.*) Copyright/ =~ l
161
- result['Informationlist'] << "Called #{$1}"
162
- # check analyses
163
- elsif /[Ee]rror/ =~ l
164
- result['Error'] += 1
165
- result[:error] << "#{l}"
166
- elsif /[Ww]arning/ =~ l
167
- result['Warning'] += 1
168
- result[:warning] << "#{l}"
169
- end
170
- }
171
- return result
172
- end
173
- end #DVIPS
174
-
175
- class PS2PDF< Tool
176
- def initialize( filename )
177
- super()
178
- @filename = filename
179
- @logInclude = false #Add log-Files
180
- @stdoutInclude = true #Add the stdout-Files
181
- @stderrInclude = false #Add the stderr-Files
182
- @first = true
183
- end
184
- def rerun?( log = nil )
185
- return @first #Postprocessor runs only once
186
- end
187
- def execute()
188
- @first = false
189
- Logger.add( 5, self.class, "Execute #{self.class} (#{Configuration.ps2pdf})")
190
- @dataChanged = false #clear flag
191
- stdoutOff()
192
- result = system( Configuration.ps2pdf( @filename ) )
193
- stdoutOn()
194
- @log = get_stdout()
195
- put_analyse( analyse( @log ) )
196
- if !result
197
- Logger.add(1, self.class, "Error executing #{self.class}")
198
- end
199
- add_stdout( self.class ) if @stdoutInclude
200
- add_stderr( self.class ) if @stderrInclude
201
- return result
202
- end
203
- def analyse( log=@log )
204
- result = { 'Error' => 0,
205
- 'Warning' => 0,
206
- 'Informationlist' => [],
207
- 'Errorlist' => [],
208
- 'Warninglist' => [],
209
- }
210
- log.each{ |l|
211
- if /Unable to open the initial device, quitting./ =~ l
212
- result['Error'] += 1
213
- result[:error] << "Unable to open the initial device (PDF opened in Acrobat?)"
214
- elsif /[Ee]rror/ =~ l
215
- result['Error'] += 1
216
- result[:error] << "#{l}"
217
- elsif /[Ww]arning/ =~ l
218
- result['Warning'] += 1
219
- result[:warning] << "#{l}"
220
- end
221
- }
222
- return result
223
- end
224
- end #PS2PDF
225
-
226
- class DVIPDFM< Tool
227
- def initialize( filename )
228
- super()
229
- @filename = filename
230
- @logInclude = false #Add log-Files
231
- @stdoutInclude = true #Add the stdout-Files
232
- @stderrInclude = false #Add the stderr-Files
233
- @first = true
234
- end
235
- def rerun?( log = nil )
236
- return @first #Postprocessor runs only once
237
- end
238
- def execute()
239
- @first = false
240
- Logger.add( 5, self.class, "Execute #{self.class} (#{Configuration.ps2pdf})")
241
- @dataChanged = false #clear flag
242
- stdoutOff()
243
- result = system( Configuration.dvipdfm( @filename ) )
244
- stdoutOn()
245
- @log = get_stdout()
246
- put_analyse( analyse() )
247
- if !result
248
- Logger.add(1, self.class, "Error executing #{self.class}")
249
- end
250
- add_stdout( self.class ) if @stdoutInclude
251
- add_stderr( self.class ) if @stderrInclude
252
- return result
253
- end
254
- def analyse( log=@log )
255
- result = { 'Error' => 0,
256
- 'Errorlist' => [],
257
- 'Warninglist' => [],
258
- }
259
- log.each{ |l|
260
- if /Unable to open the initial device, quitting./ =~ l
261
- result['Error'] += 1
262
- result[:error] << "Unable to open the initial device (PDF opened in Acrobat?)"
263
- elsif /[Ee]rror/ =~ l
264
- result['Error'] += 1
265
- result[:error] << "#{l}"
266
- elsif /[Ww]arning/ =~ l
267
- result['Warning'] += 1
268
- result[:warning] << "#{l}"
269
- end
270
- }
271
- return result
272
- end
273
- end #DVIPDFM
274
-
275
-