Rubygems update from 1.3.1 to 1.3.5

That went smooth. No problems. Typical gem update —system
Thanks Seattlerb dudes.

Clean up gems on my system.

I wonder if there is a gem command to just keep the latest version of a particular gem and uninstall the previous gems.
Yes, there is gem cleanup but careful, some gems rely on older versions of other gems. For example my mislav-hanna 0.1.7 will not work iwth Rdoc 2.4.3 , it complains that it needs Rdoc 2.3.0 so unless I have really old gems I probably should not just clean up for the sake of keeping only the newest gems.

I just found out that it’s best to go and clean up gems that I know for sure are no longer needed.

Rdoc refresh

the Rdoc2 now comes with the default template darkfish but I prefer to use Hanna (I am use to light backgrounds). So for example if I want to regenerate rdoc for a gem I usually do gem rdoc gemname but that generates ri and rdoc for each one of the versions of a gem but I really want only the latest version.

If I just run hanna --gems gemname it generates the latest version of gem only which is what I want. A quick look at /bin/hanna I can see that it only takes the last version of a gem

 

    specs = gem_names.inject([]) do |arr, name|
      found = Gem::SourceIndex.from_installed_gems.find_name(name)
      spec = found.sort_by {|s| s.version }.last
      arr << spec if spec
      arr
    end
    

Now I can need to only add the “—main README.rdoc” (or Readme.rb, or README) as the main first file to load.
Ultimately rdoc is really flexible, pretty much anything can be option can be set or overwritten on cli or in Rake task.

blog comments powered by Disqus
rss icon