class CfScript::Command::Apps::ScaleCommand

Constants

LONG_OPTIONS_MAP

Public Class Methods

new() click to toggle source
Calls superclass method CfScript::Command::Base::new
# File lib/cf_script/command/cf/apps/scale.rb, line 10
def initialize
  super(:apps, :scale)
end

Public Instance Methods

run(app_name, options = {}) { |true| ... } click to toggle source
# File lib/cf_script/command/cf/apps/scale.rb, line 14
def run(app_name, options = {}, &block)
  run_cf self, app_name, translate_options(options) do |output|
    return unless good_run?(output, check_failed: false)

    if output.ok?
      block_given? ? yield(true) : true
    else
      error "failed to scale app"
      return false
    end
  end
end
translate_options(options) click to toggle source
# File lib/cf_script/command/cf/apps/scale.rb, line 27
def translate_options(options)
  opts = options.dup

  LONG_OPTIONS_MAP.each do |long, short|
    if opts.key?(long)
      opts[short] = opts.delete(long)
    end
  end

  opts
end