class Bundler::RubygemsIntegration::Legacy

def stub_rubygems(specs)

def stub_rubygems(specs)
  # RubyGems versions lower than 1.7 use SourceIndex#from_gems_in
  source_index_class = (class << Gem::SourceIndex; self; end)
  redefine_method(source_index_class, :from_gems_in) do |*args|
    Gem::SourceIndex.new.tap do |source_index|
      source_index.spec_dirs = *args
      source_index.add_specs(*specs)
    end
  end
end