Permalink
Browse files

Fix warnings in bundler

  • Loading branch information...
1 parent 202e10c commit 1837d6723e9a90b81546a42bfb86b4afa4f62d89 @wycats wycats committed Oct 13, 2010
Showing with 4 additions and 6 deletions.
  1. +1 −1 lib/bundler.rb
  2. +3 −5 lib/bundler/shared_helpers.rb
View
@@ -212,7 +212,7 @@ def sudo(str)
end
def read_file(file)
- File.open(file, "rb") { |file| file.read }
+ File.open(file, "rb") { |f| f.read }
end
def load_gemspec(file)
@@ -76,11 +76,6 @@ def cripple_rubygems(specs)
executables = specs.map { |s| s.executables }.flatten
Gem.source_index # ensure RubyGems is fully loaded
- ::Kernel.class_eval do
- private
- def gem(*) ; end
- end
-
::Kernel.send(:define_method, :gem) do |dep, *reqs|
if executables.include? File.basename(caller.first.split(':').first)
return
@@ -113,6 +108,7 @@ def gem(*) ; end
# Yeah, talk about a hack
source_index_class = (class << Gem::SourceIndex ; self ; end)
+ source_index_class.send(:remove_method, :from_gems_in)
source_index_class.send(:define_method, :from_gems_in) do |*args|
source_index = Gem::SourceIndex.new
source_index.spec_dirs = *args
@@ -122,7 +118,9 @@ def gem(*) ; end
# OMG more hacks
gem_class = (class << Gem ; self ; end)
+ gem_class.send(:remove_method, :refresh)
gem_class.send(:define_method, :refresh) { }
+ gem_class.send(:remove_method, :bin_path)
gem_class.send(:define_method, :bin_path) do |name, *args|
exec_name, *reqs = args

0 comments on commit 1837d67

Please sign in to comment.