pdflatex 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pdflatex.rb +12 -7
- data/lib/pdflatex/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec7acb35c16d498b19e0bc125fb671493770ff7d
|
4
|
+
data.tar.gz: 4ead2c891f88c23e8200b5f1994e04572030214e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c79505c0cc6fae12354994af91c3aa41d27e497130103692486f20793b58d6aed6e3d6e66f144d64e2bde5c83fa92cc514a49991b3e5d0a44003e8ed2eb47493
|
7
|
+
data.tar.gz: fb6f2ca45afe4bf5f95efa3969eae60c9e6f0f38ea54ace915a6cd28d71205285e435b88658c73995cfdda09caa2276d321201364cf005c129c3f6c361ec6a35
|
data/lib/pdflatex.rb
CHANGED
@@ -8,19 +8,24 @@ module Pdflatex
|
|
8
8
|
path_to_latex_file = File.expand_path(latex_file)
|
9
9
|
expanded_output_path = File.expand_path(output_path)
|
10
10
|
|
11
|
-
|
11
|
+
latex_file_name = File.basename(latex_file)
|
12
|
+
|
13
|
+
cmd = <<-CMD.gsub(/\s+/, ' ')
|
14
|
+
docker run
|
15
|
+
--rm
|
16
|
+
-v #{path_to_latex_file}:/home/latex/#{latex_file_name}
|
17
|
+
-v #{expanded_output_path}:/home/latex/out
|
18
|
+
swissdrg/pdflatex
|
19
|
+
latexmk -outdir=out -pdf #{latex_file_name}
|
20
|
+
CMD
|
21
|
+
|
22
|
+
output = `#{cmd}`
|
12
23
|
|
13
24
|
if $?.success?
|
14
25
|
# remove auxilary files
|
15
26
|
%w(aux fdb_latexmk fls log).each do |ext|
|
16
27
|
Dir.glob(File.join(expanded_output_path, "*.#{ext}")).each { |file| File.delete(file) }
|
17
28
|
end
|
18
|
-
|
19
|
-
# rename pdf back to original file name
|
20
|
-
orig_file_name = File.basename(path_to_latex_file, '.*')
|
21
|
-
pdf_file = File.join(expanded_output_path, 'compile.pdf')
|
22
|
-
|
23
|
-
File.rename(pdf_file, File.join(expanded_output_path, "#{orig_file_name}.pdf"))
|
24
29
|
end
|
25
30
|
|
26
31
|
output
|
data/lib/pdflatex/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdflatex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Urs Gerber
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|