Skip to content

Commit bf35b2c

Browse files
deivid-rodriguezmatzbot
authored andcommitted
[rubygems/rubygems] Cleaner extension of Gem::Specification to be able to set source
ruby/rubygems@3749273ec6
1 parent 50e6363 commit bf35b2c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/bundler/rubygems_ext.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,16 @@ class Specification
8181

8282
attr_accessor :remote, :relative_loaded_from
8383

84-
remove_method :source
85-
attr_writer :source
86-
def source
87-
(defined?(@source) && @source) || Gem::Source::Installed.new
84+
module AllowSettingSource
85+
attr_writer :source
86+
87+
def source
88+
(defined?(@source) && @source) || super
89+
end
8890
end
8991

92+
prepend AllowSettingSource
93+
9094
alias_method :rg_full_gem_path, :full_gem_path
9195
alias_method :rg_loaded_from, :loaded_from
9296

0 commit comments

Comments
 (0)