Class: Luban::Deployment::Packages::Ruby::Installer

Inherits:
Luban::Deployment::Package::Installer show all
Defined in:
lib/luban/deployment/packages/ruby.rb

Constant Summary

Constants inherited from Luban::Deployment::Package::Installer

Luban::Deployment::Package::Installer::DefaultLibExtension, Luban::Deployment::Package::Installer::DefaultSrcFileExtName, Luban::Deployment::Package::Installer::LibExtensions

Constants included from Luban::Deployment::Parameters::General

Luban::Deployment::Parameters::General::DefaultLubanRootPath

Constants included from Helpers::Utils

Helpers::Utils::LogLevels

Instance Attribute Summary collapse

Attributes inherited from Luban::Deployment::Package::Installer

#build_env_vars, #configure_opts

Attributes inherited from Worker::Base

#task

Attributes included from Helpers::Utils

#backend

Attributes included from Helpers::Configuration

#config

Instance Method Summary collapse

Methods inherited from Luban::Deployment::Package::Installer

#build_path, #cached?, #cleanup_all, #configure_executable, #current_configured?, #current_package_version, #current_symlinked?, #currently_used_by, #default_configure_opts, #download, #download_url, #downloaded?, #get_summary, #include_path, #install, #install_log_file_name, #install_log_file_path, #install_log_path, #lib_path, #required_packages, #src_cache_path, #src_file_extname, #src_file_md5, #src_file_name, #src_file_path, #src_md5_file_path, #uninstall, #update_binstubs, #validate_download_url, #whence_origin, #which_current

Methods inherited from Luban::Deployment::Package::Worker

#bin_path, #child?, #current_bin_path, #current_path, define_executable, #install_path, package_class, #package_downloads_path, #package_path, #package_tmp_path, #package_versions_path, #parent, worker_class

Methods included from Worker::Paths::Remote

#app_bin_path, #app_path, #app_tmp_path, #current_app_path, #downloads_path, #env_path, #envrc_file, #etc_path, #logrotate_path, #luban_install_path, #project_path, #releases_path, #shared_path, #tmp_path, #unset_envrc_file

Methods inherited from Worker::Base

#dry_run?, #env_name, #force?, #initialize, #linux?, #osx?, #run, #target_full_name, #target_major_version, #target_name, #target_patch_level, #target_version

Methods included from Luban::Deployment::Parameters::Base

#parameter

Methods included from Luban::Deployment::Parameters::General

included

Methods included from Helpers::Utils

#assure, #assure_dirs, #assure_symlink, #capture, #check_pass?, #chmod, #cp, #directory?, #file?, #hardware_name, #host, #hostname, #ln, #match?, #md5_for_file, #md5_matched?, #method_missing, #mkdir, #mv, #now, #os_name, #os_release, #readlink, #render_template, #revision_match?, #rm, #rmdir, #sudo, #symlink?, #upload_by_template, #url_exists?, #user_home

Methods included from Helpers::Configuration

#ask, #default_templates_paths, #fetch, #find_template_file, #load_configuration_file, #primary, #release_roles, #role, #roles, #server, #set, #set_default, #syntax_error?

Constructor Details

This class inherits a constructor from Luban::Deployment::Worker::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Luban::Deployment::Helpers::Utils

Instance Attribute Details

#opt_dirsObject (readonly)

Returns the value of attribute opt_dirs.



71
72
73
# File 'lib/luban/deployment/packages/ruby.rb', line 71

def opt_dirs
  @opt_dirs
end

Instance Method Details

#gem_executableObject



79
80
81
# File 'lib/luban/deployment/packages/ruby.rb', line 79

def gem_executable
  @gem_executable ||= bin_path.join('gem')
end

#install_doc?Boolean

Returns:

  • (Boolean)


73
74
75
# File 'lib/luban/deployment/packages/ruby.rb', line 73

def install_doc?
  task.opts.install_doc
end

#installed?Boolean

Returns:

  • (Boolean)


91
92
93
94
95
96
97
98
# File 'lib/luban/deployment/packages/ruby.rb', line 91

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_repoObject



83
84
85
# File 'lib/luban/deployment/packages/ruby.rb', line 83

def source_repo
  @source_repo ||= "https://cache.ruby-lang.org"
end

#source_url_rootObject



87
88
89
# File 'lib/luban/deployment/packages/ruby.rb', line 87

def source_url_root
  @source_url_root ||= "pub/ruby/#{package_major_version.gsub(/\.\d+$/, '')}"
end

#with_opt_dir(dir) ⇒ Object Also known as: with_openssl_dir, with_yaml_dir



100
101
102
# File 'lib/luban/deployment/packages/ruby.rb', line 100

def with_opt_dir(dir)
  @opt_dirs << dir
end