class Luban::Deployment::Package::Worker

Public Class Methods

define_executable(*names) click to toggle source
# File lib/luban/deployment/cli/package/worker.rb, line 33
def define_executable(*names)
  names.each do |name|
    define_method("#{name.gsub('-', '_')}_executable") do
      if instance_variable_defined?("@#{__method__}")
        instance_variable_get("@#{__method__}")
      else
        instance_variable_set("@#{__method__}", bin_path.join(name))
      end
    end
  end
end
package_class(package) click to toggle source
# File lib/luban/deployment/cli/package/worker.rb, line 25
def package_class(package)
  Luban::Deployment::Package::Base.package_class(package)
end
worker_class(worker, **opts) click to toggle source
# File lib/luban/deployment/cli/package/worker.rb, line 29
def worker_class(worker, **opts)
  Luban::Deployment::Package::Base.worker_class(worker, **opts)
end

Public Instance Methods

bin_path() click to toggle source
# File lib/luban/deployment/cli/package/worker.rb, line 73
def bin_path
  @bin_path ||= install_path.join('bin')
end
child?() click to toggle source
# File lib/luban/deployment/cli/package/worker.rb, line 51
def child?; !parent.nil?; end
current_bin_path() click to toggle source
# File lib/luban/deployment/cli/package/worker.rb, line 57
def current_bin_path
  @current_bin_path ||= current_path.join('bin')
end
current_path() click to toggle source
# File lib/luban/deployment/cli/package/worker.rb, line 53
def current_path
  @current_path ||= app_path.join(package_name)
end
install_path() click to toggle source
# File lib/luban/deployment/cli/package/worker.rb, line 69
def install_path
  @install_path ||= package_versions_path.join(package_version)
end
package_downloads_path() click to toggle source
# File lib/luban/deployment/cli/package/worker.rb, line 81
def package_downloads_path
  @package_downloads_path ||= downloads_path.join(package_name)
end
package_path() click to toggle source
# File lib/luban/deployment/cli/package/worker.rb, line 61
def package_path
  @package_path ||= packages_path.join(package_name)
end
package_tmp_path() click to toggle source
# File lib/luban/deployment/cli/package/worker.rb, line 77
def package_tmp_path
  @package_tmp_path ||= package_path.join('tmp')
end
package_versions_path() click to toggle source
# File lib/luban/deployment/cli/package/worker.rb, line 65
def package_versions_path
  @package_versions_path ||= package_path.join('versions')
end
parent() click to toggle source
# File lib/luban/deployment/cli/package/worker.rb, line 50
def parent; task.opts.parent; end