Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Deprecation Warning about Gem.source_index.all_gems #1151

Closed
mikehoward opened this issue May 6, 2011 · 1 comment
Closed

Deprecation Warning about Gem.source_index.all_gems #1151

mikehoward opened this issue May 6, 2011 · 1 comment

Comments

@mikehoward
Copy link

bundler 1.0.13 & rubygems 1.7.2 issues annoying Deprecation warning when calling 'all_specs' .

rubygems 1.7.2 does not respond_to? :all=, so traps to RubygemsIntegration::Transitional - which calls Gem.source_index.all_gems.values.

This patch fixes it:

diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index 57ef1b9..e63e4ef 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -265,6 +265,10 @@ module Bundler
       def stub_rubygems(specs)
         stub_source_index170(specs)
       end
+
+      def all_specs
+        Gem.source_index.to_a.map { |x| x[1] }
+      end
     end

   end

two tests fail, but I don't think they are significant:

  1. bundle install with git sources catches git errors and spits out useful output
    Failure/Error: err.should include("fatal: The remote end hung up unexpectedly")
    expected "fatal: repository 'omgomg' does not exist" to include "fatal: The remote end hung up unexpectedly"

  2. bundle help simply outputs the txt file when there is no groff on the path
    Failure/Error: out.should =~ /BUNDLE-INSTALL/
    expected: /BUNDLE-INSTALL/
    got: "" (using =~)
    Diff:
    @@ -1,2 +1 @@
    -/BUNDLE-INSTALL/

@indirect
Copy link
Member

Fixed by 9ad9d00.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants