 
 This page contains automated test results for code from O'Reilly's Ruby Cookbook. If this code looks interesting or useful, you might want to buy the whole book.
| Reading Documentation for Installed Gems | ||
|---|---|---|
| Code | Expected | Actual | 
| require 'rubygems'
Gem.manage_gems
def show_gem_rdoc
  puts "Your generated docs are all probably in #{File.join(Gem.dir, "doc")}"
  puts "Just to be safe, I'll print out every gem's RDoc location:"
  specifications_dir = File.join(Gem.dir, 'specifications')
  lacking_rdoc = []
  Gem::SourceIndex.from_installed_gems(specifications_dir).each do |path, spec|
    manager = Gem::DocManager.new(spec)
    if manager.rdoc_installed?
      doc_path = File.join(spec.installation_path, 'doc', spec.full_name)
      puts " #{spec.full_name} => #{doc_path}"
    else
      lacking_rdoc << spec.full_name
    end
  end
  unless lacking_rdoc.empty?
    puts "\nThese installed gems have no RDoc installed:"
    puts " #{lacking_rdoc.join("\n ")}"  
  end
end
show_gem_rdoc | Your generated RDoc is probably all in /usr/lib/ruby/gems/1.8/doc Just to be safe, I'll print out every gem's RDoc location: flexmock-0.1.7 => /usr/lib/ruby/gems/1.8/doc/flexmock-0.1.7 simple-rss-1.1 => /usr/lib/ruby/gems/1.8/doc/simple-rss-1.1 classifier-1.3.0 => /usr/lib/ruby/gems/1.8/doc/classifier-1.3.0 actionmailer-1.1.5 => /usr/lib/ruby/gems/1.8/doc/actionmailer-1.1.5 ... These installed gems have no RDoc installed: Ruby-MemCache-0.0.1 RedCloth-3.0.4 sources-0.0.1 ... | Your generated docs are all probably in /usr/lib/ruby/gems/1.8/doc Just to be safe, I'll print out every gem's RDoc location: flexmock-0.1.7 => /usr/lib/ruby/gems/1.8/doc/flexmock-0.1.7 simple-rss-1.1 => /usr/lib/ruby/gems/1.8/doc/simple-rss-1.1 classifier-1.3.0 => /usr/lib/ruby/gems/1.8/doc/classifier-1.3.0 actionmailer-1.1.5 => /usr/lib/ruby/gems/1.8/doc/actionmailer-1.1.5 activesupport-1.3.0 => /usr/lib/ruby/gems/1.8/doc/activesupport-1.3.0 midilib-0.8.5 => /usr/lib/ruby/gems/1.8/doc/midilib-0.8.5 diff-lcs-1.1.2 => /usr/lib/ruby/gems/1.8/doc/diff-lcs-1.1.2 rubyful_soup-1.0.4 => /usr/lib/ruby/gems/1.8/doc/rubyful_soup-1.0.4 units-1.0.1 => /usr/lib/ruby/gems/1.8/doc/units-1.0.1 acts_as_taggable-1.0.4 => /usr/lib/ruby/gems/1.8/doc/acts_as_taggable-1.0.4 actionpack-1.11.2 => /usr/lib/ruby/gems/1.8/doc/actionpack-1.11.2 needle-1.3.0 => /usr/lib/ruby/gems/1.8/doc/needle-1.3.0 payment-1.0.1 => /usr/lib/ruby/gems/1.8/doc/payment-1.0.1 pdf-writer-1.1.3 => /usr/lib/ruby/gems/1.8/doc/pdf-writer-1.1.3 ruby-breakpoint-0.5.0 => /usr/lib/ruby/gems/1.8/doc/ruby-breakpoint-0.5.0 facets-1.1.0 => /usr/lib/ruby/gems/1.8/doc/facets-1.1.0 transaction-simple-1.3.0 => /usr/lib/ruby/gems/1.8/doc/transaction-simple-1.3.0 rake-0.7.0 => /usr/lib/ruby/gems/1.8/doc/rake-0.7.0 og-0.29.0 => /usr/lib/ruby/gems/1.8/doc/og-0.29.0 activerecord-1.14.0 => /usr/lib/ruby/gems/1.8/doc/activerecord-1.14.0 sparklines-0.2.6 => /usr/lib/ruby/gems/1.8/doc/sparklines-0.2.6 color-tools-1.3.0 => /usr/lib/ruby/gems/1.8/doc/color-tools-1.3.0 activesupport-1.2.5 => /usr/lib/ruby/gems/1.8/doc/activesupport-1.2.5 cmdparse-2.0.0 => /usr/lib/ruby/gems/1.8/doc/cmdparse-2.0.0 shipping-1.3.0 => /usr/lib/ruby/gems/1.8/doc/shipping-1.3.0 htmltools-1.09 => /usr/lib/ruby/gems/1.8/doc/htmltools-1.09 mime-types-1.15 => /usr/lib/ruby/gems/1.8/doc/mime-types-1.15 fastercsv-0.1.9 => /usr/lib/ruby/gems/1.8/doc/fastercsv-0.1.9 activerecord-1.13.2 => /usr/lib/ruby/gems/1.8/doc/activerecord-1.13.2 net-ssh-1.0.8 => /usr/lib/ruby/gems/1.8/doc/net-ssh-1.0.8 ferret-0.9.0 => /usr/lib/ruby/gems/1.8/doc/ferret-0.9.0 ezcrypto-0.3 => /usr/lib/ruby/gems/1.8/doc/ezcrypto-0.3 gruff-0.1.1 => /usr/lib/ruby/gems/1.8/doc/gruff-0.1.1 BlueCloth-1.0.0 => /usr/lib/ruby/gems/1.8/doc/BlueCloth-1.0.0 builder-2.0.0 => /usr/lib/ruby/gems/1.8/doc/builder-2.0.0 creditcard-1.0 => /usr/lib/ruby/gems/1.8/doc/creditcard-1.0 spreadsheet-excel-0.3.4 => /usr/lib/ruby/gems/1.8/doc/spreadsheet-excel-0.3.4 glue-0.29.0 => /usr/lib/ruby/gems/1.8/doc/glue-0.29.0 actionwebservice-1.0.0 => /usr/lib/ruby/gems/1.8/doc/actionwebservice-1.0.0 io-reactor-0.05 => /usr/lib/ruby/gems/1.8/doc/io-reactor-0.05 These installed gems have no RDoc installed: Ruby-MemCache-0.0.1 RedCloth-3.0.4 RubyInline-3.4.0 rails-1.0.0 sources-0.0.1 og-0.28.0 facets_core-1.0.2 SimpleSearch-0.5.0 xml-simple-1.0.8 facets-1.0.2 facets_more-1.0.2 facets-1.0.3 GeoRuby-0.0.1 postgres-0.7.1 rubyzip-0.5.12 stemmer-1.0.1 glue-0.28.0 libxml-ruby-0.3.6 rmagick-1.10.1 |