Sha256: 055c641982c6a2129ae9ab72ecfad7604248c2e74c8e8ad45b9b8c2682dba239

Contents?: true

Size: 875 Bytes

Versions: 9

Compression:

Stored size: 875 Bytes

Contents

# frozen_string_literal: true

require "ruby-next/version"

module RubyNext
  # Mininum Ruby version supported by RubyNext
  MIN_SUPPORTED_VERSION = Gem::Version.new("2.5.0")

  # Where to store transpiled files (relative from the project LOAD_PATH, usually `lib/`)
  RUBY_NEXT_DIR = ".rbnext"

  # Defines last minor version for every major version
  LAST_MINOR_VERSIONS = {
    2 => 7
  }.freeze

  LATEST_VERSION = [2, 7].freeze

  class << self
    def next_version(version = RUBY_VERSION)
      major, minor = Gem::Version.new(version).segments.map(&:to_i)

      return if major >= LATEST_VERSION.first && minor >= LATEST_VERSION.last

      nxt =
        if LAST_MINOR_VERSIONS[major] == minor
          "#{major + 1}.0.0"
        else
          "#{major}.#{minor + 1}.0"
        end

      Gem::Version.new(nxt)
    end
  end

  require_relative "ruby-next/core"
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
ruby-next-core-0.5.1 lib/ruby-next.rb
ruby-next-core-0.5.0 lib/ruby-next.rb
ruby-next-core-0.4.0 lib/ruby-next.rb
ruby-next-0.3.0 lib/ruby-next.rb
ruby-next-core-0.3.0 lib/ruby-next.rb
ruby-next-0.2.0 lib/ruby-next.rb
ruby-next-core-0.2.0 lib/ruby-next.rb
ruby-next-0.1.1 lib/ruby-next.rb
ruby-next-0.1.0 lib/ruby-next.rb