class Gem::Commands::DependencyCommand

def fetch_specs(name_pattern, requirement, prerelease) # :nodoc:

:nodoc:
def fetch_specs(name_pattern, requirement, prerelease) # :nodoc:
  specs = []
  if local?
    specs.concat Gem::Specification.stubs.find_all {|spec|
      name_matches = name_pattern ? name_pattern =~ spec.name : true
      version_matches = requirement.satisfied_by?(spec.version)
      name_matches && version_matches
    }.map(&:to_spec)
  end
  specs.concat fetch_remote_specs name_pattern, requirement, prerelease if remote?
  ensure_specs specs
  specs.uniq.sort
end