lib/yard/server/commands/display_object_command.rb in yard-0.8.7.6 vs lib/yard/server/commands/display_object_command.rb in yard-0.9.0
- old
+ new
@@ -6,12 +6,16 @@
include DocServerHelper
def run
if path.empty?
if options.readme
- url = url_for_file(options.readme)
- self.status, self.headers, self.body = *router.send(:route, url)
- cache(body.first)
+ filename = options.readme.filename
+ opts = adapter.options.merge(
+ :index => true, :library => library,
+ :path => filename.sub(%r{^#{library.source_path.to_s}/}, ''))
+ self.status, self.headers, self.body =
+ *DisplayFileCommand.new(opts).call(request)
+ cache(self.body)
return
else
self.path = 'index'
end
end