class CfScript::Command::Routes::UnmapRouteCommand

Public Class Methods

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

Public Instance Methods

run(app_name, domain, host = nil) { |unmapped| ... } click to toggle source
# File lib/cf_script/command/cf/routes/unmap_route.rb, line 7
def run(app_name, domain, host = nil, &block)
  options = host ? { n: host } : {}

  run_cf self, app_name, domain, options do |output|
    return false unless good_run?(output,
      check_status: false,
      check_failed: false,
    )

    if output.good? and unmapped = output.ok?
      block_given? ? yield(unmapped) : unmapped
    else
      if output.failed?
        error output.last_line
      else
        error 'failed to unmap route'
      end

      return false
    end
  end
end