From 70fc27b7facb8c73580428450989b66425c08177 Mon Sep 17 00:00:00 2001 From: drbrain Date: Fri, 8 Feb 2013 04:12:56 +0000 Subject: * lib/rdoc/generator/darkfish.rb: Set encoding on output template to user-specified encoding. * test/rdoc/test_rdoc_generator_darkfish.rb: Test for above. * lib/rdoc.rb: Bump version git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/generator/darkfish.rb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'lib/rdoc/generator') diff --git a/lib/rdoc/generator/darkfish.rb b/lib/rdoc/generator/darkfish.rb index ba62646e77..26f545b14b 100644 --- a/lib/rdoc/generator/darkfish.rb +++ b/lib/rdoc/generator/darkfish.rb @@ -698,18 +698,18 @@ class RDoc::Generator::Darkfish return template if template - template = if page then - assemble_template file - else - file.read - end - - erbout = if page then - 'io' - else - file_var = File.basename(file).sub(/\..*/, '') - "_erbout_#{file_var}" - end + if page then + template = assemble_template file + erbout = 'io' + else + template = file.read + template = template.encode @options.encoding if + Object.const_defined? :Encoding + + file_var = File.basename(file).sub(/\..*/, '') + + erbout = "_erbout_#{file_var}" + end template = klass.new template, nil, '<>', erbout @template_cache[file] = template -- cgit v1.2.3