class Bundler::Index

def local_search(query, base = nil)

def local_search(query, base = nil)
  case query
  when Gem::Specification, RemoteSpecification, LazySpecification, EndpointSpecification then search_by_spec(query)
  when String then specs_by_name(query)
  when Gem::Dependency then search_by_dependency(query, base)
  else
    raise "You can't search for a #{query.inspect}."
  end
end