rails-latex 1.0.14 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66a305f9f4b7a67e7caf7bc1deb5d1477b675961
4
- data.tar.gz: d1c41b626dd8f23cc7b9c7fe9eacfe41d0e4ad8d
3
+ metadata.gz: bb31bffd5ef1b8e7a9f6205bd7ab585667fee417
4
+ data.tar.gz: a50a09e05e6c1ec0ac1e3697eabc5d96b62805c5
5
5
  SHA512:
6
- metadata.gz: 3d9c3bfbf5f595917e3cfcb8b64c7eacff5a144a33c5ee4fbcc607e8f51d37ec9feeed4060290837fe4c17c14fccea4c4ca85af1cb0cb2f70ded6274fb98a4a0
7
- data.tar.gz: 3830aeef0ccbd91cf629bec1cab67288121614c9cee5cf2a12052cc5cffbfd9be2bc5b0b26c16b7942cf9869d7d58a0f0dec21f0ebd4bcb5f0cc200f7c832df4
6
+ metadata.gz: 478c60ff7480b8fd6fb7b61e9dc8cab2ed58d2356e1a11a5e25c95c0db44cbf6817f3120a31b96edce2d02c3597bda0d2578b4b9137806cf1bff55b440c7b3d3
7
+ data.tar.gz: 34586f31f0e40388875fa72bf7686d5363f3a8e47ea81852a9c5b7e85542db4de8edaf8cc4e52f99c56ea35c0551496f76627a2194682f338d45f3fb538f91ec
data/CODE_OF_CONDUCT.md CHANGED
@@ -1,13 +1,49 @@
1
1
  # Contributor Code of Conduct
2
2
 
3
- As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
4
7
 
5
- We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
6
12
 
7
- Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
13
+ Examples of unacceptable behavior by participants include:
8
14
 
9
- Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
10
22
 
11
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
12
28
 
13
- This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at jan.baier@amagical.net. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile CHANGED
@@ -2,8 +2,3 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in rails-latex.gemspec
4
4
  gemspec
5
-
6
-
7
- group :test do
8
- gem 'minitest-reporters', require: nil
9
- end
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2010-2016 Geoff Jacobsen, Jan Baier and contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/Rakefile CHANGED
@@ -1,21 +1,11 @@
1
- require 'bundler/gem_tasks' rescue nil
2
-
3
- require 'rake/testtask'
4
- Rake::TestTask.new(:test) do |test|
5
- test.libs << 'lib' << 'test'
6
- test.pattern = 'test/**/test_*.rb'
7
- test.verbose = true
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList['test/**/test_*.rb']
8
+ t.verbose = true
8
9
  end
9
10
 
10
11
  task :default => :test
11
-
12
- require 'rdoc/task'
13
- Rake::RDocTask.new do |rdoc|
14
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
15
-
16
- rdoc.rdoc_dir = 'rdoc'
17
- rdoc.title = "Rails-LaTeX #{version}"
18
- rdoc.rdoc_files.include('README.rdoc')
19
- rdoc.rdoc_files.include('MIT-LICENSE')
20
- rdoc.rdoc_files.include('lib/**/*.rb')
21
- end
@@ -1,10 +1,10 @@
1
1
  \documentclass[12pt,a4paper,sloppy]{article}
2
- <% @latex_config={:command => 'pdflatex',:parse_twice => true} # you can override the defaults if you wish; see LatexToPdf#config %>
2
+ <% @latex_config={:command => 'pdflatex',:parse_runs => 2} # you can override the defaults if you wish; see LatexToPdf#config %>
3
3
  \usepackage{lastpage}
4
4
  \usepackage{graphics}
5
5
  \begin{document}
6
6
 
7
- This document uses \verb|parse_twice| to calculate the last page.
7
+ This document uses \verb|parse_runs = 2| to calculate the last page.
8
8
 
9
9
  Other defaults can be overridden using \verb|LatexToPdf#config| and \verb|@latex_config|.
10
10
 
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  class LatexToPdf
3
3
  def self.config
4
- @config||={:command => 'pdflatex', :arguments => ['-halt-on-error'], :parse_twice => false, :parse_runs => 1}
4
+ @config||={:command => 'pdflatex', :arguments => ['-halt-on-error'], :parse_runs => 1}
5
5
  end
6
6
 
7
7
  # Converts a string of LaTeX +code+ into a binary string of PDF.
@@ -10,12 +10,9 @@ class LatexToPdf
10
10
  # files.
11
11
  #
12
12
  # The config argument defaults to LatexToPdf.config but can be overridden using @latex_config.
13
- #
14
- # The parse_twice argument and using config[:parse_twice] is deprecated in favor of using config[:parse_runs] instead.
15
13
  def self.generate_pdf(code,config,parse_twice=nil)
16
14
  config=self.config.merge(config)
17
- parse_twice=config[:parse_twice] if parse_twice.nil? # deprecated
18
- parse_runs=[config[:parse_runs], (parse_twice ? 2 : config[:parse_runs])].max
15
+ parse_runs=config[:parse_runs]
19
16
  Rails.logger.info "Running Latex #{parse_runs} times..."
20
17
  dir=File.join(Rails.root,'tmp','rails-latex',"#{Process.pid}-#{Thread.current.hash}")
21
18
  input=File.join(dir,'input.tex')
@@ -1,5 +1,3 @@
1
- module Rails
2
- module Latex
3
- VERSION = "1.0.14"
4
- end
1
+ module RailsLatex
2
+ VERSION = "2.0.0"
5
3
  end
data/rails-latex.gemspec CHANGED
@@ -1,28 +1,28 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "rails-latex/version"
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'rails-latex/version'
4
5
 
5
- Gem::Specification.new do |s|
6
- s.name = "rails-latex"
7
- s.version = Rails::Latex::VERSION
8
- s.authors = ["Jan Baier", "Geoff Jacobsen"]
9
- s.email = ["jan.baier@amagical.net"]
10
- s.homepage = "https://github.com/baierjan/rails-latex"
11
- s.summary = %q{A LaTeX to pdf rails 3 renderer.}
12
- s.description = %q{rails-latex is a renderer for rails 3 which allows tex files with erb to be turned into an inline pdf.}
13
- #s.licence = "MIT"
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "rails-latex"
8
+ spec.version = RailsLatex::VERSION
9
+ spec.authors = ["Jan Baier", "Geoff Jacobsen"]
10
+ spec.email = ["jan.baier@amagical.net"]
14
11
 
15
- s.files = `git ls-files`.split("\n")
16
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
12
+ spec.summary = %q{A LaTeX to PDF rails renderer.}
13
+ spec.description = %q{rails-latex is a renderer for rails 3 which allows tex files with erb to be turned into an inline pdf.}
14
+ spec.homepage = "https://github.com/amagical.net/rails-latex"
15
+ spec.license = "MIT"
18
16
 
19
- s.rdoc_options = [%q{--main=README.rdoc}]
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
20
21
 
21
- s.extra_rdoc_files = [
22
- "MIT-LICENSE",
23
- "README.rdoc"
24
- ]
25
-
26
- s.add_dependency(%q<rails>, [">= 3.0.0"])
27
- s.add_development_dependency(%q<RedCloth>, [">= 4.2.7"])
22
+ spec.add_dependency "rails", "~> 3.0"
23
+ spec.add_development_dependency "RedCloth", "~> 4.2"
24
+ spec.add_development_dependency "bundler", "~> 1.12"
25
+ spec.add_development_dependency "rake", "~> 10.0"
26
+ spec.add_development_dependency "minitest", "~> 5.0"
27
+ spec.add_development_dependency "minitest-reporters", "~> 1.1"
28
28
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-latex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.14
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Baier
8
8
  - Geoff Jacobsen
9
9
  autorequire:
10
- bindir: bin
10
+ bindir: exe
11
11
  cert_chain: []
12
12
  date: 2016-07-01 00:00:00.000000000 Z
13
13
  dependencies:
@@ -15,44 +15,98 @@ dependencies:
15
15
  name: rails
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 3.0.0
20
+ version: '3.0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 3.0.0
27
+ version: '3.0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: RedCloth
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ">="
32
+ - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 4.2.7
34
+ version: '4.2'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ">="
39
+ - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 4.2.7
41
+ version: '4.2'
42
+ - !ruby/object:Gem::Dependency
43
+ name: bundler
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '1.12'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '1.12'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rake
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '10.0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '10.0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: minitest
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '5.0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: '5.0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: minitest-reporters
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: '1.1'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: '1.1'
42
98
  description: rails-latex is a renderer for rails 3 which allows tex files with erb
43
99
  to be turned into an inline pdf.
44
100
  email:
45
101
  - jan.baier@amagical.net
46
102
  executables: []
47
103
  extensions: []
48
- extra_rdoc_files:
49
- - MIT-LICENSE
50
- - README.rdoc
104
+ extra_rdoc_files: []
51
105
  files:
52
106
  - ".gitignore"
53
107
  - CODE_OF_CONDUCT.md
54
108
  - Gemfile
55
- - MIT-LICENSE
109
+ - LICENSE.txt
56
110
  - README.rdoc
57
111
  - Rakefile
58
112
  - examples/rails-latex-demo/Gemfile
@@ -91,16 +145,12 @@ files:
91
145
  - lib/rails-latex/latex_to_pdf.rb
92
146
  - lib/rails-latex/version.rb
93
147
  - rails-latex.gemspec
94
- - test/test_broken_doc.tex
95
- - test/test_doc.tex
96
- - test/test_helper.rb
97
- - test/test_latex_to_pdf.rb
98
- homepage: https://github.com/baierjan/rails-latex
99
- licenses: []
148
+ homepage: https://github.com/amagical.net/rails-latex
149
+ licenses:
150
+ - MIT
100
151
  metadata: {}
101
152
  post_install_message:
102
- rdoc_options:
103
- - "--main=README.rdoc"
153
+ rdoc_options: []
104
154
  require_paths:
105
155
  - lib
106
156
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -118,5 +168,5 @@ rubyforge_project:
118
168
  rubygems_version: 2.2.2
119
169
  signing_key:
120
170
  specification_version: 4
121
- summary: A LaTeX to pdf rails 3 renderer.
171
+ summary: A LaTeX to PDF rails renderer.
122
172
  test_files: []
data/MIT-LICENSE DELETED
@@ -1,21 +0,0 @@
1
- Copyright (c) 2010-2015 Geoff Jacobsen, Jan Baier and contributors
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
-
@@ -1,9 +0,0 @@
1
- \documentclass{article}
2
- \usepackage{microtype}
3
- \DisableLigatures{encoding = *, family = * }
4
-
5
- \begin{document}
6
-
7
- file with \nosuchcommand\ error
8
-
9
- \end{document}
data/test/test_doc.tex DELETED
@@ -1,8 +0,0 @@
1
- \documentclass{article}
2
- \usepackage{lastpage}
3
- \usepackage{microtype}
4
- \DisableLigatures{encoding = *, family = * }
5
-
6
- \begin{document}
7
- The last page is \pageref{LastPage}.
8
- \end{document}
data/test/test_helper.rb DELETED
@@ -1,5 +0,0 @@
1
- ENV['RAILS_ENV'] ||= 'test'
2
- require 'minitest/autorun'
3
-
4
- require 'minitest/reporters'
5
- Minitest::Reporters.use!
@@ -1,90 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- require 'rails-latex/erb_latex'
3
- require 'ostruct'
4
- require 'pathname'
5
- require 'logger'
6
-
7
- Rails=OpenStruct.new(:root => TMP_DIR=File.expand_path("../tmp",__FILE__), :logger => Logger.new(STDERR))
8
-
9
- class TestLatexToPdf < Minitest::Test
10
- def setup
11
- super
12
- FileUtils.rm_rf("#{TMP_DIR}/tmp/rails-latex")
13
- end
14
-
15
- def teardown
16
- super
17
- LatexToPdf.instance_eval { @config=nil }
18
- end
19
-
20
- def write_pdf
21
- FileUtils.mkdir_p(TMP_DIR)
22
- pdf_file=File.join(TMP_DIR,'out.pdf')
23
- File.delete(pdf_file) if File.exist?(pdf_file)
24
- File.open(pdf_file,'wb') do |wio|
25
- wio.write(yield)
26
- end
27
- pdf_file
28
- end
29
-
30
- def test_escape
31
- assert_equal "dsf \\textless{} \\textgreater{} \\& ! @ \\# \\$ \\% \\textasciicircum{} \\textasciitilde{} \\textbackslash{} fds", LatexToPdf.escape_latex('dsf < > & ! @ # $ % ^ ~ \\ fds')
32
- LatexToPdf.instance_eval{@latex_escaper=nil}
33
- require 'redcloth'
34
- assert_equal "dsf \\textless{} \\textgreater{} \\& ! @ \\# \\$ \\% \\^{} \\~{} \\textbackslash{} fds", LatexToPdf.escape_latex('dsf < > & ! @ # $ % ^ ~ \\ fds')
35
- end
36
-
37
- def test_broken_doc_halt_on_error
38
- begin
39
- LatexToPdf.generate_pdf(IO.read(File.expand_path('../test_broken_doc.tex',__FILE__)),{})
40
- fail "Should throw exception"
41
- rescue => e
42
- assert(/^pdflatex failed: See / =~ e.message)
43
- end
44
- end
45
-
46
- def test_broken_doc_overriding_halt_on_error
47
- pdf_file=write_pdf do
48
- LatexToPdf.generate_pdf(IO.read(File.expand_path('../test_broken_doc.tex',__FILE__)),{arguments: []})
49
- end
50
- assert_equal "file with error\n\n1\n\n\f", `pdftotext #{pdf_file} -`
51
- end
52
-
53
- def test_generate_pdf_one_parse
54
- pdf_file=write_pdf do
55
- LatexToPdf.generate_pdf(IO.read(File.expand_path('../test_doc.tex',__FILE__)),{})
56
- end
57
- assert_equal "The last page is ??.\n\n1\n\n\f", `pdftotext #{pdf_file} -`
58
-
59
- assert_equal ["#{TMP_DIR}/tmp/rails-latex/input.log"], Dir["#{TMP_DIR}/tmp/rails-latex/*.log"]
60
- end
61
-
62
- def test_generate_pdf_two_parse
63
- pdf_file=write_pdf do
64
- LatexToPdf.config[:parse_twice]=true
65
- LatexToPdf.generate_pdf(IO.read(File.expand_path('../test_doc.tex',__FILE__)),{})
66
- end
67
- assert_equal "The last page is 1.\n\n1\n\n\f", `pdftotext #{pdf_file} -`
68
-
69
- assert_equal ["#{TMP_DIR}/tmp/rails-latex/input.log"], Dir["#{TMP_DIR}/tmp/rails-latex/*.log"]
70
- end
71
-
72
- def test_generate_pdf_parse_runs
73
- pdf_file=write_pdf do
74
- LatexToPdf.config[:parse_runs]=2
75
- LatexToPdf.generate_pdf(IO.read(File.expand_path('../test_doc.tex',__FILE__)),{})
76
- end
77
- assert_equal "The last page is 1.\n\n1\n\n\f", `pdftotext #{pdf_file} -`
78
-
79
- assert_equal ["#{TMP_DIR}/tmp/rails-latex/input.log"], Dir["#{TMP_DIR}/tmp/rails-latex/*.log"]
80
- end
81
-
82
- def test_doc_log_written
83
- begin
84
- LatexToPdf.generate_pdf(IO.read(File.expand_path('../test_doc.tex',__FILE__)),{})
85
- assert_equal ["#{TMP_DIR}/tmp/rails-latex/input.log"], Dir["#{TMP_DIR}/tmp/rails-latex/*.log"]
86
- assert( File.read("#{TMP_DIR}/tmp/rails-latex/input.log") =~ /entering extended mode/ )
87
- end
88
- end
89
-
90
- end