class Bundler::RubyVersion
Attributes
engine[R]
engine_version[R]
patchlevel[R]
version[R]
Public Class Methods
new(version, patchlevel, engine, engine_version)
click to toggle source
# File lib/bundler/ruby_version.rb, line 5 def initialize(version, patchlevel, 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 @patchlevel = patchlevel end
Public Instance Methods
==(other)
click to toggle source
# File lib/bundler/ruby_version.rb, line 34 def ==(other) version == other.version && engine == other.engine && engine_version == other.engine_version && patchlevel == other.patchlevel end
diff(other)
click to toggle source
Returns a tuple of these things:
[diff, this, other] The priority of attributes are 1. engine 2. ruby_version 3. engine_version
# File lib/bundler/ruby_version.rb, line 47 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 ] elsif patchlevel != other.patchlevel && @patchlevel [ :patchlevel, patchlevel, other.patchlevel ] else nil end end
host()
click to toggle source
# File lib/bundler/ruby_version.rb, line 61 def host @host ||= [ RbConfig::CONFIG["host_cpu"], RbConfig::CONFIG["host_vendor"], RbConfig::CONFIG["host_os"] ].join("-") end
to_s()
click to toggle source
# File lib/bundler/ruby_version.rb, line 26 def to_s output = "ruby #{version}" output << "p#{patchlevel}" if patchlevel output << " (#{engine} #{engine_version})" unless engine == "ruby" output end