Skip to content

Commit 508d9c0

Browse files
evanphxdrbrain
authored andcommitted
- Gem.try_activate should return true if the spec is already active
1 parent c721203 commit 508d9c0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/rubygems.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,12 @@ def self.try_activate path
173173
# require will try to activate the more specific version.
174174

175175
spec = Gem::Specification.find_inactive_by_path path
176-
return false unless spec
176+
177+
unless spec
178+
spec = Gem::Specification.find_by_path path
179+
return true if spec && spec.activated?
180+
return false
181+
end
177182

178183
begin
179184
spec.activate

0 commit comments

Comments
 (0)