Method: CF::App::Create#map_route

Defined in:
lib/cf/cli/app/push/create.rb

#map_route(app) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/cf/cli/app/push/create.rb', line 42

def map_route(app)
  line unless quiet?

  host = input[:host, app.name]
  finalize
  domain = input[:domain, app]
  finalize

  mapped_url = false
  until domain == "none" || !domain || mapped_url
    begin
      host = "" if host == "none"
      invoke :map, :app => app, :host => host, :domain => domain
      mapped_url = true
    rescue CFoundry::RouteHostTaken, CFoundry::UriAlreadyTaken => e
      raise if force?

      line c(e.description, :bad)
      line

      input.forget(:host)
      input.forget(:domain)

      host = input[:host, app.name]
      domain = input[:domain, app]
    end
  end
end