diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-08 04:12:56 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-08 04:12:56 +0000 |
commit | 70fc27b7facb8c73580428450989b66425c08177 (patch) | |
tree | e5a3a9122d6563023476820630feb732f3f08101 /lib | |
parent | d2be12ef6171f75a074aca8caaeaf834e1f2aac8 (diff) |
* 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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rdoc.rb | 2 | ||||
-rw-r--r-- | lib/rdoc/generator/darkfish.rb | 24 |
2 files changed, 13 insertions, 13 deletions
diff --git a/lib/rdoc.rb b/lib/rdoc.rb index 1b53421927..6508661d63 100644 --- a/lib/rdoc.rb +++ b/lib/rdoc.rb @@ -64,7 +64,7 @@ module RDoc ## # RDoc version you are using - VERSION = '4.0.0.rc.2' + VERSION = '4.0.0.rc.2.1' ## # Method visibilities 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 |