mnogootex 0.2.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/actions/setup-ruby/action.yml +34 -0
- data/.github/workflows/main.yml +44 -0
- data/.gitignore +3 -0
- data/.rspec +0 -2
- data/.rubocop.yml +15 -0
- data/CHANGELOG.md +55 -0
- data/CODE_OF_CONDUCT.md +1 -1
- data/Gemfile +4 -3
- data/Guardfile +56 -0
- data/README.md +260 -20
- data/Rakefile +25 -4
- data/demo/.mnogootexrc +4 -0
- data/demo/demo.asciicast +114 -0
- data/demo/demo.gif +0 -0
- data/demo/main.tex +5 -0
- data/exe/mnogootex +2 -92
- data/lib/mnogootex/cfg.rb +72 -0
- data/lib/mnogootex/cli.rb +63 -0
- data/lib/mnogootex/job/logger.rb +53 -0
- data/lib/mnogootex/job/porter.rb +63 -0
- data/lib/mnogootex/job/runner.rb +60 -0
- data/lib/mnogootex/job/warden.rb +104 -0
- data/lib/mnogootex/log/level.rb +17 -0
- data/lib/mnogootex/log/levels.yml +29 -0
- data/lib/mnogootex/log/line.rb +14 -0
- data/lib/mnogootex/log/matcher.rb +17 -0
- data/lib/mnogootex/log/matchers.yml +205 -0
- data/lib/mnogootex/log/processor.rb +115 -0
- data/lib/mnogootex/log.rb +23 -0
- data/lib/mnogootex/utils.rb +27 -0
- data/lib/mnogootex/version.rb +3 -1
- data/lib/mnogootex.rb +4 -4
- data/mnogootex.gemspec +43 -18
- data/spec/mnogootex/cfg_spec.rb +54 -0
- data/spec/mnogootex/job/porter_spec.rb +140 -0
- data/spec/mnogootex/job/runner_spec.rb +74 -0
- data/spec/mnogootex/log/processor_spec.rb +203 -0
- data/spec/mnogootex/utils_spec.rb +52 -0
- data/spec/spec_helper.rb +124 -0
- metadata +150 -29
- data/.gitmodules +0 -3
- data/.travis.yml +0 -5
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/lib/mnogootex/configuration.rb +0 -46
- data/lib/mnogootex/job.rb +0 -75
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mnogootex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paolo Brasolin
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,59 +16,158 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.2.30
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.2.30
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: byebug
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 11.1.3
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 11.1.3
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: guard
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.18.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.18.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: guard-rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 4.7.3
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 4.7.3
|
27
69
|
- !ruby/object:Gem::Dependency
|
28
70
|
name: rake
|
29
71
|
requirement: !ruby/object:Gem::Requirement
|
30
72
|
requirements:
|
31
73
|
- - "~>"
|
32
74
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
75
|
+
version: 13.0.6
|
34
76
|
type: :development
|
35
77
|
prerelease: false
|
36
78
|
version_requirements: !ruby/object:Gem::Requirement
|
37
79
|
requirements:
|
38
80
|
- - "~>"
|
39
81
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
82
|
+
version: 13.0.6
|
41
83
|
- !ruby/object:Gem::Dependency
|
42
84
|
name: rspec
|
43
85
|
requirement: !ruby/object:Gem::Requirement
|
44
86
|
requirements:
|
45
87
|
- - "~>"
|
46
88
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
89
|
+
version: 3.10.0
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 3.10.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 1.22.3
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.22.3
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: simplecov
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.21.2
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.21.2
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: yard
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 0.9.26
|
48
132
|
type: :development
|
49
133
|
prerelease: false
|
50
134
|
version_requirements: !ruby/object:Gem::Requirement
|
51
135
|
requirements:
|
52
136
|
- - "~>"
|
53
137
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
138
|
+
version: 0.9.26
|
55
139
|
- !ruby/object:Gem::Dependency
|
56
140
|
name: colorize
|
57
141
|
requirement: !ruby/object:Gem::Requirement
|
58
142
|
requirements:
|
59
|
-
- - "
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 0.8.1
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 0.8.1
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: thor
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
60
158
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
159
|
+
version: 0.20.0
|
62
160
|
type: :runtime
|
63
161
|
prerelease: false
|
64
162
|
version_requirements: !ruby/object:Gem::Requirement
|
65
163
|
requirements:
|
66
|
-
- - "
|
164
|
+
- - "~>"
|
67
165
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
69
|
-
description:
|
70
|
-
|
71
|
-
|
166
|
+
version: 0.20.0
|
167
|
+
description: Многоꙮтех (mnogootex) is a utility that parallelizes compilation of a
|
168
|
+
LaTeX document using different classes and offers a meaningfully filtered output.
|
169
|
+
The motivating use case is maintaining a single preamble while submitting a paper
|
170
|
+
to many journals using their outdated or crummy document classes.
|
72
171
|
email:
|
73
172
|
- paolo.brasolin@gmail.com
|
74
173
|
executables:
|
@@ -76,28 +175,51 @@ executables:
|
|
76
175
|
extensions: []
|
77
176
|
extra_rdoc_files: []
|
78
177
|
files:
|
178
|
+
- ".github/actions/setup-ruby/action.yml"
|
179
|
+
- ".github/workflows/main.yml"
|
79
180
|
- ".gitignore"
|
80
|
-
- ".gitmodules"
|
81
181
|
- ".rspec"
|
82
|
-
- ".
|
182
|
+
- ".rubocop.yml"
|
183
|
+
- CHANGELOG.md
|
83
184
|
- CODE_OF_CONDUCT.md
|
84
185
|
- Gemfile
|
186
|
+
- Guardfile
|
85
187
|
- LICENSE.txt
|
86
188
|
- README.md
|
87
189
|
- Rakefile
|
88
|
-
-
|
89
|
-
-
|
190
|
+
- demo/.mnogootexrc
|
191
|
+
- demo/demo.asciicast
|
192
|
+
- demo/demo.gif
|
193
|
+
- demo/main.tex
|
90
194
|
- exe/mnogootex
|
91
195
|
- lib/mnogootex.rb
|
92
|
-
- lib/mnogootex/
|
93
|
-
- lib/mnogootex/
|
196
|
+
- lib/mnogootex/cfg.rb
|
197
|
+
- lib/mnogootex/cli.rb
|
198
|
+
- lib/mnogootex/job/logger.rb
|
199
|
+
- lib/mnogootex/job/porter.rb
|
200
|
+
- lib/mnogootex/job/runner.rb
|
201
|
+
- lib/mnogootex/job/warden.rb
|
202
|
+
- lib/mnogootex/log.rb
|
203
|
+
- lib/mnogootex/log/level.rb
|
204
|
+
- lib/mnogootex/log/levels.yml
|
205
|
+
- lib/mnogootex/log/line.rb
|
206
|
+
- lib/mnogootex/log/matcher.rb
|
207
|
+
- lib/mnogootex/log/matchers.yml
|
208
|
+
- lib/mnogootex/log/processor.rb
|
209
|
+
- lib/mnogootex/utils.rb
|
94
210
|
- lib/mnogootex/version.rb
|
95
211
|
- mnogootex.gemspec
|
212
|
+
- spec/mnogootex/cfg_spec.rb
|
213
|
+
- spec/mnogootex/job/porter_spec.rb
|
214
|
+
- spec/mnogootex/job/runner_spec.rb
|
215
|
+
- spec/mnogootex/log/processor_spec.rb
|
216
|
+
- spec/mnogootex/utils_spec.rb
|
217
|
+
- spec/spec_helper.rb
|
96
218
|
homepage: https://github.com/tetrapharmakon/mnogootex
|
97
219
|
licenses:
|
98
220
|
- MIT
|
99
221
|
metadata: {}
|
100
|
-
post_install_message:
|
222
|
+
post_install_message:
|
101
223
|
rdoc_options: []
|
102
224
|
require_paths:
|
103
225
|
- lib
|
@@ -105,17 +227,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
105
227
|
requirements:
|
106
228
|
- - ">="
|
107
229
|
- !ruby/object:Gem::Version
|
108
|
-
version: '
|
230
|
+
version: '2.6'
|
109
231
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
232
|
requirements:
|
111
233
|
- - ">="
|
112
234
|
- !ruby/object:Gem::Version
|
113
235
|
version: '0'
|
114
236
|
requirements: []
|
115
|
-
|
116
|
-
|
117
|
-
signing_key:
|
237
|
+
rubygems_version: 3.1.4
|
238
|
+
signing_key:
|
118
239
|
specification_version: 4
|
119
|
-
summary:
|
120
|
-
|
240
|
+
summary: Многоꙮтех (mnogootex) is a utility that parallelizes compilation of a LaTeX
|
241
|
+
document using different classes and offers a meaningfully filtered output.
|
121
242
|
test_files: []
|
data/.gitmodules
DELETED
data/.travis.yml
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "mnogootex"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
require 'yaml'
|
4
|
-
|
5
|
-
module Mnogootex
|
6
|
-
class Configuration < Hash
|
7
|
-
DEFAULT = {
|
8
|
-
'animation' => '⣾⣽⣻⢿⡿⣟⣯⣷'
|
9
|
-
}
|
10
|
-
|
11
|
-
CFG_FILENAME = '.mnogootex.yml'.freeze
|
12
|
-
|
13
|
-
def initialize
|
14
|
-
@paths = []
|
15
|
-
merge! DEFAULT
|
16
|
-
end
|
17
|
-
|
18
|
-
def load(pathname = Dir.pwd)
|
19
|
-
scan_cfg Pathname(pathname)
|
20
|
-
filter_cfg
|
21
|
-
merge! load_cfg
|
22
|
-
self
|
23
|
-
end
|
24
|
-
|
25
|
-
private
|
26
|
-
|
27
|
-
def scan_cfg(pathname)
|
28
|
-
@paths << pathname.join(CFG_FILENAME)
|
29
|
-
return if pathname.root?
|
30
|
-
scan_cfg pathname.parent
|
31
|
-
end
|
32
|
-
|
33
|
-
def filter_cfg
|
34
|
-
@paths.
|
35
|
-
select!(&:readable?).
|
36
|
-
reject!(&:zero?)
|
37
|
-
end
|
38
|
-
|
39
|
-
def load_cfg
|
40
|
-
@paths.
|
41
|
-
reverse.
|
42
|
-
map { |pathname| YAML.load_file pathname }.
|
43
|
-
inject(&:merge!) # TODO: deep merge
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
data/lib/mnogootex/job.rb
DELETED
@@ -1,75 +0,0 @@
|
|
1
|
-
require 'digest'
|
2
|
-
require 'tmpdir'
|
3
|
-
require 'pathname'
|
4
|
-
|
5
|
-
module Mnogootex
|
6
|
-
class Job
|
7
|
-
attr_reader :thread, :stdout_stderr, :log, :ticks, :cls
|
8
|
-
|
9
|
-
def initialize(cls:, target:)
|
10
|
-
@main_path = File.expand_path target
|
11
|
-
@main_basename = File.basename @main_path
|
12
|
-
@main_dirname = File.dirname @main_path
|
13
|
-
raise "File non esiste." unless File.exist? @main_path
|
14
|
-
|
15
|
-
@cls = cls
|
16
|
-
@log = []
|
17
|
-
@ticks = 0
|
18
|
-
|
19
|
-
@id = Digest::MD5.hexdigest(@cls + @main_path)
|
20
|
-
end
|
21
|
-
|
22
|
-
def success?
|
23
|
-
@thread.value.exitstatus == 0
|
24
|
-
end
|
25
|
-
|
26
|
-
def tmp_dirname
|
27
|
-
@tmp_dirname ||= Pathname(Dir.tmpdir).join("mnogootex-#{@id}")
|
28
|
-
end
|
29
|
-
|
30
|
-
def setup
|
31
|
-
FileUtils.cp_r File.join(@main_dirname, '.'), tmp_dirname
|
32
|
-
|
33
|
-
@path = File.join tmp_dirname, @main_basename
|
34
|
-
|
35
|
-
code = File.read @path
|
36
|
-
replace = code.sub /\\documentclass(\[.*?\])?{.*?}/,
|
37
|
-
"\\documentclass{#{@cls}}"
|
38
|
-
|
39
|
-
File.open @path, "w" do |file|
|
40
|
-
file.puts replace
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def run
|
45
|
-
_, @stdout_stderr, @thread = Open3.popen2e(
|
46
|
-
"texfot",
|
47
|
-
"pdflatex",
|
48
|
-
# "latexmk",
|
49
|
-
# "-pdf",
|
50
|
-
"--shell-escape", # TODO: remove me!
|
51
|
-
"--interaction=nonstopmode",
|
52
|
-
@main_basename,
|
53
|
-
chdir: tmp_dirname
|
54
|
-
)
|
55
|
-
end
|
56
|
-
|
57
|
-
def tick_thread
|
58
|
-
Thread.new do
|
59
|
-
# 50ms polling cycle
|
60
|
-
until (line = @stdout_stderr.gets).nil? do
|
61
|
-
sleep 0.05
|
62
|
-
@log << line
|
63
|
-
@ticks += 1
|
64
|
-
draw_status
|
65
|
-
break unless @thread.alive?
|
66
|
-
end
|
67
|
-
# end of life treatment
|
68
|
-
lines = @stdout_stderr.read.lines
|
69
|
-
@log.concat lines
|
70
|
-
@ticks += lines.length
|
71
|
-
draw_status
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|