method

new

Importance_0
v2_6_3 - Show latest stable - 0 notes - Class: RubyVersion
  • 1_8_6_287
  • 1_8_7_72
  • 1_8_7_330
  • 1_9_1_378
  • 1_9_2_180
  • 1_9_3_125
  • 1_9_3_392
  • 2_1_10
  • 2_2_9
  • 2_4_6
  • 2_5_5
  • 2_6_3 (0)
  • What's this?
new(versions, patchlevel, engine, engine_version) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/bundler/ruby_version.rb, line 12
    def initialize(versions, 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.

      @versions = Array(versions).map do |v|
        op, v = Gem::Requirement.parse(v)
        op == "=" ? v.to_s : "#{op} #{v}"
      end

      @gem_version        = Gem::Requirement.create(@versions.first).requirements.first.last
      @input_engine       = engine && engine.to_s
      @engine             = engine && engine.to_s || "ruby"
      @engine_versions    = (engine_version && Array(engine_version)) || @versions
      @engine_gem_version = Gem::Requirement.create(@engine_versions.first).requirements.first.last
      @patchlevel         = patchlevel
    end
Register or log in to add new notes.