From f9de70ee931ca4a8500916fa9480f6df6c062626 Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Sun, 10 Jul 2016 11:06:49 -0300 Subject: [RubygemsExt] return Source::Installed from #source when appropriate --- lib/bundler/rubygems_ext.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/bundler/rubygems_ext.rb') diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb index 88c446e11a..60b17faf63 100644 --- a/lib/bundler/rubygems_ext.rb +++ b/lib/bundler/rubygems_ext.rb @@ -16,8 +16,15 @@ module Gem class Specification attr_accessor :remote, :location, :relative_loaded_from - remove_method :source if instance_methods(false).include?(:source) - attr_accessor :source + if instance_methods(false).include?(:source) + remove_method :source + attr_writer :source + def source + (defined?(@source) && @source) || Gem::Source::Installed.new + end + else + attr_accessor :source + end alias_method :rg_full_gem_path, :full_gem_path alias_method :rg_loaded_from, :loaded_from -- cgit v1.2.1