class Traveler::Gem
Constants
- EXTENSION
- URL_FORMAT
Public Class Methods
new(platform, name, version)
click to toggle source
# File lib/traveler/gem.rb, line 7 def initialize platform, name, version @platform, @name, @version = platform, name, version end
Public Instance Methods
install()
click to toggle source
# File lib/traveler/gem.rb, line 11 def install Dir.chdir 'vendor/ruby' do download extract clean end end
name()
click to toggle source
# File lib/traveler/gem.rb, line 19 def name [@name, @version].join('-') + EXTENSION end
url()
click to toggle source
# File lib/traveler/gem.rb, line 23 def url RELEASES_URL + URL_FORMAT % [ TRAVELING_RUBY_VERSION, EFFECTIVE_RUBY_VERSION, @platform, name ] end
Private Instance Methods
clean()
click to toggle source
# File lib/traveler/gem.rb, line 41 def clean sh('"%s" -f "%s"' % [RM, name]) end
download()
click to toggle source
# File lib/traveler/gem.rb, line 33 def download sh('"%s" -L --fail -O "%s"' % [CURL, url]) end
extract()
click to toggle source
# File lib/traveler/gem.rb, line 37 def extract sh('"%s" -xzf "%s"' % [TAR, name]) end