class Traveler::Runtime

Constants

BASENAME_FORMAT
EXTENSION

Public Class Methods

new(platform) click to toggle source
# File lib/traveler/runtime.rb, line 7
def initialize platform
  @platform = platform
end

Public Instance Methods

basename() click to toggle source
# File lib/traveler/runtime.rb, line 16
def basename
  BASENAME_FORMAT % [
    TRAVELING_RUBY_VERSION,
    EFFECTIVE_RUBY_VERSION,
    @platform
  ]
end
dirname() click to toggle source
# File lib/traveler/runtime.rb, line 28
def dirname
  Traveler.rubydir(basename)
end
download() click to toggle source
# File lib/traveler/runtime.rb, line 36
def download
  return if File.exists?(name)
  sh('"%s" -L --fail -O "%s"' % [CURL, url])
end
extract() click to toggle source
# File lib/traveler/runtime.rb, line 41
def extract
  FileUtils.rm_rf(basename)
  FileUtils.mkdir(basename)
  sh('"%s" -C "%s" -xzf "%s"' % [TAR, basename, name])
end
install() click to toggle source
# File lib/traveler/runtime.rb, line 11
def install
  download
  extract
end
name() click to toggle source
# File lib/traveler/runtime.rb, line 24
def name
  basename + EXTENSION
end
url() click to toggle source
# File lib/traveler/runtime.rb, line 32
def url
  RELEASES_URL + name
end