Skip to content

Commit

Permalink
Merge pull request rubygems#1217 from evanphx/1-0-stable
Browse files Browse the repository at this point in the history
Quite deprecations and fix a bad test
  • Loading branch information
Andre Arko committed Jun 2, 2011
2 parents daff916 + b5851ec commit 68d9cfe
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
25 changes: 23 additions & 2 deletions lib/bundler/rubygems_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,16 @@ def replace_gem(specs)
end
end

if defined? ::Deprecate
Deprecate = ::Deprecate
elsif defined? Gem::Deprecate
Deprecate = Gem::Deprecate
else
class Deprecate
def skip_during; yield; end
end
end

def stub_source_index137(specs)
# Rubygems versions lower than 1.7 use SourceIndex#from_gems_in
source_index_class = (class << Gem::SourceIndex ; self ; end)
Expand All @@ -172,8 +182,19 @@ def stub_source_index137(specs)
def stub_source_index170(specs)
Gem::SourceIndex.send(:define_method, :initialize) do |*args|
@gems = {}
self.spec_dirs = *args
add_specs(*specs)
# You're looking at this thinking: Oh! This is how I make those
# rubygems deprecations go away!
#
# You'd be correct BUT using of this method in production code
# must be approved by the rubygems team itself!
#
# This is your warning. If you use this and don't have approval
# we can't protect you.
#
Deprecate.skip_during do
self.spec_dirs = *args
add_specs(*specs)
end
end
end

Expand Down
1 change: 0 additions & 1 deletion spec/install/git_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@
out.should include("Git error:")
err.should include("fatal")
err.should include("omgomg")
err.should include("fatal: The remote end hung up unexpectedly")
end

it "works when the gem path has spaces in it" do
Expand Down

0 comments on commit 68d9cfe

Please sign in to comment.