summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-08 17:20:53 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-08 17:20:53 +0200
commit455c33f3df88b5e975c85e66760dbb233c3642ac (patch)
treed4c40362883a9342a1c74732463c0903b559a39b
parent21deea11d33cfa39b585eb028e2542115d06d881 (diff)
downloadbundler-cleanup_old_rubies_stuff.tar.gz
Remove ruby 1.8 compatibility codecleanup_old_rubies_stuff
The comment about this being for rubygems 1.8 compatibility seems wrong, it was for ruby 1.8 compatibility, as can be seen by these docs: https://ruby-doc.org/core-1.8.7/Module.html#method-i-instance_methods https://ruby-doc.org/core-1.9.3/Module.html#method-i-instance_methods
-rw-r--r--lib/bundler/rubygems_ext.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
index c4464383e6..ccf71c8c00 100644
--- a/lib/bundler/rubygems_ext.rb
+++ b/lib/bundler/rubygems_ext.rb
@@ -21,7 +21,7 @@ module Gem
class Specification
attr_accessor :remote, :location, :relative_loaded_from
- if instance_methods(false).map(&:to_sym).include?(:source)
+ if instance_methods(false).include?(:source)
remove_method :source
attr_writer :source
def source
@@ -81,10 +81,7 @@ module Gem
end
end
- # RubyGems 1.8+ used only.
- methods = instance_methods(false)
- gem_dir = methods.first.is_a?(String) ? "gem_dir" : :gem_dir
- remove_method :gem_dir if methods.include?(gem_dir)
+ remove_method :gem_dir if instance_methods(false).include?(:gem_dir)
def gem_dir
full_gem_path
end