pdflatex 0.1.3 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c71006d185a5f9de04c445828b374b1d8c6c993
4
- data.tar.gz: 7d2d344ad8715f440332ac1804020d9d75cd92b9
3
+ metadata.gz: ec7acb35c16d498b19e0bc125fb671493770ff7d
4
+ data.tar.gz: 4ead2c891f88c23e8200b5f1994e04572030214e
5
5
  SHA512:
6
- metadata.gz: 7ee25ec4902ac2304547a5278d3ebe7dce5801a6ec1b0b128c46ff3ed9b642abc0518665e941f3c10e79fc07b5d5a5dc19e99a1359cd4fde504c249c0554dbc2
7
- data.tar.gz: 4258ed45790bfe5b8ea55100e5f0797dd043eae96210aa49c951fb4dcc6540846d99b56e02591e0ea4946120378c0f226a60d3483cc7aea7dbd917418c774e4f
6
+ metadata.gz: c79505c0cc6fae12354994af91c3aa41d27e497130103692486f20793b58d6aed6e3d6e66f144d64e2bde5c83fa92cc514a49991b3e5d0a44003e8ed2eb47493
7
+ data.tar.gz: fb6f2ca45afe4bf5f95efa3969eae60c9e6f0f38ea54ace915a6cd28d71205285e435b88658c73995cfdda09caa2276d321201364cf005c129c3f6c361ec6a35
@@ -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
- output = `docker run --rm -v #{path_to_latex_file}:/home/latex/compile.tex -v #{expanded_output_path}:/home/latex/out swissdrg/pdflatex`
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
@@ -1,3 +1,3 @@
1
1
  module Pdflatex
2
- VERSION = "0.1.3".freeze
2
+ VERSION = "0.2.0".freeze
3
3
  end
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.1.3
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-05-22 00:00:00.000000000 Z
11
+ date: 2017-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler