rails-latex 1.0.6 → 1.0.7
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.
- data/lib/rails-latex/latex_to_pdf.rb +3 -1
- data/lib/rails-latex/version.rb +1 -1
- data/test/test_latex_to_pdf.rb +3 -1
- metadata +2 -2
|
@@ -21,6 +21,8 @@ class LatexToPdf
|
|
|
21
21
|
Process.waitpid(fork do
|
|
22
22
|
begin
|
|
23
23
|
Dir.chdir dir
|
|
24
|
+
STDOUT.reopen("input.log","a")
|
|
25
|
+
STDERR.reopen(STDOUT)
|
|
24
26
|
args=config[:arguments] + ['-shell-escape','-interaction','batchmode',"input.tex"]
|
|
25
27
|
system config[:command],'-draftmode',*args if parse_twice
|
|
26
28
|
exec config[:command],*args
|
|
@@ -32,8 +34,8 @@ class LatexToPdf
|
|
|
32
34
|
Process.exit! 1
|
|
33
35
|
end
|
|
34
36
|
end)
|
|
35
|
-
FileUtils.mv(input.sub(/\.tex$/,'.log'),File.join(dir,'..','input.log'))
|
|
36
37
|
if File.exist?(pdf_file=input.sub(/\.tex$/,'.pdf'))
|
|
38
|
+
FileUtils.mv(input.sub(/\.tex$/,'.log'),File.join(dir,'..','input.log'))
|
|
37
39
|
result=File.read(pdf_file)
|
|
38
40
|
FileUtils.rm_rf(dir)
|
|
39
41
|
else
|
data/lib/rails-latex/version.rb
CHANGED
data/test/test_latex_to_pdf.rb
CHANGED
|
@@ -14,7 +14,9 @@ class TestLatexToPdf < Test::Unit::TestCase
|
|
|
14
14
|
|
|
15
15
|
def test_generate_pdf
|
|
16
16
|
FileUtils.mkdir_p(TMP_DIR)
|
|
17
|
-
|
|
17
|
+
pdf_file=File.join(TMP_DIR,'out.pdf')
|
|
18
|
+
File.delete(pdf_file) if File.exist?(pdf_file)
|
|
19
|
+
File.open(pdf_file,'wb') do |wio|
|
|
18
20
|
wio.write(LatexToPdf.generate_pdf(IO.read(File.expand_path('../test_doc.tex',__FILE__)),{}))
|
|
19
21
|
end
|
|
20
22
|
assert_equal "hello world\n\n1\n\n\f", `pdftotext #{pdf_file} -`
|
metadata
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: rails-latex
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease:
|
|
5
|
-
version: 1.0.
|
|
5
|
+
version: 1.0.7
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
8
8
|
- Geoff Jacobsen
|
|
@@ -10,7 +10,7 @@ autorequire:
|
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
12
|
|
|
13
|
-
date: 2011-07-
|
|
13
|
+
date: 2011-07-14 00:00:00 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: rails
|