texsc 0.3.0 → 0.3.1
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.
- checksums.yaml +4 -4
- data/bin/texsc +14 -11
- data/features/cli.feature +11 -0
- data/texsc.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a9ce196f041bb2f75dfbc277670ce33f4d9583e64603fbc3721b4506bd80667
|
4
|
+
data.tar.gz: 324d0dcff1ddd4ca59466d597940be991bb252fa781b36ba7fa46d5f10791011
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f0d81dd04f8cf8290747163a133f294ea7d4cb8a10aa04211a8efe56c3bb06ba3a8ec32827043cf91d7e2e6a5e91047d792cd12eaa43010bc4de3eeb36f085c
|
7
|
+
data.tar.gz: c52b375086fcd1e6e3b5167295fe49849095ddd79b8ea564318bb823fa845f4566ecf10d6053cfe2e49c4b36bd4f67ebe416b50ee05431d9b799724ccb06e057
|
data/bin/texsc
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
22
|
# SOFTWARE.
|
23
23
|
|
24
|
-
VERSION = '0.3.
|
24
|
+
VERSION = '0.3.1'
|
25
25
|
|
26
26
|
STDOUT.sync = true
|
27
27
|
|
@@ -65,8 +65,12 @@ Options are:"
|
|
65
65
|
files = 0
|
66
66
|
opts.arguments.each do |f|
|
67
67
|
tex = File.read(f)
|
68
|
-
opts[:ignore].
|
69
|
-
|
68
|
+
ignores = opts[:ignore].map do |e|
|
69
|
+
c, o = e.split(':')
|
70
|
+
{ cmd: c, opts: o || 'p' }
|
71
|
+
end
|
72
|
+
ignores.each do |i|
|
73
|
+
tex = tex.gsub(/\\begin{#{i[:cmd]}}.+\\end{#{i[:cmd]}}/m, '')
|
70
74
|
end
|
71
75
|
log.info("Checking #{f} (#{tex.length} chars)...")
|
72
76
|
cmd = [
|
@@ -76,11 +80,7 @@ Options are:"
|
|
76
80
|
'--lang=en',
|
77
81
|
'--mode=tex',
|
78
82
|
opts[:pws] ? "-p #{opts[:pws]}" : '',
|
79
|
-
|
80
|
-
cmd, opts = e.split(':')
|
81
|
-
opts = 'p' if opts.nil?
|
82
|
-
"--add-tex-command '#{cmd} #{opts}'"
|
83
|
-
end.join(' '),
|
83
|
+
ignores.map { |i| "--add-tex-command '#{i[:cmd]} #{i[:opts]}'" }.join(' '),
|
84
84
|
'pipe'
|
85
85
|
].join(' ')
|
86
86
|
log.debug(cmd)
|
@@ -92,9 +92,12 @@ Options are:"
|
|
92
92
|
log.error(stderr.read)
|
93
93
|
raise "Failed to run aspell, exit code is #{status}"
|
94
94
|
end
|
95
|
-
stdout.read
|
96
|
-
|
97
|
-
|
95
|
+
out = stdout.read
|
96
|
+
unless out.nil?
|
97
|
+
out.split("\n").select { |t| t.start_with?('&') }.each do |t|
|
98
|
+
log.info(t)
|
99
|
+
errors += 1
|
100
|
+
end
|
98
101
|
end
|
99
102
|
end
|
100
103
|
files += 1
|
data/features/cli.feature
CHANGED
@@ -85,6 +85,17 @@ Feature: Command Line Processing
|
|
85
85
|
When I run bin/texsc with "--ignore nospell:opp article.tex"
|
86
86
|
Then Exit code is zero
|
87
87
|
|
88
|
+
Scenario: Bad LaTeX with complex --ignore can be spell checked
|
89
|
+
Given I have a "article.tex" file with content:
|
90
|
+
"""
|
91
|
+
\documentclass{article}
|
92
|
+
\begin{document}
|
93
|
+
How are you, \begin{nospell}{test}friiend\end{nospell}?
|
94
|
+
\end{document}
|
95
|
+
"""
|
96
|
+
When I run bin/texsc with "--ignore nospell:p article.tex"
|
97
|
+
Then Exit code is zero
|
98
|
+
|
88
99
|
Scenario: Bad LaTeX with too short words can be spell checked
|
89
100
|
Given I have a "article.tex" file with content:
|
90
101
|
"""
|
data/texsc.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.rubygems_version = '2.2'
|
33
33
|
s.required_ruby_version = '>= 2.3'
|
34
34
|
s.name = 'texsc'
|
35
|
-
s.version = '0.3.
|
35
|
+
s.version = '0.3.1'
|
36
36
|
s.license = 'MIT'
|
37
37
|
s.summary = 'Spell Checker for LaTeX'
|
38
38
|
s.description = 'Simple command-line spell checker for LaTeX documents'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: texsc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backtrace
|