Sha256: 13ca899a8b6d72b446e87788161c3f52d67d605fbe995a527125353db459b7bf

Contents?: true

Size: 1.54 KB

Versions: 1

Compression:

Stored size: 1.54 KB

Contents

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 ruby21
      Ruby.new(MRI.new('2.1', MRIRetriever.new))
    end

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

    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-0.0.3 lib/latest_ruby.rb