rtex 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,14 +1,14 @@
1
- = RTeX Rails plugin
1
+ = RTeX for Rails
2
2
 
3
3
  == Installation
4
4
 
5
5
  sudo gem install rtex
6
6
 
7
- Rails 2.0.X, 2.1 in vendor/plugins:
7
+ Rails 2.0.X, 2.1+ in vendor/plugins (not recommended):
8
8
  rtex --install /path/to/rails/app
9
9
 
10
- Or, as a Rails 2.1 gem dependency, just add the following
11
- to your <tt>config/environment.rb</tt>:
10
+ Or, as a Rails 2.1+ gem dependency, just add the following
11
+ to your config/environment.rb:
12
12
  config.gem 'rtex'
13
13
 
14
14
  == Dependencies
@@ -17,10 +17,10 @@ to your <tt>config/environment.rb</tt>:
17
17
 
18
18
  == Usage
19
19
 
20
- Create files +pdf.rtex+ extensions (eg, +index.pdf.rtex+) using standard LaTeX markup.
20
+ Create files pdf.rtex extensions (eg, index.pdf.rtex) using standard LaTeX markup.
21
21
 
22
- * Layouts are supported, eg: +application.pdf.rtex+
23
- * Partials are supported, eg: +_item.pdf.rtex+
22
+ * Layouts are supported, eg: application.pdf.rtex
23
+ * Partials are supported, eg: _item.pdf.rtex
24
24
 
25
25
  === Example
26
26
 
@@ -53,6 +53,6 @@ With the following:
53
53
  <%= yield %>
54
54
  \end{document}
55
55
 
56
- If you hit +http://the.server.url/items.pdf+, you end up with a nice PDF listing of items.
56
+ If you hit /items.pdf, you end up with a nice PDF listing of items.
57
57
 
58
58
  Obviously a simplistic example.
@@ -33,6 +33,7 @@ module RTeX
33
33
  def render_with_rtex(options=nil, *args, &block)
34
34
  result = render_without_rtex(options, *args, &block)
35
35
  if result.is_a?(String) && Thread.current[:_rendering_rtex]
36
+ Thread.current[:_rendering_rtex] = false
36
37
  options ||= {}
37
38
  ::RTeX::Document.new(result, options.merge(:processed => true)).to_pdf do |filename|
38
39
  serve_file = Tempfile.new('rtex-pdf')
@@ -45,6 +46,8 @@ module RTeX
45
46
  :length => File.size(serve_file.path)
46
47
  serve_file.close
47
48
  end
49
+ else
50
+ result
48
51
  end
49
52
 
50
53
  end
@@ -52,8 +55,15 @@ module RTeX
52
55
 
53
56
  module HelperMethods
54
57
  # Similar to h()
55
- def latex_escape(s)
56
- RTeX::Document.escape(s)
58
+ def latex_escape(*args)
59
+ # Since Rails' I18n implementation aliases l() to localize(), LaTeX
60
+ # escaping should only be done if RTeX is doing the rendering.
61
+ # Otherwise, control should be be passed to localize().
62
+ if Thread.current[:_rendering_rtex]
63
+ RTeX::Document.escape(*args)
64
+ else
65
+ localize(*args)
66
+ end
57
67
  end
58
68
  alias :l :latex_escape
59
69
  end
@@ -65,7 +65,7 @@ module RTeX
65
65
 
66
66
  MAJOR = 2
67
67
  MINOR = 1
68
- TINY = 0
68
+ TINY = 1
69
69
 
70
70
  # The current version as a Version instance
71
71
  CURRENT = new(MAJOR, MINOR, TINY)
@@ -2,29 +2,28 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rtex}
5
- s.version = "2.1.0"
5
+ s.version = "2.1.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Bruce Williams, Wiebe Cazemier"]
9
- s.date = %q{2009-02-26}
9
+ s.date = %q{2009-10-22}
10
10
  s.default_executable = %q{rtex}
11
11
  s.description = %q{LaTeX preprocessor for PDF generation; Rails plugin}
12
12
  s.email = %q{bruce@codefluency.com}
13
13
  s.executables = ["rtex"]
14
14
  s.extra_rdoc_files = ["bin/rtex", "CHANGELOG", "lib/rtex/document.rb", "lib/rtex/escaping.rb", "lib/rtex/framework/merb.rb", "lib/rtex/framework/rails.rb", "lib/rtex/tempdir.rb", "lib/rtex/version.rb", "lib/rtex.rb", "README.rdoc", "README_RAILS.rdoc"]
15
15
  s.files = ["bin/rtex", "CHANGELOG", "init.rb", "lib/rtex/document.rb", "lib/rtex/escaping.rb", "lib/rtex/framework/merb.rb", "lib/rtex/framework/rails.rb", "lib/rtex/tempdir.rb", "lib/rtex/version.rb", "lib/rtex.rb", "Manifest", "rails/init.rb", "Rakefile", "README.rdoc", "README_RAILS.rdoc", "test/document_test.rb", "test/filter_test.rb", "test/fixtures/first.tex", "test/fixtures/first.tex.erb", "test/fixtures/fragment.tex.erb", "test/fixtures/text.textile", "test/tempdir_test.rb", "test/test_helper.rb", "vendor/instiki/LICENSE", "vendor/instiki/redcloth_for_tex.rb", "rtex.gemspec"]
16
- s.has_rdoc = true
17
16
  s.homepage = %q{http://rtex.rubyforge.org}
18
17
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Rtex", "--main", "README.rdoc"]
19
18
  s.require_paths = ["lib"]
20
19
  s.rubyforge_project = %q{rtex}
21
- s.rubygems_version = %q{1.3.1}
20
+ s.rubygems_version = %q{1.3.5}
22
21
  s.summary = %q{LaTeX preprocessor for PDF generation; Rails plugin}
23
22
  s.test_files = ["test/document_test.rb", "test/filter_test.rb", "test/tempdir_test.rb", "test/test_helper.rb"]
24
23
 
25
24
  if s.respond_to? :specification_version then
26
25
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
27
- s.specification_version = 2
26
+ s.specification_version = 3
28
27
 
29
28
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
30
29
  s.add_development_dependency(%q<Shoulda>, [">= 0"])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rtex
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruce Williams, Wiebe Cazemier
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-26 00:00:00 -06:00
12
+ date: 2009-10-22 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -79,6 +79,8 @@ files:
79
79
  - rtex.gemspec
80
80
  has_rdoc: true
81
81
  homepage: http://rtex.rubyforge.org
82
+ licenses: []
83
+
82
84
  post_install_message:
83
85
  rdoc_options:
84
86
  - --line-numbers
@@ -104,9 +106,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
106
  requirements: []
105
107
 
106
108
  rubyforge_project: rtex
107
- rubygems_version: 1.3.1
109
+ rubygems_version: 1.3.5
108
110
  signing_key:
109
- specification_version: 2
111
+ specification_version: 3
110
112
  summary: LaTeX preprocessor for PDF generation; Rails plugin
111
113
  test_files:
112
114
  - test/document_test.rb