class Luban::Deployment::Packages::Go::Installer
Public Instance Methods
build_path()
click to toggle source
# File lib/luban/deployment/packages/go/installer.rb, line 25 def build_path @build_path ||= package_tmp_path.join("go") end
installed?()
click to toggle source
# File lib/luban/deployment/packages/go/installer.rb, line 19 def installed? return false unless file?(go_executable) pattern = Regexp.new(Regexp.escape("go version go#{package_version}")) match?("GOROOT=#{install_path} #{go_executable} version 2>&1", pattern) end
package_dist()
click to toggle source
# File lib/luban/deployment/packages/go/installer.rb, line 8 def package_dist; task.opts.dist; end
package_full_name()
click to toggle source
# File lib/luban/deployment/packages/go/installer.rb, line 9 def package_full_name; "go#{package_version}.#{package_dist}"; end
source_repo()
click to toggle source
# File lib/luban/deployment/packages/go/installer.rb, line 11 def source_repo @source_repo ||= 'https://storage.googleapis.com' end
source_url_root()
click to toggle source
# File lib/luban/deployment/packages/go/installer.rb, line 15 def source_url_root @source_url_root ||= "golang" end
Protected Instance Methods
build_package()
click to toggle source
# File lib/luban/deployment/packages/go/installer.rb, line 31 def build_package info "Building #{package_full_name}" within install_path do rm('-r', '*') # Clean up install path execute(:mv, build_path.join('*'), '.', ">> #{install_log_file_path} 2>&1") end end