diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-07-10 11:06:49 -0300 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-07-19 17:13:19 -0500 |
commit | f9de70ee931ca4a8500916fa9480f6df6c062626 (patch) | |
tree | 90a37c388a808476439d854596e1ecd38e148769 /lib/bundler/rubygems_ext.rb | |
parent | a3718adf29fb63c8cf86719f909cd3fed5f0c022 (diff) | |
download | bundler-f9de70ee931ca4a8500916fa9480f6df6c062626.tar.gz |
[RubygemsExt] return Source::Installed from #source when appropriate
Diffstat (limited to 'lib/bundler/rubygems_ext.rb')
-rw-r--r-- | lib/bundler/rubygems_ext.rb | 11 |
1 files changed, 9 insertions, 2 deletions
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 |