Skip to content
Browse files

really basic index

  • Loading branch information...
1 parent 095d08a commit 9724907f292c4ee97b4c7e82eebf91cb31cd3c21 @jnewland committed Feb 20, 2009
Showing with 10 additions and 0 deletions.
  1. +5 −0 lib/rack_rubygems.rb
  2. +5 −0 views/index.erb
View
5 lib/rack_rubygems.rb
@@ -9,6 +9,11 @@
class RackRubygems < Sinatra::Base
+ get '/' do
+ @gems = Dir["#{Gem.dir}/doc/*"].sort
+ erb :index
+ end
+
head "/Marshal.#{Gem.marshal_version}" do
content_type 'application/octet-stream'
response['Content-Length'] = source_index.length.to_s
View
5 views/index.erb
@@ -0,0 +1,5 @@
+<ul>
+ <% @gems.each do |file| %>
+ <li><a href="/doc_root/<%= file.split('/').last %>/rdoc/index.html"><%= file.split('/').last %></a></li>
+ <% end %>
+</ul>

0 comments on commit 9724907

Please sign in to comment.
Something went wrong with that request. Please try again.