Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

proper content type, and only show gems with rdoc installed

  • Loading branch information...
commit 3a09f5713207cbc8334a805ab0386443e349c2aa 1 parent e0ac298
@jnewland authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/rack_rubygems.rb
View
5 lib/rack_rubygems.rb
@@ -18,12 +18,15 @@ class RackRubygems < Sinatra::Base
end
get '/gemlist.js' do
+ content_type 'text/javascript'
specs, total_file_count = get_specs_and_file_count
body = "document.writeln('<select style=\"float:right;margin: 10px 10px 0 0 \" onchange=\"window.parent.location=this.value\">');"
body << "document.writeln('<option value=\"/\">Gems:</option>');"
specs.each do |spec|
- body << "document.writeln(\"<option value='#{spec['doc_path']}'>#{spec['name']} - #{spec['version']}</option>\");"
+ if spec["rdoc_installed"]
+ body << "document.writeln(\"<option value='#{spec['doc_path']}'>#{spec['name']} - #{spec['version']}</option>\");"
+ end
end
body << "document.writeln('</select>');"
body
Please sign in to comment.
Something went wrong with that request. Please try again.