class Luban::Deployment::Service::Base

Attributes

parameters[R]

Public Class Methods

inherited(subclass) click to toggle source
# File lib/luban/deployment/cli/service/base.rb, line 9
def inherited(subclass)
  super
  # Ensure parameters from base class
  # got inherited to its subclasses
  params = instance_variable_get('@parameters')
  subclass.instance_variable_set('@parameters', params.nil? ? {} : params.clone)
end
parameter(param, default: nil) click to toggle source
Calls superclass method
# File lib/luban/deployment/cli/service/base.rb, line 19
def parameter(param, default: nil)
  super
  parameters[param] = default
end
service_action(action, dispatch_to: nil, as: action, locally: false, &blk) click to toggle source
# File lib/luban/deployment/cli/service/base.rb, line 24
def 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

Public Instance Methods

init_profile(args:, opts:) click to toggle source
# File lib/luban/deployment/cli/service/base.rb, line 49
def init_profile(args:, opts:)
  orig_init_profile(args: args, opts: opts.merge(default_templates: default_templates))
end
Also aliased as: orig_init_profile
orig_init_profile(args:, opts:)
Alias for: init_profile