From 455c33f3df88b5e975c85e66760dbb233c3642ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Mon, 8 Apr 2019 17:20:53 +0200 Subject: Remove ruby 1.8 compatibility code 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 --- lib/bundler/rubygems_ext.rb | 7 ++----- 1 file 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 -- cgit v1.2.1