Skip to content
Browse files

Merge pull request #1834 from soulcutter/invalid-gemspec

Workaround for invalid gemspec issue #1715
  • Loading branch information...
2 parents be8d3d0 + 6762862 commit 8ef7b59427321cec7409408d02b7ea4fd0beb9a4 André Arko committed
Showing with 27 additions and 9 deletions.
  1. +4 −0 lib/bundler/cli.rb
  2. +2 −1 lib/bundler/fetcher.rb
  3. +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
3 lib/bundler/fetcher.rb
@@ -175,7 +175,8 @@ def fetch_dependency_remote_specs(gem_names)
raise GemspecError, %{Unfortunately, the gem #{s[:name]} (#{s[:number]}) } +
%{has an invalid gemspec. As a result, Bundler cannot install this Gemfile. } +
%{Please ask the gem author to yank the bad version to fix this issue. For } +
- %{more information, see http://bit.ly/syck-defaultkey.}
+ %{more information, see http://bit.ly/syck-defaultkey. For a temporary } +
+ %{workaround try using the --full-index option.}
else
raise e
end
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

0 comments on commit 8ef7b59

Please sign in to comment.
Something went wrong with that request. Please try again.