* 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:
parent
d2be12ef61
commit
70fc27b7fa
@ -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>
|
Fri Feb 8 11:53:33 2013 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
* lib/rubygems/security/policy.rb: Raise proper exceptions when
|
* lib/rubygems/security/policy.rb: Raise proper exceptions when
|
||||||
|
@ -64,7 +64,7 @@ module RDoc
|
|||||||
##
|
##
|
||||||
# RDoc version you are using
|
# RDoc version you are using
|
||||||
|
|
||||||
VERSION = '4.0.0.rc.2'
|
VERSION = '4.0.0.rc.2.1'
|
||||||
|
|
||||||
##
|
##
|
||||||
# Method visibilities
|
# Method visibilities
|
||||||
|
@ -698,18 +698,18 @@ class RDoc::Generator::Darkfish
|
|||||||
|
|
||||||
return template if template
|
return template if template
|
||||||
|
|
||||||
template = if page then
|
if page then
|
||||||
assemble_template file
|
template = assemble_template file
|
||||||
else
|
erbout = 'io'
|
||||||
file.read
|
else
|
||||||
end
|
template = file.read
|
||||||
|
template = template.encode @options.encoding if
|
||||||
|
Object.const_defined? :Encoding
|
||||||
|
|
||||||
erbout = if page then
|
file_var = File.basename(file).sub(/\..*/, '')
|
||||||
'io'
|
|
||||||
else
|
erbout = "_erbout_#{file_var}"
|
||||||
file_var = File.basename(file).sub(/\..*/, '')
|
end
|
||||||
"_erbout_#{file_var}"
|
|
||||||
end
|
|
||||||
|
|
||||||
template = klass.new template, nil, '<>', erbout
|
template = klass.new template, nil, '<>', erbout
|
||||||
@template_cache[file] = template
|
@template_cache[file] = template
|
||||||
|
@ -173,5 +173,15 @@ class TestRDocGeneratorDarkfish < RDoc::TestCase
|
|||||||
assert_same template, @g.send(:template_for, classpage)
|
assert_same template, @g.send(:template_for, classpage)
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user