Class Gem::UnpackCommand
In: lib/rubygems/gem_commands.rb
Parent: Command

Methods

arguments   defaults_str   execute   get_path   new   usage  

Included Modules

VersionOption CommandAids

Public Class methods

Public Instance methods

TODO: allow, e.g., ‘gem unpack rake-0.3.1’. Find a general solution for this, so that it works for uninstall as well. (And check other commands at the same time.)

Return the full path to the cached gem file matching the given name and version requirement. Returns ‘nil’ if no match. Example:

 get_path('rake', '> 0.4')   # -> '/usr/lib/ruby/gems/1.8/cache/rake-0.4.2.gem'
 get_path('rake', '< 0.1')   # -> nil
 get_path('rak')             # -> nil (exact name required)

TODO: This should be refactored so that it‘s a general service. I don‘t think any of our existing classes are the right place though. Just maybe ‘Cache’?

TODO: It just uses Gem.dir for now. What‘s an easy way to get the list of source directories?

[Validate]