Skip to content

Commit

Permalink
Fixed Rdoc display - had to do with content type
Browse files Browse the repository at this point in the history
  • Loading branch information
quirkey committed Apr 2, 2009
1 parent 1f207f6 commit 8f32475
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/gembox/app.rb
Expand Up @@ -27,10 +27,11 @@ class App < ::Sinatra::Default
get %r{/gems/doc/([\w\-\_]+)/?([\d\.]+)?/?(.*)?} do
if params[:captures].length == 3 && !params[:captures][2].blank?
# we have a path
@path = params[:captures].pop
load_gem_by_version
@rdoc_path = File.join(@gem.installation_path, "doc", @gem.full_name, 'rdoc')
File.read(File.join(@rdoc_path, @path))
full_path = File.join(@rdoc_path, params[:captures].pop)
content_type File.extname(full_path)
File.read(full_path)
else
load_gem_by_version
@rdoc_path = File.join(@gem.installation_path, "doc", @gem.full_name, 'rdoc')
Expand All @@ -48,7 +49,7 @@ class App < ::Sinatra::Default
if action == 'edit'
`$EDITOR #{file_path}`
else
response.headers['Content-type'] = 'text/plain'
content_type 'text/plain'
return File.read(file_path)
end
end
Expand Down

0 comments on commit 8f32475

Please sign in to comment.