<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>public/gem-server-rdoc-style.css</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -4,13 +4,77 @@ require 'yaml'
 require 'zlib'
 require 'erb'
 require 'rubygems'
+require 'rubygems/doc_manager'
 require File.expand_path(File.dirname(__FILE__) + &quot;/rack_compress&quot;)
 require File.expand_path(File.dirname(__FILE__) + &quot;/gems_and_rdocs&quot;)
 
 class RackRubygems &lt; Sinatra::Base
 
   get '/' do
-    @gems = Dir[&quot;#{Gem.dir}/doc/*&quot;].sort
+    specs = []
+    total_file_count = 0
+
+    source_index.each do |path, spec|
+      total_file_count += spec.files.size
+      deps = spec.dependencies.map do |dep|
+        { &quot;name&quot;    =&gt; dep.name,
+          &quot;type&quot;    =&gt; dep.type,
+          &quot;version&quot; =&gt; dep.version_requirements.to_s, }
+      end
+
+      deps = deps.sort_by { |dep| [dep[&quot;name&quot;].downcase, dep[&quot;version&quot;]] }
+      deps.last[&quot;is_last&quot;] = true unless deps.empty?
+
+      # executables
+      executables = spec.executables.sort.collect { |exec| {&quot;executable&quot; =&gt; exec} }
+      executables = nil if executables.empty?
+      executables.last[&quot;is_last&quot;] = true if executables
+
+      specs &lt;&lt; {
+        &quot;authors&quot;             =&gt; spec.authors.sort.join(&quot;, &quot;),
+        &quot;date&quot;                =&gt; spec.date.to_s,
+        &quot;dependencies&quot;        =&gt; deps,
+        &quot;doc_path&quot;            =&gt; &quot;/doc_root/#{spec.full_name}/rdoc/index.html&quot;,
+        &quot;executables&quot;         =&gt; executables,
+        &quot;only_one_executable&quot; =&gt; (executables &amp;&amp; executables.size == 1),
+        &quot;full_name&quot;           =&gt; spec.full_name,
+        &quot;has_deps&quot;            =&gt; !deps.empty?,
+        &quot;homepage&quot;            =&gt; spec.homepage,
+        &quot;name&quot;                =&gt; spec.name,
+        &quot;rdoc_installed&quot;      =&gt; Gem::DocManager.new(spec).rdoc_installed?,
+        &quot;summary&quot;             =&gt; spec.summary,
+        &quot;version&quot;             =&gt; spec.version.to_s,
+      }
+    end
+
+    specs &lt;&lt; {
+      &quot;authors&quot; =&gt; &quot;Chad Fowler, Rich Kilmer, Jim Weirich, Eric Hodel and others&quot;,
+      &quot;dependencies&quot; =&gt; [],
+      &quot;doc_path&quot; =&gt; &quot;/doc_root/rubygems-#{Gem::RubyGemsVersion}/rdoc/index.html&quot;,
+      &quot;executables&quot; =&gt; [{&quot;executable&quot; =&gt; 'gem', &quot;is_last&quot; =&gt; true}],
+      &quot;only_one_executable&quot; =&gt; true,
+      &quot;full_name&quot; =&gt; &quot;rubygems-#{Gem::RubyGemsVersion}&quot;,
+      &quot;has_deps&quot; =&gt; false,
+      &quot;homepage&quot; =&gt; &quot;http://rubygems.org/&quot;,
+      &quot;name&quot; =&gt; 'rubygems',
+      &quot;rdoc_installed&quot; =&gt; true,
+      &quot;summary&quot; =&gt; &quot;RubyGems itself&quot;,
+      &quot;version&quot; =&gt; Gem::RubyGemsVersion,
+    }
+
+    specs = specs.sort_by { |spec| [spec[&quot;name&quot;].downcase, spec[&quot;version&quot;]] }
+    specs.last[&quot;is_last&quot;] = true
+
+    # tag all specs with first_name_entry
+    last_spec = nil
+    specs.each do |spec|
+      is_first = last_spec.nil? || (last_spec[&quot;name&quot;].downcase != spec[&quot;name&quot;].downcase)
+      spec[&quot;first_name_entry&quot;] = is_first
+      last_spec = spec
+    end
+
+    @values = { &quot;gem_count&quot; =&gt; specs.size.to_s, &quot;specs&quot; =&gt; specs,
+               &quot;total_file_count&quot; =&gt; total_file_count.to_s }
     erb :index
   end
 </diff>
      <filename>lib/rack_rubygems.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,9 @@ require File.expand_path(File.dirname(__FILE__) + &quot;/spec_helper.rb&quot;)
 
 describe &quot;The Rack Rubygems Server&quot; do
 
-  it &quot;serves a list of gems up at the root&quot;
+  it &quot;serves a list of gems up at the root&quot; do
+    should_match_webrick_behavior &quot;/&quot;, :root
+  end
 
   describe &quot;serves some static files&quot; do
 </diff>
      <filename>spec/rack_rubygems_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,80 @@
-&lt;ul&gt;
-  &lt;% @gems.each do |file| %&gt;
-  &lt;li&gt;&lt;a href=&quot;/doc_root/&lt;%= file.split('/').last %&gt;/rdoc/index.html&quot;&gt;&lt;%= file.split('/').last %&gt;&lt;/a&gt;&lt;/li&gt;
+
+  &lt;?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot;?&gt;
+  &lt;!DOCTYPE html
+       PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
+       &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
+
+  &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;
+  &lt;head&gt;
+    &lt;title&gt;RubyGems Documentation Index&lt;/title&gt;
+    &lt;link rel=&quot;stylesheet&quot; href=&quot;gem-server-rdoc-style.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;div id=&quot;fileHeader&quot;&gt;
+      &lt;h1&gt;RubyGems Documentation Index&lt;/h1&gt;
+    &lt;/div&gt;
+    &lt;!-- banner header --&gt;
+
+  &lt;div id=&quot;bodyContent&quot;&gt;
+    &lt;div id=&quot;contextContent&quot;&gt;
+      &lt;div id=&quot;description&quot;&gt;
+        &lt;h1&gt;Summary&lt;/h1&gt;
+  &lt;p&gt;There are &lt;%= @values[&quot;gem_count&quot;]%&gt; gems installed:&lt;/p&gt;
+  &lt;p&gt;
+  &lt;%= @values[&quot;specs&quot;].map { |v| &quot;&lt;a href=\&quot;##{v[&quot;name&quot;]}\&quot;&gt;#{v[&quot;name&quot;]}&lt;/a&gt;&quot; }.join ', ' %&gt;.
+  &lt;h1&gt;Gems&lt;/h1&gt;
+
+  &lt;dl&gt;
+  &lt;% @values[&quot;specs&quot;].each do |spec| %&gt;
+  	&lt;dt&gt;
+  	&lt;% if spec[&quot;first_name_entry&quot;] then %&gt;
+  	  &lt;a name=&quot;&lt;%=spec[&quot;name&quot;]%&gt;&quot;&gt;&lt;/a&gt;
+  	&lt;% end %&gt;
+
+  	&lt;b&gt;&lt;%=spec[&quot;name&quot;]%&gt; &lt;%=spec[&quot;version&quot;]%&gt;&lt;/b&gt;
+
+  	&lt;% if spec[&quot;rdoc_installed&quot;] then %&gt;
+  	  &lt;a href=&quot;&lt;%=spec[&quot;doc_path&quot;]%&gt;&quot;&gt;[rdoc]&lt;/a&gt;
+  	&lt;% else %&gt;
+  	  &lt;span title=&quot;rdoc not installed&quot;&gt;[rdoc]&lt;/span&gt;
+  	&lt;% end %&gt;
+
+  	&lt;% if spec[&quot;homepage&quot;] then %&gt;
+  		&lt;a href=&quot;&lt;%=spec[&quot;homepage&quot;]%&gt;&quot; title=&quot;&lt;%=spec[&quot;homepage&quot;]%&gt;&quot;&gt;[www]&lt;/a&gt;
+  	&lt;% else %&gt;
+  		&lt;span title=&quot;no homepage available&quot;&gt;[www]&lt;/span&gt;
+  	&lt;% end %&gt;
+
+  	&lt;% if spec[&quot;has_deps&quot;] then %&gt;
+  	 - depends on
+  		&lt;%= spec[&quot;dependencies&quot;].map { |v| &quot;&lt;a href=\&quot;##{v[&quot;name&quot;]}\&quot;&gt;#{v[&quot;name&quot;]}&lt;/a&gt;&quot; }.join ', ' %&gt;.
+  	&lt;% end %&gt;
+  	&lt;/dt&gt;
+  	&lt;dd&gt;
+  	&lt;%=spec[&quot;summary&quot;]%&gt;
+  	&lt;% if spec[&quot;executables&quot;] then %&gt;
+  	  &lt;br/&gt;
+
+  		&lt;% if spec[&quot;only_one_executable&quot;] then %&gt;
+  		    Executable is
+  		&lt;% else %&gt;
+  		    Executables are
+  		&lt;%end%&gt;
+
+  		&lt;%= spec[&quot;executables&quot;].map { |v| &quot;&lt;span class=\&quot;context-item-name\&quot;&gt;#{v[&quot;executable&quot;]}&lt;/span&gt;&quot;}.join ', ' %&gt;.
+
+  	&lt;%end%&gt;
+  	&lt;br/&gt;
+  	&lt;br/&gt;
+  	&lt;/dd&gt;
   &lt;% end %&gt;
-&lt;/ul&gt;
\ No newline at end of file
+  &lt;/dl&gt;
+
+      &lt;/div&gt;
+     &lt;/div&gt;
+    &lt;/div&gt;
+  &lt;div id=&quot;validator-badges&quot;&gt;
+    &lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://validator.w3.org/check/referer&quot;&gt;[Validate]&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;
+  &lt;/div&gt;
+  &lt;/body&gt;
+  &lt;/html&gt;
\ No newline at end of file</diff>
      <filename>views/index.erb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a357680bb93c2fcb903bdbc4fbd6b7a92e449485</id>
    </parent>
  </parents>
  <author>
    <name>Jesse Newland</name>
    <email>jnewland@gmail.com</email>
  </author>
  <url>http://github.com/jnewland/sinatra-rubygems/commit/6cdd350f51421250b555bc33ad208421cce17000</url>
  <id>6cdd350f51421250b555bc33ad208421cce17000</id>
  <committed-date>2009-02-21T16:23:55-08:00</committed-date>
  <authored-date>2009-02-21T16:23:55-08:00</authored-date>
  <message>copy over the root method &amp; template</message>
  <tree>f5c97f2de397df7973dadffc4ce899e28c48bfe3</tree>
  <committer>
    <name>Jesse Newland</name>
    <email>jnewland@gmail.com</email>
  </committer>
</commit>
