class CfScript::Command::Apps::PushCommand

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/push.rb, line 19
def initialize
  super(:apps, :push)
end

Public Instance Methods

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

    no_start = options.key?(:flags) &&
               options[:flags].include?(:no_start)

    if no_start && output.ok?
      return true
    elsif app = build_app_info(app_name, output)
      block_given? ? yield(app) : app
    else
      error "app is nil"
    end
  end
end
translate_options(options) click to toggle source
# File lib/cf_script/command/cf/apps/push.rb, line 40
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