lib/bundler/ruby_version.rb in bundler-1.4.0.pre.1 vs lib/bundler/ruby_version.rb in bundler-1.4.0.pre.2

- old
+ new

@@ -1,10 +1,10 @@ module Bundler class RubyVersion - attr_reader :version, :engine, :engine_version + attr_reader :version, :patchlevel, :engine, :engine_version - def initialize(version, engine, engine_version) + 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 @@ -18,23 +18,26 @@ @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 def to_s output = "ruby #{version}" + output << "p#{patchlevel}" if patchlevel output << " (#{engine} #{engine_version})" unless engine == "ruby" output end def ==(other) version == other.version && engine == other.engine && - engine_version == other.engine_version + engine_version == other.engine_version && + patchlevel == other.patchlevel end # Returns a tuple of thsee things: # [diff, this, other] # The priority of attributes are @@ -46,10 +49,12 @@ [ :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 end @@ -93,8 +98,12 @@ JRUBY_VERSION.dup else raise BundlerError, "That RUBY_ENGINE is not recognized" nil end + end + + def patchlevel + RUBY_PATCHLEVEL end end end