class Luban::Deployment::Packages::Ruby::Installer
Attributes
opt_dirs[R]
Public Instance Methods
gem_executable()
click to toggle source
# File lib/luban/deployment/packages/ruby.rb, line 121 def gem_executable @gem_executable ||= bin_path.join('gem') end
install_doc?()
click to toggle source
# File lib/luban/deployment/packages/ruby.rb, line 107 def install_doc? task.opts.install_doc end
install_static?()
click to toggle source
# File lib/luban/deployment/packages/ruby.rb, line 103 def install_static? task.opts.install_static end
install_tcl?()
click to toggle source
# File lib/luban/deployment/packages/ruby.rb, line 111 def install_tcl? task.opts.install_tcl end
install_tk?()
click to toggle source
# File lib/luban/deployment/packages/ruby.rb, line 115 def install_tk? task.opts.install_tk end
installed?()
click to toggle source
# File lib/luban/deployment/packages/ruby.rb, line 133 def installed? return false unless file?(ruby_executable) pattern = Regexp.escape(package_major_version) unless package_patch_level.empty? pattern += ".*#{Regexp.escape(package_patch_level)}" end match?("#{ruby_executable} -v", Regexp.new(pattern)) end
source_repo()
click to toggle source
# File lib/luban/deployment/packages/ruby.rb, line 125 def source_repo @source_repo ||= "https://cache.ruby-lang.org" end
source_url_root()
click to toggle source
# File lib/luban/deployment/packages/ruby.rb, line 129 def source_url_root @source_url_root ||= "pub/ruby/#{package_major_version.gsub(/\.\d+$/, '')}" end
with_jemalloc_dir(dir)
click to toggle source
# File lib/luban/deployment/packages/ruby.rb, line 148 def with_jemalloc_dir(dir) with_opt_dir(dir) @configure_opts << "--with-jemalloc" @configure_opts << "LDFLAGS=\"-Wl,-rpath -Wl,#{dir.join('lib')}\"" end
with_opt_dir(dir)
click to toggle source
# File lib/luban/deployment/packages/ruby.rb, line 142 def with_opt_dir(dir) @opt_dirs << dir end
Also aliased as: with_openssl_dir, with_yaml_dir
Protected Instance Methods
after_install()
click to toggle source
Calls superclass method
Luban::Deployment::Package::Installer#after_install
# File lib/luban/deployment/packages/ruby.rb, line 170 def after_install super create_symlinks_for_header_files remove_static_library unless install_static? end
compose_build_options()
click to toggle source
Calls superclass method
Luban::Deployment::Package::Installer#compose_build_options
# File lib/luban/deployment/packages/ruby.rb, line 165 def compose_build_options @configure_opts << "--with-opt-dir=#{@opt_dirs.join(':')}" super end
configure_build_options()
click to toggle source
Calls superclass method
Luban::Deployment::Package::Installer#configure_build_options
# File lib/luban/deployment/packages/ruby.rb, line 156 def configure_build_options super @configure_opts.unshift("--disable-install-doc") unless install_doc? @configure_opts << "--enable-shared" unless install_static? @configure_opts << "--without-tcl" unless install_tcl? @configure_opts << "--without-tk" unless install_tk? @opt_dirs = [] end
create_symlinks_for_header_files()
click to toggle source
# File lib/luban/deployment/packages/ruby.rb, line 176 def create_symlinks_for_header_files if !header_file_exists?("ruby/version.h") and (source_path = find_header_file("version.h")) assure_dirs(target_path = source_path.dirname.join('ruby')) ln(source_path, target_path.join('version.h')) end if !header_file_exists?("ruby/io.h") and (source_path = find_header_file("*/rubyio.h")) assure_dirs(target_path = source_path.dirname.join('ruby')) ln(source_path, target_path.join('io.h')) end end
find_header_file(file)
click to toggle source
# File lib/luban/deployment/packages/ruby.rb, line 189 def find_header_file(file) f = capture(:find, install_path.to_s, "-wholename '*/#{file}'") f.empty? ? nil : Pathname.new(f) end
header_file_exists?(file)
click to toggle source
# File lib/luban/deployment/packages/ruby.rb, line 194 def header_file_exists?(file); !!find_header_file(file); end
remove_static_library()
click to toggle source
# File lib/luban/deployment/packages/ruby.rb, line 196 def remove_static_library rm(install_path.join('lib', 'libruby-static.a')) end