Class: Luban::Deployment::Packages::Node::Installer

Inherits:
Luban::Deployment::Package::Installer
  • Object
show all
Defined in:
lib/luban/deployment/packages/node/installer.rb

Instance Method Summary collapse

Instance Method Details

#installed?Boolean

Returns:

  • (Boolean)


20
21
22
23
24
# File 'lib/luban/deployment/packages/node/installer.rb', line 20

def installed?
  return false unless file?(node_executable)
  pattern = Regexp.new(Regexp.escape("v#{package_version}"))
  match?("#{node_executable} --version 2>&1", pattern)
end

#package_distObject



8
# File 'lib/luban/deployment/packages/node/installer.rb', line 8

def package_dist; task.opts.dist; end

#package_full_nameObject



9
# File 'lib/luban/deployment/packages/node/installer.rb', line 9

def package_full_name; "node#{package_version}.#{package_dist}"; end

#source_repoObject



12
13
14
# File 'lib/luban/deployment/packages/node/installer.rb', line 12

def source_repo
  @source_repo ||= 'https://nodejs.org'
end

#source_url_rootObject



16
17
18
# File 'lib/luban/deployment/packages/node/installer.rb', line 16

def source_url_root
  @source_url_root ||= "dist/v#{package_version}"
end