<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,11 +4,11 @@ Hanna is an RDoc template that scales. It's implemented in Haml, making the
 sources clean and readable. It's built with simplicity, beauty and ease of
 browsing in mind.
 
-Hanna is available from [GitHub][]:
+Hanna was made by [Mislav][] and is available from [GitHub][]:
 
     gem install mislav-hanna
 
-After that you have two options. You can use the command-line tool:
+After that you have three options. You can use the command-line tool:
 
     hanna -h
 
@@ -35,7 +35,10 @@ an example for [will_paginate][]:
     
 Either way, it's the same as using RDoc.
 
-Hanna was crafted by [Mislav][].
+The last thing you can do with Hanna is generate documentation for installed
+gems. This is a replacement for the &quot;gem rdoc&quot; command.
+
+    [sudo] hanna --gems haml will_paginate
 
 ## A work in progress
 </diff>
      <filename>README.markdown</filename>
    </modified>
    <modified>
      <diff>@@ -2,15 +2,24 @@
 if ARGV.size == 1 and ARGV.first == '-h'
   puts &lt;&lt;-HELP
 Hanna -- a better RDoc template
-Sample usage:
+Synopsis:
+  hanna [options]  [file names...]
+  [sudo] hanna --gems  [gem names...]
+  
+Example usage:
 
   hanna lib/**/*.rb
 
-Hanna passes all arguments to RDoc. To find more about RDoc options,
-see &quot;rdoc -h&quot;. Default options:
+Hanna passes all arguments to RDoc. To find more about RDoc options, see
+&quot;rdoc -h&quot;. Default options are:
 
   -o doc --inline-source --charset=UTF-8
 
+The second form, with the &quot;--gems&quot; argument, serves the same purpose as
+the &quot;gem rdoc&quot; command: it generates documentation for installed gems.
+When no gem names are given, &quot;hanna --gems&quot; will install docs for EACH of
+the gems, which can, uh, take a little while.
+
 HELP
   exit 0
 end
@@ -33,9 +42,40 @@ require 'hanna/rdoc_patch'
 options = []
 
 options &lt;&lt; '-T' &lt;&lt; 'hanna/hanna.rb'
-options &lt;&lt; '-o' &lt;&lt; 'doc' unless ARGV.include?('-o') or ARGV.include?('--op')
 options &lt;&lt; '--inline-source' &lt;&lt; '--charset=UTF-8'
 
-options.concat ARGV
+if ARGV.first == '--gems'
+  require 'rubygems/doc_manager'
+  Gem::DocManager.configured_args = options
+  
+  gem_names = ARGV.dup
+  gem_names.shift
+  
+  unless gem_names.empty?
+    specs = gem_names.inject([]) do |arr, name|
+      found = Gem::SourceIndex.from_installed_gems.search(name)
+      spec = found.sort_by {|s| s.version }.last
+      arr &lt;&lt; spec if spec
+      arr
+    end
+  else
+    specs = Gem::SourceIndex.from_installed_gems.inject({}) do |all, pair|
+      full_name, spec = pair
+      if spec.has_rdoc? and (!all[spec.name] or spec.version &gt; all[spec.name].version)
+        all[spec.name] = spec
+      end
+      all
+    end
+    specs = specs.values
+    puts &quot;Hanna is installing documentation for #{specs.size} gem#{specs.size &gt; 1 ? 's' : ''} ...&quot;
+  end
+
+  specs.each do |spec|
+    Gem::DocManager.new(spec).generate_rdoc
+  end
+else
+  options &lt;&lt; '-o' &lt;&lt; 'doc' unless ARGV.include?('-o') or ARGV.include?('--op')
+  options.concat ARGV
 
-RDoc::RDoc.new.document(options)
+  RDoc::RDoc.new.document(options)
+end</diff>
      <filename>bin/hanna</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 Gem::Specification.new do |s|
   s.name    = 'hanna'
-  s.version = '0.1.1'
-  s.date    = '2008-05-02'
+  s.version = '0.1.2'
+  s.date    = '2008-05-03'
   
   s.summary = &quot;An RDoc template that rocks&quot;
   s.description = &quot;Hanna is an RDoc template that scales. It's implemented in Haml, making its source clean and maintainable. It's built with simplicity, beauty and ease of browsing in mind.&quot;</diff>
      <filename>hanna.gemspec</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5277d9738076f1cda7972f0fc3ee6978eb008ed0</id>
    </parent>
  </parents>
  <author>
    <name>Mislav Marohni&#263;</name>
    <email>mislav.marohnic@gmail.com</email>
  </author>
  <url>http://github.com/mislav/hanna/commit/71091b4d446b1c9910f32f10705da50f66951f76</url>
  <id>71091b4d446b1c9910f32f10705da50f66951f76</id>
  <committed-date>2008-05-03T02:08:12-07:00</committed-date>
  <authored-date>2008-05-03T02:08:12-07:00</authored-date>
  <message>Hanna 0.1.2 can generate docs for gems</message>
  <tree>ea3f0f22057c0a5166aeb5c3426ee7cc114a6c8f</tree>
  <committer>
    <name>Mislav Marohni&#263;</name>
    <email>mislav.marohnic@gmail.com</email>
  </committer>
</commit>
