In Files

  • rubygems/commands/dependency_command.rb

Class/Module Index [+]

Quicksearch

Gem::Commands::DependencyCommand

Public Class Methods

new() click to toggle source
 
               # File rubygems/commands/dependency_command.rb, line 10
def initialize
  super 'dependency',
        'Show the dependencies of an installed gem',
        :version => Gem::Requirement.default, :domain => :local

  add_version_option
  add_platform_option
  add_prerelease_option

  add_option('-R', '--[no-]reverse-dependencies',
             'Include reverse dependencies in the output') do
    |value, options|
    options[:reverse_dependencies] = value
  end

  add_option('-p', '--pipe',
             "Pipe Format (name --version ver)") do |value, options|
    options[:pipe_format] = value
  end

  add_local_remote_options
end
            

Public Instance Methods

execute() click to toggle source
 
               # File rubygems/commands/dependency_command.rb, line 121
def execute
  ensure_local_only_reverse_dependencies

  dependency =
    gem_dependency options[:args], options[:version], options[:prerelease]

  specs = fetch_specs dependency

  reverse = reverse_dependencies specs

  if options[:pipe_format] then
    display_pipe specs
  else
    display_readable specs, reverse
  end
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus