Class: Bundler::RubyVersion

### Home Classes Methods

### In Files

- lib/bundler/ruby_version.rb

### Parent

Object

### Methods

- ::new
- #==
- #diff
- #to_s

### 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::RubyVersion

### Attributes

engine[R]
engine_version[R]
version[R]

### Public Class Methods

new(version, engine, engine_version) click to toggle source

    # File lib/bundler/ruby_version.rb, line 5
    def initialize(version, engine, engine_version)
      # The parameters to this method must satisfy the
      # following constraints, which are verified in
      # the DSL:
      #
      # * If an engine is specified, an engine version
      #   must also be specified
      # * If an engine version is specified, an engine
      #   must also be specified
      # * If the engine is "ruby", the engine version
      #   must not be specified, or the engine version
      #   specified must match the version.

      @version        = version
      @engine         = engine || "ruby"
      # keep track of the engine specified by the user
      @input_engine   = engine
      @engine_version = engine_version || version
    end

### Public Instance Methods

==(other) click to toggle source

    # File lib/bundler/ruby_version.rb, line 32
    def ==(other)
      version          == other.version &&
        engine         == other.engine &&
        engine_version == other.engine_version
    end

diff(other) click to toggle source

Returns a tuple of thsee things:

    [diff, this, other]
    The priority of attributes are
    1. engine
    2. ruby_version
    3. engine_version

    # File lib/bundler/ruby_version.rb, line 44
    def diff(other)
      if engine != other.engine && @input_engine
        [ :engine, engine, other.engine ]
      elsif version != other.version
        [ :version, version, other.version ]
      elsif engine_version != other.engine_version && @input_engine
        [ :engine_version, engine_version, other.engine_version ]
      else
        nil
      end
    end

to_s() click to toggle source

    # File lib/bundler/ruby_version.rb, line 25
    def to_s
      output = "ruby #{version}"
      output << " (#{engine} #{engine_version})" unless engine == "ruby"

      output
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.