1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
drbrain 2013-02-08 04:12:56 +00:00
parent d2be12ef61
commit 70fc27b7fa
4 changed files with 30 additions and 12 deletions

View file

@ -1,3 +1,11 @@
Fri Feb 8 13:12:04 2013 Eric Hodel <drbrain@segment7.net>
* 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
Fri Feb 8 11:53:33 2013 Eric Hodel <drbrain@segment7.net>
* lib/rubygems/security/policy.rb: Raise proper exceptions when

View file

@ -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

View file

@ -698,18 +698,18 @@ class RDoc::Generator::Darkfish
return template if template
template = if page then
assemble_template file
else
file.read
end
if page then
template = assemble_template file
erbout = 'io'
else
template = file.read
template = template.encode @options.encoding if
Object.const_defined? :Encoding
erbout = if page then
'io'
else
file_var = File.basename(file).sub(/\..*/, '')
"_erbout_#{file_var}"
end
file_var = File.basename(file).sub(/\..*/, '')
erbout = "_erbout_#{file_var}"
end
template = klass.new template, nil, '<>', erbout
@template_cache[file] = template

View file

@ -173,5 +173,15 @@ class TestRDocGeneratorDarkfish < RDoc::TestCase
assert_same template, @g.send(:template_for, classpage)
end
def test_template_for_partial
partial = Pathname.new @options.template_dir + '_sidebar_classes.rhtml'
template = @g.send(:template_for, partial, false, RDoc::ERBPartial)
assert_kind_of RDoc::ERBPartial, template
assert_same template, @g.send(:template_for, partial)
end
end