aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-12-08 15:11:23 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-12-08 15:14:07 -0800
commit2c471b3ac805b00ac1423f7ae2be1554aca0db9f (patch)
treeb196fa74246965b518cdfc3296c9d77352b712f3 /actionpack/lib/action_view/template.rb
parent8c26cd5d97be771c4c7e1cc8b1eaaf60d4dde692 (diff)
downloadrails-2c471b3ac805b00ac1423f7ae2be1554aca0db9f.tar.gz
rails-2c471b3ac805b00ac1423f7ae2be1554aca0db9f.tar.bz2
rails-2c471b3ac805b00ac1423f7ae2be1554aca0db9f.zip
load the encoding converter to work around [ruby-core:41556] when switching encodings
Diffstat (limited to 'actionpack/lib/action_view/template.rb')
-rw-r--r--actionpack/lib/action_view/template.rb27
1 files changed, 0 insertions, 27 deletions
diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb
index 8d69880308..10797c010f 100644
--- a/actionpack/lib/action_view/template.rb
+++ b/actionpack/lib/action_view/template.rb
@@ -3,33 +3,6 @@ require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/object/try'
require 'active_support/core_ext/kernel/singleton_class'
-if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ruby' && RUBY_VERSION == '1.9.3' && RUBY_PATCHLEVEL == 0
- # This is a hack to work around a bug in Ruby 1.9.3p0:
- # http://redmine.ruby-lang.org/issues/5564
- #
- # Basically, at runtime we may need to perform some encoding conversions on the templates,
- # but if the converter hasn't been loaded by Ruby beforehand (i.e. now), then it won't be
- # able to find it (due to a bug).
- #
- # However, we don't know what conversions we may need to do a runtime. So we load up a
- # text file which contains a pre-generated list of all the possible conversions,
- # and we load all of them.
- #
- # In my testing this increased the process size by about 3.9 MB (after the conversions array
- # is GC'd) and took around 170ms to run, which seems acceptable for a workaround.
- #
- # The script to dump the conversions is: https://gist.github.com/1371499
-
- filename = File.join(File.dirname(__FILE__), 'data', 'encoding_conversions.txt')
- conversions = File.read(filename)
- conversions.split("\n").map do |line|
- from, to_array = line.split(':')
- to_array.split(',').each do |to|
- Encoding::Converter.new(from, to)
- end
- end
-end
-
module ActionView
# = Action View Template
class Template