diff options
Diffstat (limited to 'lib/rubygems/resolver/specification.rb')
-rw-r--r-- | lib/rubygems/resolver/specification.rb | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/rubygems/resolver/specification.rb b/lib/rubygems/resolver/specification.rb index d158225474..4d77293262 100644 --- a/lib/rubygems/resolver/specification.rb +++ b/lib/rubygems/resolver/specification.rb @@ -31,6 +31,14 @@ class Gem::Resolver::Specification attr_reader :source ## + # The Gem::Specification for this Resolver::Specification. + # + # Implementers, note that #install updates @spec, so be sure to cache the + # Gem::Specification in @spec when overriding. + + attr_reader :spec + + ## # The version of the gem for this specification. attr_reader :version @@ -48,6 +56,13 @@ class Gem::Resolver::Specification end ## + # Fetches development dependencies if the source does not provide them by + # default (see APISpecification). + + def fetch_development_dependencies # :nodoc: + end + + ## # The name and version of the specification. # # Unlike Gem::Specification#full_name, the platform is not included. @@ -61,8 +76,11 @@ class Gem::Resolver::Specification # install method yields a Gem::Installer instance, which indicates the # gem will be installed, or +nil+, which indicates the gem is already # installed. + # + # After installation #spec is updated to point to the just-installed + # specification. - def install options + def install options = {} require 'rubygems/installer' destination = options[:install_dir] || Gem.dir @@ -75,7 +93,7 @@ class Gem::Resolver::Specification yield installer if block_given? - installer.install + @spec = installer.install end ## @@ -85,5 +103,8 @@ class Gem::Resolver::Specification Gem::Platform.match spec.platform end + def local? # :nodoc: + false + end end |