Module: RubyConfig::Runtimes::RubyFromSourceHelper

Defined in:
lib/ruby_config/runtimes/ruby_from_source_helper.rb

Class Method Summary collapse

Class Method Details

.compile(source_path, installation_path) ⇒ Object



15
16
17
18
19
20
# File 'lib/ruby_config/runtimes/ruby_from_source_helper.rb', line 15

def self.compile(source_path, installation_path)
  FileUtils.cd(source_path)
  system("./configure --prefix=#{installation_path} --enable-shared")
  system("make")
  system("make install")
end

.download_url(major_version, minor_version, patch_level) ⇒ Object



6
7
8
9
# File 'lib/ruby_config/runtimes/ruby_from_source_helper.rb', line 6

def self.download_url(major_version, minor_version, patch_level)
  version = ruby_version(major_version, minor_version, patch_level)
  "ftp://ftp.ruby-lang.org/pub/ruby/#{major_version}/ruby-#{version}.tar.gz"
end

.ruby_version(major_version, minor_version, patch_level) ⇒ Object



11
12
13
# File 'lib/ruby_config/runtimes/ruby_from_source_helper.rb', line 11

def self.ruby_version(major_version, minor_version, patch_level)
  "#{major_version}.#{minor_version}-p#{patch_level}"
end