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

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

Constant Summary

Constants included from Command::Tasks::Control

Command::Tasks::Control::Actions

Constants included from Command::Tasks::Install

Command::Tasks::Install::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::Control

#controllable?, #process_monitor_via

Methods inherited from Package::Base

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

Methods included from Command::Tasks::Install

#installable?

Methods included from Parameters::Base

#parameter

Methods inherited from Command

#base_templates_path, #controllable?, #default_templates, default_worker_class, #deployable?, dispatch_task, #display_name, #installable?, #run_task, #task, worker_class

Methods included from Parameters::General

included

Methods included from Helpers::Configuration

#ask, #default_templates_paths, #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



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

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



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

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

#orig_init_profileObject



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

alias_method :orig_init_profile, :init_profile