Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Warnings #1403

Merged
merged 3 commits into from

2 participants

@stephencelis

This pull request fixes a few warnings I encounter with the -w flag enabled when I run bundle exec rake.

@indirect
Owner

I'm sorry, but this patch totally doesn't work for me. I'd like to remove the warnings, perhaps you could fix it?


[andre ~/sw/gems/bundler](1-0-stable)$ RUBYOPT='-w' dbundle exec rake
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb:263: warning: `*' interpreted as argument prefix
/Users/andre/sw/gems/bundler/lib/bundler/rubygems_ext.rb:155:in `remove_method': method `hash' not defined in Gem::Platform (NameError)
    from /Users/andre/sw/gems/bundler/lib/bundler/rubygems_ext.rb:155
    from /Users/andre/sw/gems/bundler/lib/bundler.rb:11:in `require'
    from /Users/andre/sw/gems/bundler/lib/bundler.rb:11
    from /Users/andre/sw/gems/bundler/bin/bundle:4:in `require'
    from /Users/andre/sw/gems/bundler/bin/bundle:4
@stephencelis

Hm, that's odd. If the call to method_defined? returns true, then remove_method shouldn't blow up.

What version of Ruby (patch level, if possible, please) and RubyGems are you running?

@indirect
Owner
[andre ~/sw/gems/bundler](1-0-stable⚡)$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
[andre ~/sw/gems/bundler](1-0-stable⚡)$ gem -v
1.3.7
@stephencelis

Alright, fixed the 1.8.7 case and caught one more warning. Specs run cleanly in 1.8 and 1.9.

@indirect indirect merged commit 67cfb2f into bundler:1-0-stable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
2  lib/bundler/rubygems_ext.rb
@@ -40,6 +40,7 @@ def load_paths
end
# RubyGems 1.8+ used only.
+ remove_method :gem_dir if method_defined? :gem_dir
def gem_dir
full_gem_path
end
@@ -151,6 +152,7 @@ class Platform
MSWIN = Gem::Platform.new('mswin32')
MINGW = Gem::Platform.new('x86-mingw32')
+ undef_method :hash if method_defined? :hash
def hash
@cpu.hash ^ @os.hash ^ @version.hash
end
View
3  lib/bundler/rubygems_integration.rb
@@ -180,6 +180,7 @@ def stub_source_index137(specs)
end
def stub_source_index170(specs)
+ Gem::SourceIndex.send(:alias_method, :old_initialize, :initialize)
Gem::SourceIndex.send(:define_method, :initialize) do |*args|
@gems = {}
# You're looking at this thinking: Oh! This is how I make those
@@ -205,7 +206,7 @@ def replace_bin_path(specs)
gem_class = (class << Gem ; self ; end)
gem_class.send(:remove_method, :bin_path)
gem_class.send(:define_method, :bin_path) do |name, *args|
- exec_name, *reqs = args
+ exec_name, = args
if exec_name == 'bundle'
return ENV['BUNDLE_BIN_PATH']
View
1  lib/bundler/source.rb
@@ -490,6 +490,7 @@ def initialize(options)
@revision = options["revision"]
@submodules = options["submodules"]
@update = false
+ @installed = nil
end
def self.from_lock(options)
Something went wrong with that request. Please try again.