pdflatex 0.1.1 → 0.1.3
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/lib/pdflatex.rb +13 -10
- data/lib/pdflatex/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c71006d185a5f9de04c445828b374b1d8c6c993
|
4
|
+
data.tar.gz: 7d2d344ad8715f440332ac1804020d9d75cd92b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ee25ec4902ac2304547a5278d3ebe7dce5801a6ec1b0b128c46ff3ed9b642abc0518665e941f3c10e79fc07b5d5a5dc19e99a1359cd4fde504c249c0554dbc2
|
7
|
+
data.tar.gz: 4258ed45790bfe5b8ea55100e5f0797dd043eae96210aa49c951fb4dcc6540846d99b56e02591e0ea4946120378c0f226a60d3483cc7aea7dbd917418c774e4f
|
data/lib/pdflatex.rb
CHANGED
@@ -8,19 +8,22 @@ 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
|
-
`docker run --rm -v #{path_to_latex_file}:/home/latex/compile.tex -v #{expanded_output_path}:/home/latex/out swissdrg/pdflatex`
|
11
|
+
output = `docker run --rm -v #{path_to_latex_file}:/home/latex/compile.tex -v #{expanded_output_path}:/home/latex/out swissdrg/pdflatex`
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
if $?.success?
|
14
|
+
# remove auxilary files
|
15
|
+
%w(aux fdb_latexmk fls log).each do |ext|
|
16
|
+
Dir.glob(File.join(expanded_output_path, "*.#{ext}")).each { |file| File.delete(file) }
|
17
|
+
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')
|
17
22
|
|
18
|
-
|
19
|
-
|
20
|
-
pdf_file = File.join(expanded_output_path, 'compile.pdf')
|
23
|
+
File.rename(pdf_file, File.join(expanded_output_path, "#{orig_file_name}.pdf"))
|
24
|
+
end
|
21
25
|
|
22
|
-
|
23
|
-
true
|
26
|
+
output
|
24
27
|
end
|
25
28
|
|
26
29
|
end
|
data/lib/pdflatex/version.rb
CHANGED