Class: Luban::Deployment::Packages::Go::Installer
- Inherits:
-
Luban::Deployment::Package::Installer
- Object
- Luban::Deployment::Package::Installer
- Luban::Deployment::Packages::Go::Installer
- Defined in:
- lib/luban/deployment/packages/go/installer.rb
Instance Method Summary collapse
- #build_path ⇒ Object
- #installed? ⇒ Boolean
- #package_dist ⇒ Object
- #package_full_name ⇒ Object
- #source_repo ⇒ Object
- #source_url_root ⇒ Object
Instance Method Details
#build_path ⇒ Object
25 26 27 |
# File 'lib/luban/deployment/packages/go/installer.rb', line 25 def build_path @build_path ||= package_tmp_path.join("go") end |
#installed? ⇒ Boolean
19 20 21 22 23 |
# 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 ⇒ Object
8 |
# File 'lib/luban/deployment/packages/go/installer.rb', line 8 def package_dist; task.opts.dist; end |
#package_full_name ⇒ Object
9 |
# File 'lib/luban/deployment/packages/go/installer.rb', line 9 def package_full_name; "go#{package_version}.#{package_dist}"; end |
#source_repo ⇒ Object
11 12 13 |
# File 'lib/luban/deployment/packages/go/installer.rb', line 11 def source_repo @source_repo ||= 'https://storage.googleapis.com' end |
#source_url_root ⇒ Object
15 16 17 |
# File 'lib/luban/deployment/packages/go/installer.rb', line 15 def source_url_root @source_url_root ||= "golang" end |