Class: Bundler::LazySpecification

### Home Classes Methods

### In Files

- lib/bundler/lazy_specification.rb

### Parent

Object

### Methods

- ::new
- #==
- #__materialize__
- #full_name
- #identifier
- #respond_to?
- #satisfies?
- #to_lock
- #to_s

### Included Modules

- Bundler::MatchPlatform

### Files

- bundle
- bundle-config
- bundle-config.txt
- bundle-exec
- bundle-exec.txt
- bundle-install
- bundle-install.txt
- bundle-package
- bundle-package.txt
- bundle-platform
- bundle-platform.txt
- bundle-update
- bundle-update.txt
- bundle.txt
- gemfile.5.txt
- Executable
- Gemfile

### Class/Module Index

Quicksearch

- Bundler
- Bundler::BundlerError
- Bundler::CLI
- Bundler::Definition
- Bundler::DepProxy
- Bundler::Dependency
- Bundler::Deployment
- Bundler::Deprecate
- Bundler::DeprecatedError
- Bundler::Dsl
- Bundler::EndpointSpecification
- Bundler::Env
- Bundler::Environment
- Bundler::Fetcher
- Bundler::Fetcher::CertificateFailureError
- Bundler::Fetcher::FallbackError
- Bundler::Fetcher::SSLError
- Bundler::GemHelper
- Bundler::GemHelpers
- Bundler::GemInstaller
- Bundler::GemNotFound
- Bundler::GemfileError
- Bundler::GemfileNotFound
- Bundler::GemspecError
- Bundler::GitError
- Bundler::Graph
- Bundler::Graph::GraphVizClient
- Bundler::HTTPError
- Bundler::Index
- Bundler::Injector
- Bundler::InstallError
- Bundler::InstallHookError
- Bundler::Installer
- Bundler::InvalidOption
- Bundler::InvalidSpecSet
- Bundler::LazySpecification
- Bundler::LockfileError
- Bundler::LockfileParser
- Bundler::MarshalError
- Bundler::MatchPlatform
- Bundler::PathError
- Bundler::ProductionError
- Bundler::RemoteSpecification
- Bundler::Resolver
- Bundler::Resolver::SpecGroup
- Bundler::RubyDsl
- Bundler::RubyVersion
- Bundler::RubyVersionMismatch
- Bundler::RubygemsIntegration
- Bundler::RubygemsIntegration::AlmostModern
- Bundler::RubygemsIntegration::Ancient
- Bundler::RubygemsIntegration::Future
- Bundler::RubygemsIntegration::Gem
- Bundler::RubygemsIntegration::Gem::SourceIndex
- Bundler::RubygemsIntegration::Legacy
- Bundler::RubygemsIntegration::Modern
- Bundler::RubygemsIntegration::Transitional
- Bundler::Runtime
- Bundler::SecurityError
- Bundler::Settings
- Bundler::SharedHelpers
- Bundler::SimilarityDetector
- Bundler::Source
- Bundler::Source::Git
- Bundler::Source::Git::GitProxy
- Bundler::Source::Path
- Bundler::Source::Path::Installer
- Bundler::Source::Rubygems
- Bundler::SpecSet
- Bundler::SystemRubyVersion
- Bundler::UI
- Bundler::UI::RGProxy
- Bundler::UI::Shell
- Bundler::VersionConflict
- Gem
- Gem::Dependency
- Gem::Platform
- Gem::Requirement
- Gem::Specification
- Object

No matching classes.

# Bundler::LazySpecification

### Attributes

dependencies[R]
name[R]
platform[R]
source[RW]
version[R]

### Public Class Methods

new(name, version, platform, source = nil) click to toggle source

    # File lib/bundler/lazy_specification.rb, line 11
    def initialize(name, version, platform, source = nil)
      @name          = name
      @version       = version
      @dependencies  = []
      @platform      = platform
      @source        = source
      @specification = nil
    end

### Public Instance Methods

==(other) click to toggle source

    # File lib/bundler/lazy_specification.rb, line 28
    def ==(other)
      identifier == other.identifier
    end

__materialize__() click to toggle source

    # File lib/bundler/lazy_specification.rb, line 51
    def __materialize__
      @specification = source.specs.search(Gem::Dependency.new(name, version)).last
    end

full_name() click to toggle source

    # File lib/bundler/lazy_specification.rb, line 20
    def full_name
      if platform == Gem::Platform::RUBY or platform.nil? then
        "#{@name}-#{@version}"
      else
        "#{@name}-#{@version}-#{platform}"
      end
    end

identifier() click to toggle source

    # File lib/bundler/lazy_specification.rb, line 63
    def identifier
      @__identifier ||= [name, version, source, platform, dependencies].hash
    end

respond_to?(*args) click to toggle source

    # File lib/bundler/lazy_specification.rb, line 55
    def respond_to?(*args)
      super || @specification.respond_to?(*args)
    end

satisfies?(dependency) click to toggle source

    # File lib/bundler/lazy_specification.rb, line 32
    def satisfies?(dependency)
      @name == dependency.name && dependency.requirement.satisfied_by?(Gem::Version.new(@version))
    end

to_lock() click to toggle source

    # File lib/bundler/lazy_specification.rb, line 36
    def to_lock
      if platform == Gem::Platform::RUBY or platform.nil?
        out = "    #{name} (#{version})\n"
      else
        out = "    #{name} (#{version}-#{platform})\n"
      end

      dependencies.sort_by {|d| d.to_s }.each do |dep|
        next if dep.type == :development
        out << "    #{dep.to_lock}\n"
      end

      out
    end

to_s() click to toggle source

    # File lib/bundler/lazy_specification.rb, line 59
    def to_s
      @__to_s ||= "#{name} (#{version})"
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.