class CfScript::Command::Routes::MapRouteCommand

Public Class Methods

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

Public Instance Methods

run(app_name, domain, host = nil) { |mapped| ... } click to toggle source
# File lib/cf_script/command/cf/routes/map_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 mapped = output.ok?
      block_given? ? yield(mapped) : mapped
    else
      if output.failed?
        error output.last_line
      else
        error 'failed to map route'
      end

      return false
    end
  end
end