Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added --full-index option to bundle update re #1715

  • Loading branch information...
commit fc44880d27ac92cf9815d9ed7a80c003bcd0e812 1 parent b3e9c1a
Bradley Schaefer authored
Showing with 25 additions and 8 deletions.
  1. +4 −0 lib/bundler/cli.rb
  2. +21 −8 spec/install/gems/dependency_api_spec.rb
View
4 lib/bundler/cli.rb
@@ -258,6 +258,8 @@ def install
"Do not attempt to fetch gems remotely and use the gem cache instead"
method_option "quiet", :type => :boolean, :banner =>
"Only output warnings and errors."
+ method_option "full-index", :type => :boolean, :banner =>
+ "Use the rubygems modern index instead of the API endpoint"
def update(*gems)
sources = Array(options[:source])
Bundler.ui.be_quiet! if options[:quiet]
@@ -269,6 +271,8 @@ def update(*gems)
Bundler.definition(:gems => gems, :sources => sources)
end
+ Bundler::Fetcher.disable_endpoint = options["full-index"]
+
opts = {"update" => true, "local" => options[:local]}
# rubygems plugins sometimes hook into the gem install process
Gem.load_env_plugins if Gem.respond_to?(:load_env_plugins)
View
29 spec/install/gems/dependency_api_spec.rb
@@ -158,15 +158,28 @@
out.should match(/Too many redirects/)
end
- it "should use the modern index when the --full-index" do
- gemfile <<-G
- source "#{source_uri}"
- gem "rack"
- G
+ context "when --full-index is specified" do
+ it "should use the modern index for install" do
+ gemfile <<-G
+ source "#{source_uri}"
+ gem "rack"
+ G
- bundle "install --full-index", :artifice => "endpoint"
- out.should include("Fetching source index from #{source_uri}")
- should_be_installed "rack 1.0.0"
+ bundle "install --full-index", :artifice => "endpoint"
+ out.should include("Fetching source index from #{source_uri}")
+ should_be_installed "rack 1.0.0"
+ end
+
+ it "should use the modern index for update" do
+ gemfile <<-G
+ source "#{source_uri}"
+ gem "rack"
+ G
+
+ bundle "update --full-index", :artifice => "endpoint"
+ out.should include("Fetching source index from #{source_uri}")
+ should_be_installed "rack 1.0.0"
+ end
end
it "fetches again when more dependencies are found in subsequent sources" do
Please sign in to comment.
Something went wrong with that request. Please try again.