Class: CfScript::Command::Routes::MapRouteCommand
- Defined in:
- lib/cf_script/command/cf/routes/map_route.rb
Constant Summary
Constants included from UI
UI::COLORS, UI::EMOJI, UI::TAGS
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize ⇒ MapRouteCommand
constructor
A new instance of MapRouteCommand.
- #run(app_name, domain, host = nil, &block) ⇒ Object
Methods inherited from Base
#good_run?, #line, #option_value
Methods included from UI::NameTag
#alert, #detail, #error, #info, #name_tag, #progress, #step, #success, #title
Methods included from UI
alert, call_type, debug, detail, emoji, emoji_for, error, info, print_err, print_out, progress, puts_err, puts_out, step, success, tag_char, tag_close, tag_color, tag_format, tag_open, tag_style, title, trace, ui_format, with_color_of
Methods included from CfScript::Command::Runner
cf_bin, cf_env, cf_id, cf_in_env?, cf_in_path?, cf_path, cf_version, run_cf, which_cf
Constructor Details
#initialize ⇒ MapRouteCommand
Returns a new instance of MapRouteCommand.
3 4 5 |
# File 'lib/cf_script/command/cf/routes/map_route.rb', line 3 def initialize super(:routes, :map_route) end |
Instance Method Details
#run(app_name, domain, host = nil, &block) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/cf_script/command/cf/routes/map_route.rb', line 7 def run(app_name, domain, host = nil, &block) = host ? { n: host } : {} run_cf self, app_name, domain, 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 |