Sha256: 0661d7838f68d33693fd33cb9ebfce6f49e7071c656cb1cb0a26875b93c99f5f

Contents?: true

Size: 1.98 KB

Versions: 1

Compression:

Stored size: 1.98 KB

Contents

require 'net/http'
require_relative 'latest_ruby/ruby'
require_relative 'latest_ruby/ruby_version'
require_relative 'latest_ruby/rubies/mri'
require_relative 'latest_ruby/rubies/jruby'
require_relative 'latest_ruby/rubies/rubinius'
require_relative 'latest_ruby/rubies/maglev'
require_relative 'latest_ruby/rubies/macruby'
require_relative 'latest_ruby/retrievers/mri_retriever'
require_relative 'latest_ruby/retrievers/jruby_retriever'
require_relative 'latest_ruby/retrievers/rubinius_retriever'
require_relative 'latest_ruby/retrievers/maglev_retriever'
require_relative 'latest_ruby/retrievers/macruby_retriever'

module Latest

  # The VERSION file must be in the root directory of the library.
  VERSION_FILE = File.expand_path('../../VERSION', __FILE__)

  VERSION = File.exist?(VERSION_FILE) ?
    File.read(VERSION_FILE).chomp : '(could not find VERSION file)'

  class << self
    def ruby27
      Ruby.new(MRI.new('2.7', MRIRetriever.new))
    end

    def ruby26
      Ruby.new(MRI.new('2.6', MRIRetriever.new))
    end

    def ruby25
      Ruby.new(MRI.new('2.5', MRIRetriever.new))
    end

    # The latest Ruby version by default.
    alias_method :ruby, :ruby27

    def ruby24
      Ruby.new(MRI.new('2.4', MRIRetriever.new))
    end

    def ruby23
      Ruby.new(MRI.new('2.3', MRIRetriever.new))
    end

    def ruby22
      Ruby.new(MRI.new('2.2', MRIRetriever.new))
    end

    def ruby21
      Ruby.new(MRI.new('2.1', MRIRetriever.new))
    end

    def ruby20
      Ruby.new(MRI.new('2.0', MRIRetriever.new))
    end

    def ruby19
      Ruby.new(MRI.new('1.9', MRIRetriever.new))
    end

    def ruby18
      Ruby.new(MRI.new('1.8', MRIRetriever.new))
    end

    def jruby
      Ruby.new(JRuby.new(JRubyRetriever.new))
    end

    def rubinius
      Ruby.new(Rubinius.new(RubiniusRetriever.new))
    end
    alias_method :rbx, :rubinius

    def maglev
      Ruby.new(MagLev.new(MagLevRetriever.new))
    end

    def macruby
      Ruby.new(MacRuby.new(MacRubyRetriever.new))
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
latest_ruby-2.0.0 lib/latest_ruby.rb