rails-latex 1.0.11 → 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.rdoc +1 -1
- data/lib/rails-latex/latex_to_pdf.rb +8 -2
- data/lib/rails-latex/version.rb +1 -1
- data/test/test_latex_to_pdf.rb +9 -1
- metadata +16 -18
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 184a55dac5d356018d4dc5d476c3a8110ec64f6c
|
4
|
+
data.tar.gz: e5976e30e07475083badf5c781b84cb9b34fa7a4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0081962be9aa3cc1f8efb61af0793e49e9b05ae2f67f7661896132afa564447ab9e800323906ce02a0f2e38004cb1b89f488d3dff2e5fbe373f7dde60f92c698
|
7
|
+
data.tar.gz: 4f9887516749dd1c74517c30cade07e517f132c543ca8d515752cb2276831952c0f937228253ebee567d488f76f7a6706cc2fdb70c44d715688e0d3a634017b9
|
data/README.rdoc
CHANGED
@@ -17,13 +17,18 @@ class LatexToPdf
|
|
17
17
|
dir=File.join(Rails.root,'tmp','rails-latex',"#{Process.pid}-#{Thread.current.hash}")
|
18
18
|
input=File.join(dir,'input.tex')
|
19
19
|
FileUtils.mkdir_p(dir)
|
20
|
+
# copy any additional supporting files (.cls, .sty, ...)
|
21
|
+
supporting = config[:supporting]
|
22
|
+
if supporting.class == String or supporting.class == Array and supporting.length > 0
|
23
|
+
FileUtils.cp(supporting, dir)
|
24
|
+
end
|
20
25
|
File.open(input,'wb') {|io| io.write(code) }
|
21
26
|
Process.waitpid(
|
22
27
|
fork do
|
23
28
|
begin
|
24
29
|
Dir.chdir dir
|
25
|
-
|
26
|
-
|
30
|
+
original_stdout, original_stderr = $stdout, $stderr
|
31
|
+
$stderr = $stdout = File.open("input.log","a")
|
27
32
|
args=config[:arguments] + %w[-shell-escape -interaction batchmode input.tex]
|
28
33
|
system config[:command],'-draftmode',*args if parse_twice
|
29
34
|
exec config[:command],*args
|
@@ -32,6 +37,7 @@ class LatexToPdf
|
|
32
37
|
io.write("#{$!.message}:\n#{$!.backtrace.join("\n")}\n")
|
33
38
|
}
|
34
39
|
ensure
|
40
|
+
$stdout, $stderr = original_stdout, original_stderr
|
35
41
|
Process.exit! 1
|
36
42
|
end
|
37
43
|
end)
|
data/lib/rails-latex/version.rb
CHANGED
data/test/test_latex_to_pdf.rb
CHANGED
@@ -46,7 +46,7 @@ class TestLatexToPdf < Test::Unit::TestCase
|
|
46
46
|
pdf_file=write_pdf do
|
47
47
|
LatexToPdf.generate_pdf(IO.read(File.expand_path('../test_broken_doc.tex',__FILE__)),{arguments: []})
|
48
48
|
end
|
49
|
-
assert_equal "
|
49
|
+
assert_equal "file with error\n\n1\n\n\f", `pdftotext #{pdf_file} -`
|
50
50
|
end
|
51
51
|
|
52
52
|
def test_generate_pdf_one_parse
|
@@ -68,4 +68,12 @@ class TestLatexToPdf < Test::Unit::TestCase
|
|
68
68
|
assert_equal ["#{TMP_DIR}/tmp/rails-latex/input.log"], Dir["#{TMP_DIR}/tmp/rails-latex/*"]
|
69
69
|
end
|
70
70
|
|
71
|
+
def test_doc_log_written
|
72
|
+
begin
|
73
|
+
LatexToPdf.generate_pdf(IO.read(File.expand_path('../test_doc.tex',__FILE__)),{})
|
74
|
+
assert_equal ["#{TMP_DIR}/tmp/rails-latex/input.log"], Dir["#{TMP_DIR}/tmp/rails-latex/*"]
|
75
|
+
assert( File.read("#{TMP_DIR}/tmp/rails-latex/input.log") =~ /entering extended mode/ )
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
71
79
|
end
|
metadata
CHANGED
@@ -1,46 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-latex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.12
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Geoff Jacobsen
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-12-09 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rails
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 3.0.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 3.0.0
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: RedCloth
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: 4.2.7
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: 4.2.7
|
46
41
|
description: rails-latex is a renderer for rails 3 which allows tex files with erb
|
@@ -100,27 +95,30 @@ files:
|
|
100
95
|
- test/test_latex_to_pdf.rb
|
101
96
|
homepage: http://github.com/jacott/rails-latex
|
102
97
|
licenses: []
|
98
|
+
metadata: {}
|
103
99
|
post_install_message:
|
104
100
|
rdoc_options:
|
105
101
|
- --main=README.rdoc
|
106
102
|
require_paths:
|
107
103
|
- lib
|
108
104
|
required_ruby_version: !ruby/object:Gem::Requirement
|
109
|
-
none: false
|
110
105
|
requirements:
|
111
|
-
- -
|
106
|
+
- - '>='
|
112
107
|
- !ruby/object:Gem::Version
|
113
108
|
version: '0'
|
114
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
|
-
none: false
|
116
110
|
requirements:
|
117
|
-
- -
|
111
|
+
- - '>='
|
118
112
|
- !ruby/object:Gem::Version
|
119
113
|
version: '0'
|
120
114
|
requirements: []
|
121
115
|
rubyforge_project:
|
122
|
-
rubygems_version:
|
116
|
+
rubygems_version: 2.0.3
|
123
117
|
signing_key:
|
124
|
-
specification_version:
|
118
|
+
specification_version: 4
|
125
119
|
summary: A LaTeX to pdf rails 3 renderer.
|
126
|
-
test_files:
|
120
|
+
test_files:
|
121
|
+
- test/helper.rb
|
122
|
+
- test/test_broken_doc.tex
|
123
|
+
- test/test_doc.tex
|
124
|
+
- test/test_latex_to_pdf.rb
|