Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

+ Added Specification#activated, activated=, and activated?

  • Loading branch information...
commit 02ead548e38ff90923444fa7c0ff9f6a5dbd87b0 1 parent 5f983ed
@zenspider zenspider authored
View
2  lib/rubygems/custom_require.rb
@@ -36,7 +36,7 @@ def require path
gem_original_require path
else
spec = Gem::Specification.find { |s|
- s.loaded? and s.contains_requirable_file? path
+ s.activated? and s.contains_requirable_file? path
}
unless spec then
View
2  lib/rubygems/dependency.rb
@@ -248,6 +248,6 @@ def to_specs
def to_spec
matches = self.to_specs
- matches.find { |spec| spec.loaded? } or matches.last
+ matches.find { |spec| spec.activated? } or matches.last
end
end
View
12 lib/rubygems/specification.rb
@@ -211,14 +211,20 @@ class Gem::Specification
attr_accessor :homepage
##
- # true when this gemspec has been loaded from a specifications directory.
- # This attribute is not persisted.
+ # True when this gemspec has been activated. This attribute is not persisted.
attr_accessor :loaded
alias :loaded? :loaded
##
+ # True when this gemspec has been activated. This attribute is not persisted.
+
+ attr_accessor :activated
+
+ alias :activated? :activated
+
+ ##
# Path this gemspec was loaded from. This attribute is not persisted.
attr_reader :loaded_from
@@ -699,7 +705,7 @@ def activate
return false if Gem.loaded_specs[self.name]
- self.loaded = true
+ self.activated = true
Gem.loaded_specs[self.name] = self
activate_dependencies
Please sign in to comment.
Something went wrong with that request. Please try again.