Module: Afterlife::BaseCli
- Included in:
- Cdn::Cli, Cli, Config::Cli, Deploy::Cli, Release::Cli
- Defined in:
- lib/afterlife/base_cli.rb
Instance Method Summary collapse
- #fatal!(msg) ⇒ Object
- #log_error(message) ⇒ Object
- #log_info(message) ⇒ Object
- #log_interrupted ⇒ Object
- #log_success(message) ⇒ Object
- #sure?(msg) ⇒ Boolean
Instance Method Details
#fatal!(msg) ⇒ Object
34 35 36 37 |
# File 'lib/afterlife/base_cli.rb', line 34 def fatal!(msg) log_error "ERROR: #{msg}" exit 1 end |
#log_error(message) ⇒ Object
12 13 14 15 |
# File 'lib/afterlife/base_cli.rb', line 12 def log_error() say set_color(, :red) say "\n" end |
#log_info(message) ⇒ Object
17 18 19 20 |
# File 'lib/afterlife/base_cli.rb', line 17 def log_info() say set_color(, :cyan) say "\n" end |
#log_interrupted ⇒ Object
22 23 24 25 |
# File 'lib/afterlife/base_cli.rb', line 22 def log_interrupted say '' fatal! 'Interrupted' end |
#log_success(message) ⇒ Object
7 8 9 10 |
# File 'lib/afterlife/base_cli.rb', line 7 def log_success() say set_color(, :green) say "\n" end |
#sure?(msg) ⇒ Boolean
27 28 29 30 31 32 |
# File 'lib/afterlife/base_cli.rb', line 27 def sure?(msg) say msg return true if yes?('Are you sure? [y/n]') fatal! 'Good bye' end |