tex_log_parser 1.0.0.pre.15 → 1.0.0.pre.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 04cec17bca7fe8b297a5b35114d1334e3d5f530fba5f1e952672035c55d6627c
4
- data.tar.gz: ec8e3cd45e18157f2fddb43b4c610f590792c0784bf857abd6d69b2d811e53f7
3
+ metadata.gz: a250fc41646ce2605eac36e8ce5ad22a1767c5de0dc824683a2a8a497d2b173c
4
+ data.tar.gz: d3df0c06d2280d808a9f9cb3db1eb73d673a8183bb826abe0ef1ad8df4ae0fd6
5
5
  SHA512:
6
- metadata.gz: 3ce2d48f6d26848b14efecef85d48878cf93e9d5d638a77cf2c8a61af429b0a61364013dace4e5bbf532452dd9290d7dc3359d35b7c322f9bef69491bc893377
7
- data.tar.gz: 9a062a9b01e3c467a64ac0166fe054f5e73174745c859d88767abd9faecaabdc8915e3ee879e72ddedf1435991992331a674b6d9392afc01150809ffdf351718
6
+ metadata.gz: c9b0f10261169bea1cdd0e0ada59cfb92dec26227fd1dca371d7e530f4078b9a700c3781cd038fd47f2a71a7d80c605b7ee64ba2c8cdfd12746a52f2230e5341
7
+ data.tar.gz: 627ea1f3f32ba584e9c314d198a73ff71c5d2575e799056e88b815e29698a1d459428f3bfd5a91635639592281227b210d934ee12a68aced29247ba1690d828d
data/README.md CHANGED
@@ -4,17 +4,109 @@
4
4
  [![Yard docs](http://img.shields.io/badge/yard-docs-green.svg)](http://www.rubydoc.info/gems/tex_log_parser/1.0.0) **˙**
5
5
  [![Maintainability](https://api.codeclimate.com/v1/badges/748992a2c5f6570797d4/maintainability)](https://codeclimate.com/github/reitzig/texlogparser/maintainability)
6
6
  [![Test Coverage](https://api.codeclimate.com/v1/badges/748992a2c5f6570797d4/test_coverage)](https://codeclimate.com/github/reitzig/texlogparser/test_coverage) **˙**
7
- [![Circle CI](https://circleci.com/gh/reitzig/texlogparser.svg?style=svg)](https://circleci.com/gh/reitzig/texlogparser)
7
+ [![Circle CI](https://circleci.com/gh/reitzig/texlogparser.svg?style=svg)](https://circleci.com/gh/reitzig/workflows/texlogparser/tree/master)
8
8
  [![Inline docs](http://inch-ci.org/github/reitzig/texlogparser.svg?branch=master)](http://inch-ci.org/github/reitzig/texlogparser)
9
9
 
10
- Eases the many pains around logs from (La)TeX engines.
10
+ This small Ruby gem eases many pains around digesting logs from (La)TeX engines.
11
+ Used as a command-line program or library, it converts (La)TeX logs into human-
12
+ or machine-readable forms.
13
+
14
+ _Disclaimer:_ Due to the nature of (La)TeX logs, parsing is inherently heuristic.
15
+
16
+ ## Installation
17
+
18
+ On any system with working Ruby (≥ 2.3), installation is as simple as this:
19
+
20
+ ```bash
21
+ [sudo] gem install tex_log_parser
22
+ ```
23
+
24
+ The usual options and, later, update mechanisms of Rubygems apply;
25
+ please refer to their documentation for details.
11
26
 
12
27
  ## Usage
13
28
 
14
- * Use `texlogparser` on the CLI.
15
- * Use `TexLogParser` from Ruby scripts.
29
+ There are two ways to parse logs: with the command-line program and via the underlying Ruby API.
30
+
31
+ ### Command-line Interface
32
+
33
+ By default, `texlogparser` reads from stdin and writes to stdout. That is, you can use it like so:
34
+
35
+ ```bash
36
+ pdflatex -interaction=nonstopmode example.tex | texlogparser
37
+ ```
38
+
39
+ This adds so little runtime overhead that there are few reasons _not_ to use it.
40
+ Note that the original log file will still be written to `example.log`,
41
+ so no information is lost.
42
+
43
+ You can also read from and/or write to files:
44
+
45
+ ```bash
46
+ texlogparser -i example.log # From file, to stdout
47
+ texlogparser -i example.log -o example.simple.log # From and to file
48
+ cat example.log | texlogparser -o example.simple.log # From stdin, to file
49
+ ```
50
+
51
+ If you want to use the output programmatically, you may want to add option `-f json`.
52
+ It does just what it sounds like.
53
+
54
+
55
+ ### Ruby API
56
+
57
+ ### Recommendations
58
+
59
+ * Use `_latex` option `-file-line-error` to get higher accuracy regarding source files and lines.
60
+ * [Increase the maximum line length](https://tex.stackexchange.com/a/52994/3213) as much as possible
61
+ to improve overall efficacy. Bad linebreaks are
62
+ [bad](https://github.com/reitzig/texlogparser/search?utf8=%E2%9C%93&q=BROKEN_BY_LINEBREAKS&type=).
63
+ * Avoid parentheses and whitespace in file paths.
16
64
 
17
65
  ## Contributing
18
66
 
19
- 1. TeXians: Report wrong parsing (w/ excerpt and full log incl expectations).
20
- 2. Rubyists: Review API, documentation, gem setup, etc.
67
+ For bug reports and feature requests, the usual rules apply: search for
68
+ [existing issues](https://github.com/reitzig/texlogparser/issues);
69
+ join the discussion or
70
+ [create a new one](https://github.com/reitzig/texlogparser/issues/new);
71
+ be specific and nice; expect nothing.
72
+
73
+ That aside, there are two groups of experts whose help would be much appreciated:
74
+ (La)TeX gourmets and Ruby developers.
75
+
76
+ ### TeXians
77
+
78
+ Please report any logs that get parsed wrong, be it because whole messages are not found,
79
+ or because not all details are correctly extracted.
80
+
81
+ Reports that provide the following information will be the most useful:
82
+
83
+ 1. Full failing log of a minimal example (ideally with source document).
84
+ 2. The engine(s) you use, e.g. `pdflatex`, `xelatex`, or `lualatex`.
85
+ 3. Expected number of error, warning, and info messages (the latter optional).
86
+ 4. Expected message with
87
+ * log line numbers (where the message starts and ends),
88
+ * level of the message (error, warning, or info), and
89
+ * which source file (and lines) it references.
90
+ 5. _Advanced_: In case of wrong source files, run `texlogparser -d` on the log
91
+ and note on which lines it changes file scopes in wrong ways.
92
+
93
+ If you _also_ know a little Ruby, please consider translating those data into
94
+ [a (failing) test](https://github.com/reitzig/texlogparser/blob/master/test/test_texlogparser.rb)
95
+ and open a pull request.
96
+
97
+ Some preemptive notes:
98
+ * Issues around messages below warning level have low priority.
99
+ * Problems caused by inopportune linebreaks are _probably_ out of scope.
100
+
101
+ **Bonus:** Convince as many package maintainers to use the same standardized, robust way of writing to the log.
102
+
103
+ ### Rubyists
104
+
105
+ Any feedback about the code quality and usefulness of the documentation would be
106
+ very appreciated. Particular areas of interest include:
107
+
108
+ * Is the API designed in useful ways?
109
+ * Does the documentation cover all your questions?
110
+ * Is the Gem structured properly?
111
+ * What can be improved to encourage code contributions?
112
+ * Does the CLI script have problems on any platform?
@@ -66,7 +66,7 @@ module LogParser
66
66
  @log_line_number = 1
67
67
  @lines = LogParser::Buffer.new(log)
68
68
 
69
- Logger.debug "Parsing from '#{log}'"
69
+ #Logger.debug "Parsing from '#{log}'"
70
70
  @scope_changes_by_line = {} if Logger.debug?
71
71
  end
72
72
 
@@ -10,7 +10,7 @@ module LogParser
10
10
  # @param [true,false] flag
11
11
  # @return [void]
12
12
  def debug=(flag)
13
- @debugging = flag
13
+ self.debugging = flag
14
14
  end
15
15
 
16
16
  # Indicates whether we are debugging.
@@ -18,7 +18,7 @@ module LogParser
18
18
  # @return [true,false]
19
19
  # `true` if we are in debugging mode, `false` otherwise.
20
20
  def debug?
21
- @debugging || !ENV['DEBUG'].nil?
21
+ debugging || !ENV['DEBUG'].nil?
22
22
  end
23
23
 
24
24
  # Logs the given message to STDOUT if `debug?` is true.
@@ -28,6 +28,10 @@ module LogParser
28
28
  def debug(message)
29
29
  puts message if debug?
30
30
  end
31
+
32
+ private
33
+
34
+ attr_accessor :debugging
31
35
  end
32
36
  end
33
37
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class TexLogParser
3
+ class TexLogParser
4
4
  # Matches messages of these forms:
5
5
  #
6
6
  # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
data/lib/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  # @attr [String] VERSION
4
4
  # The version of TexLogParser.
5
5
  class TexLogParser
6
- VERSION = '1.0.0.pre.15'
6
+ VERSION = '1.0.0.pre.16'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tex_log_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.15
4
+ version: 1.0.0.pre.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raphael Reitzig
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-08 00:00:00.000000000 Z
11
+ date: 2018-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: github-markup