Class: Luban::Deployment::Service::Base

Inherits:
Package::Base show all
Includes:
Command::Tasks::Control, Command::Tasks::Monitor
Defined in:
lib/luban/deployment/cli/service/base.rb

Constant Summary

Constants included from Command::Tasks::Monitor

Command::Tasks::Monitor::Actions

Constants included from Command::Tasks::Control

Command::Tasks::Control::Actions

Constants included from Command::Tasks::Provision

Command::Tasks::Provision::Actions

Constants included from Parameters::General

Parameters::General::DefaultLubanRootPath

Instance Attribute Summary

Attributes inherited from Package::Base

#current_version

Attributes included from Helpers::Configuration

#config

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Command::Tasks::Monitor

#monitor_tasks, #monitorable?

Methods included from Command::Tasks::Control

#control_tasks, #controllable?

Methods inherited from Package::Base

apply_to, #binstubs, #cleanup, decompose_version, dependencies, #find_application, #find_project, get_latest_version, #has_version?, inherited, #install, #install_all, latest_version, #monitorable?, package_class, #package_options, required_packages_for, #show_current, #show_summary, #uninstall, #uninstall!, #uninstall_all, #update_package_options, version_mutex, #versions, #whence, #which, worker_class

Methods included from Command::Tasks::Provision

#provision_tasks, #provisionable?

Methods included from Parameters::Application

#env_name, #monitor_itself?, #monitorable?

Methods included from Parameters::Base

#parameter

Methods included from Parameters::Project

#monitor_defined?, #process_monitor_via

Methods inherited from Command

#base_templates_path, #controllable?, #default_templates, #default_templates_paths, default_worker_class, #deployable?, dispatch_task, #display_name, inherited, #monitorable?, #provisionable?, #run_task, worker_class

Methods included from Parameters::General

included

Methods included from Helpers::Configuration

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

Class Method Details

.service_action(action, dispatch_to: nil, as: action, locally: false, &blk) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/luban/deployment/cli/service/base.rb', line 8

def self.service_action(action, dispatch_to: nil, as: action, locally: false, &blk)
  define_method(action) do |args:, opts:|
    if current_version
      send("#{__method__}!", args: args, opts: opts.merge(version: current_version))
    else
      abort "Aborted! No current version of #{display_name} is specified."
    end
  end
  unless dispatch_to.nil?
    dispatch_task "#{action}!", to: dispatch_to, as: as, locally: locally, &blk
    protected "#{action}!"
  end
end

Instance Method Details

#init_profile(args:, opts:) ⇒ Object



32
33
34
# File 'lib/luban/deployment/cli/service/base.rb', line 32

def init_profile(args:, opts:)
  orig_init_profile(args: args, opts: opts.merge(default_templates: default_templates))
end

#orig_init_profileObject



30
# File 'lib/luban/deployment/cli/service/base.rb', line 30

alias_method :orig_init_profile, :init_profile