rails-latex 1.0.13 → 1.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 66a305f9f4b7a67e7caf7bc1deb5d1477b675961
4
+ data.tar.gz: d1c41b626dd8f23cc7b9c7fe9eacfe41d0e4ad8d
5
+ SHA512:
6
+ metadata.gz: 3d9c3bfbf5f595917e3cfcb8b64c7eacff5a144a33c5ee4fbcc607e8f51d37ec9feeed4060290837fe4c17c14fccea4c4ca85af1cb0cb2f70ded6274fb98a4a0
7
+ data.tar.gz: 3830aeef0ccbd91cf629bec1cab67288121614c9cee5cf2a12052cc5cffbfd9be2bc5b0b26c16b7942cf9869d7d58a0f0dec21f0ebd4bcb5f0cc200f7c832df4
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
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.
4
+
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.
6
+
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.
8
+
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.
10
+
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.
12
+
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/)
data/Gemfile CHANGED
@@ -1,4 +1,9 @@
1
- source "http://rubygems.org"
1
+ 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/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 Geoff Jacobsen
1
+ Copyright (c) 2010-2015 Geoff Jacobsen, Jan Baier and contributors
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc CHANGED
@@ -1,8 +1,8 @@
1
1
  = Rails-LaTeX
2
2
 
3
- * Git: http://github.com/baierjan/rails-latex
3
+ * Git: https://github.com/baierjan/rails-latex
4
4
  * Original author: Geoff Jacobsen
5
- * Copyright: 2009-2010
5
+ * Copyright: 2010-2015 Geoff Jacobsen, Jan Baier and contributors
6
6
  * License: MIT-LICENSE
7
7
 
8
8
  == Description
@@ -1,4 +1,4 @@
1
- source 'http://rubygems.org'
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 3.2'
4
4
 
@@ -1,11 +1,11 @@
1
1
  PATH
2
2
  remote: ../../
3
3
  specs:
4
- rails-latex (1.0.11)
4
+ rails-latex (1.0.14)
5
5
  rails (>= 3.0.0)
6
6
 
7
7
  GEM
8
- remote: http://rubygems.org/
8
+ remote: https://rubygems.org/
9
9
  specs:
10
10
  actionmailer (3.2.8)
11
11
  actionpack (= 3.2.8)
@@ -1,5 +1,5 @@
1
1
  # Sample localization file for English. Add more files in this directory for other locales.
2
- # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
3
 
4
4
  en:
5
5
  hello: "Hello world"
@@ -16,7 +16,7 @@ class LatexToPdf
16
16
  config=self.config.merge(config)
17
17
  parse_twice=config[:parse_twice] if parse_twice.nil? # deprecated
18
18
  parse_runs=[config[:parse_runs], (parse_twice ? 2 : config[:parse_runs])].max
19
- puts "Running Latex #{parse_runs} times..."
19
+ Rails.logger.info "Running Latex #{parse_runs} times..."
20
20
  dir=File.join(Rails.root,'tmp','rails-latex',"#{Process.pid}-#{Thread.current.hash}")
21
21
  input=File.join(dir,'input.tex')
22
22
  FileUtils.mkdir_p(dir)
@@ -30,19 +30,17 @@ class LatexToPdf
30
30
  fork do
31
31
  begin
32
32
  Dir.chdir dir
33
- original_stdout, original_stderr = $stdout, $stderr
34
- $stderr = $stdout = File.open("input.log","a")
35
33
  args=config[:arguments] + %w[-shell-escape -interaction batchmode input.tex]
34
+ kwargs={:out => ["input.log","a"]}
36
35
  (parse_runs-1).times do
37
- system config[:command],'-draftmode',*args
36
+ system config[:command],'-draftmode',*args,**kwargs
38
37
  end
39
- exec config[:command],*args
38
+ exec config[:command],*args,**kwargs
40
39
  rescue
41
40
  File.open("input.log",'a') {|io|
42
41
  io.write("#{$!.message}:\n#{$!.backtrace.join("\n")}\n")
43
42
  }
44
43
  ensure
45
- $stdout, $stderr = original_stdout, original_stderr
46
44
  Process.exit! 1
47
45
  end
48
46
  end)
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module Latex
3
- VERSION = "1.0.13"
3
+ VERSION = "1.0.14"
4
4
  end
5
5
  end
data/rails-latex.gemspec CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
7
7
  s.version = Rails::Latex::VERSION
8
8
  s.authors = ["Jan Baier", "Geoff Jacobsen"]
9
9
  s.email = ["jan.baier@amagical.net"]
10
- s.homepage = "http://github.com/baierjan/rails-latex"
10
+ s.homepage = "https://github.com/baierjan/rails-latex"
11
11
  s.summary = %q{A LaTeX to pdf rails 3 renderer.}
12
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
13
  #s.licence = "MIT"
@@ -1,4 +1,6 @@
1
1
  \documentclass{article}
2
+ \usepackage{microtype}
3
+ \DisableLigatures{encoding = *, family = * }
2
4
 
3
5
  \begin{document}
4
6
 
data/test/test_doc.tex CHANGED
@@ -1,5 +1,7 @@
1
1
  \documentclass{article}
2
2
  \usepackage{lastpage}
3
+ \usepackage{microtype}
4
+ \DisableLigatures{encoding = *, family = * }
3
5
 
4
6
  \begin{document}
5
7
  The last page is \pageref{LastPage}.
@@ -0,0 +1,5 @@
1
+ ENV['RAILS_ENV'] ||= 'test'
2
+ require 'minitest/autorun'
3
+
4
+ require 'minitest/reporters'
5
+ Minitest::Reporters.use!
@@ -1,11 +1,12 @@
1
1
  # -*- coding: utf-8 -*-
2
- require 'helper'
3
2
  require 'rails-latex/erb_latex'
4
3
  require 'ostruct'
4
+ require 'pathname'
5
+ require 'logger'
5
6
 
6
- Rails=OpenStruct.new(:root => TMP_DIR=File.expand_path("../tmp",__FILE__))
7
+ Rails=OpenStruct.new(:root => TMP_DIR=File.expand_path("../tmp",__FILE__), :logger => Logger.new(STDERR))
7
8
 
8
- class TestLatexToPdf < Test::Unit::TestCase
9
+ class TestLatexToPdf < Minitest::Test
9
10
  def setup
10
11
  super
11
12
  FileUtils.rm_rf("#{TMP_DIR}/tmp/rails-latex")
@@ -55,7 +56,7 @@ class TestLatexToPdf < Test::Unit::TestCase
55
56
  end
56
57
  assert_equal "The last page is ??.\n\n1\n\n\f", `pdftotext #{pdf_file} -`
57
58
 
58
- assert_equal ["#{TMP_DIR}/tmp/rails-latex/input.log"], Dir["#{TMP_DIR}/tmp/rails-latex/*"]
59
+ assert_equal ["#{TMP_DIR}/tmp/rails-latex/input.log"], Dir["#{TMP_DIR}/tmp/rails-latex/*.log"]
59
60
  end
60
61
 
61
62
  def test_generate_pdf_two_parse
@@ -65,7 +66,7 @@ class TestLatexToPdf < Test::Unit::TestCase
65
66
  end
66
67
  assert_equal "The last page is 1.\n\n1\n\n\f", `pdftotext #{pdf_file} -`
67
68
 
68
- assert_equal ["#{TMP_DIR}/tmp/rails-latex/input.log"], Dir["#{TMP_DIR}/tmp/rails-latex/*"]
69
+ assert_equal ["#{TMP_DIR}/tmp/rails-latex/input.log"], Dir["#{TMP_DIR}/tmp/rails-latex/*.log"]
69
70
  end
70
71
 
71
72
  def test_generate_pdf_parse_runs
@@ -75,13 +76,13 @@ class TestLatexToPdf < Test::Unit::TestCase
75
76
  end
76
77
  assert_equal "The last page is 1.\n\n1\n\n\f", `pdftotext #{pdf_file} -`
77
78
 
78
- assert_equal ["#{TMP_DIR}/tmp/rails-latex/input.log"], Dir["#{TMP_DIR}/tmp/rails-latex/*"]
79
+ assert_equal ["#{TMP_DIR}/tmp/rails-latex/input.log"], Dir["#{TMP_DIR}/tmp/rails-latex/*.log"]
79
80
  end
80
81
 
81
82
  def test_doc_log_written
82
83
  begin
83
84
  LatexToPdf.generate_pdf(IO.read(File.expand_path('../test_doc.tex',__FILE__)),{})
84
- assert_equal ["#{TMP_DIR}/tmp/rails-latex/input.log"], Dir["#{TMP_DIR}/tmp/rails-latex/*"]
85
+ assert_equal ["#{TMP_DIR}/tmp/rails-latex/input.log"], Dir["#{TMP_DIR}/tmp/rails-latex/*.log"]
85
86
  assert( File.read("#{TMP_DIR}/tmp/rails-latex/input.log") =~ /entering extended mode/ )
86
87
  end
87
88
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-latex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.13
5
- prerelease:
4
+ version: 1.0.14
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jan Baier
@@ -10,38 +9,34 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2015-01-22 00:00:00.000000000 Z
12
+ date: 2016-07-01 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rails
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ! '>='
18
+ - - ">="
21
19
  - !ruby/object:Gem::Version
22
20
  version: 3.0.0
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
- - - ! '>='
25
+ - - ">="
29
26
  - !ruby/object:Gem::Version
30
27
  version: 3.0.0
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: RedCloth
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
- - - ! '>='
32
+ - - ">="
37
33
  - !ruby/object:Gem::Version
38
34
  version: 4.2.7
39
35
  type: :development
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
- - - ! '>='
39
+ - - ">="
45
40
  - !ruby/object:Gem::Version
46
41
  version: 4.2.7
47
42
  description: rails-latex is a renderer for rails 3 which allows tex files with erb
@@ -54,7 +49,8 @@ extra_rdoc_files:
54
49
  - MIT-LICENSE
55
50
  - README.rdoc
56
51
  files:
57
- - .gitignore
52
+ - ".gitignore"
53
+ - CODE_OF_CONDUCT.md
58
54
  - Gemfile
59
55
  - MIT-LICENSE
60
56
  - README.rdoc
@@ -95,33 +91,32 @@ files:
95
91
  - lib/rails-latex/latex_to_pdf.rb
96
92
  - lib/rails-latex/version.rb
97
93
  - rails-latex.gemspec
98
- - test/helper.rb
99
94
  - test/test_broken_doc.tex
100
95
  - test/test_doc.tex
96
+ - test/test_helper.rb
101
97
  - test/test_latex_to_pdf.rb
102
- homepage: http://github.com/baierjan/rails-latex
98
+ homepage: https://github.com/baierjan/rails-latex
103
99
  licenses: []
100
+ metadata: {}
104
101
  post_install_message:
105
102
  rdoc_options:
106
- - --main=README.rdoc
103
+ - "--main=README.rdoc"
107
104
  require_paths:
108
105
  - lib
109
106
  required_ruby_version: !ruby/object:Gem::Requirement
110
- none: false
111
107
  requirements:
112
- - - ! '>='
108
+ - - ">="
113
109
  - !ruby/object:Gem::Version
114
110
  version: '0'
115
111
  required_rubygems_version: !ruby/object:Gem::Requirement
116
- none: false
117
112
  requirements:
118
- - - ! '>='
113
+ - - ">="
119
114
  - !ruby/object:Gem::Version
120
115
  version: '0'
121
116
  requirements: []
122
117
  rubyforge_project:
123
- rubygems_version: 1.8.23
118
+ rubygems_version: 2.2.2
124
119
  signing_key:
125
- specification_version: 3
120
+ specification_version: 4
126
121
  summary: A LaTeX to pdf rails 3 renderer.
127
122
  test_files: []
data/test/helper.rb DELETED
@@ -1,8 +0,0 @@
1
- require 'rubygems'
2
- require 'test/unit'
3
-
4
- $LOAD_PATH.unshift(File.dirname(__FILE__))
5
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
-
7
- class Test::Unit::TestCase
8
- end