1. Gem::
  2. Commands::
  3. StaleCommand

class Gem::Commands::StaleCommand

Public Class Methods

Source
# File lib/rubygems/commands/stale_command.rb, line 6definitializesuper("stale","List gems along with access times")end
Calls superclass methodGem::Command::new

Public Instance Methods

Source
# File lib/rubygems/commands/stale_command.rb, line 24defexecutegem_to_atime = {}Gem::Specification.eachdo|spec|name =spec.full_nameDir["#{spec.full_gem_path}/**/*.*"].eachdo|file|nextifFile.directory?(file)stat =File.stat(file)gem_to_atime[name]||=stat.atimegem_to_atime[name] =stat.atimeifgem_to_atime[name]<stat.atimeendendgem_to_atime.sort_by {|_,atime|atime }.eachdo|name,atime|say"#{name} at #{atime.strftime "%c"}"endend