Class: CSD::UserInterface::CLI
Instance Method Summary (collapse)
-
- (Boolean) continue?
Be careful, this function writes to STDOUT and not to $stdout.
- - (Object) debug(message)
- - (Object) error(message)
- - (Object) indicate_activity
- - (Object) info(message)
- - (Object) separator
- - (Object) warn(message)
Methods inherited from Base
Instance Method Details
- (Boolean) continue?
Be careful, this function writes to STDOUT and not to $stdout. In other words, the output cannot be hidden from the end-user, and thus, for example, not be properly tested in the test suite. ask_yes_no is provided by Gem::UserInteraction.
23 24 25 |
# File 'lib/csd/user_interface/cli.rb', line 23 def continue? ask_yes_no("Continue?".red.bold, true) end |
- (Object) debug(message)
27 28 29 |
# File 'lib/csd/user_interface/cli.rb', line 27 def debug() $stdout.puts "DEBUG: #{}".magenta if Options.debug end |
- (Object) error(message)
39 40 41 |
# File 'lib/csd/user_interface/cli.rb', line 39 def error() $stderr.puts('ERROR: '.red.blink + .red) end |
- (Object) indicate_activity
14 15 16 17 |
# File 'lib/csd/user_interface/cli.rb', line 14 def indicate_activity $stdout.putc '.' $stdout.flush end |
- (Object) info(message)
31 32 33 |
# File 'lib/csd/user_interface/cli.rb', line 31 def info() $stdout.puts end |
- (Object) separator
10 11 12 |
# File 'lib/csd/user_interface/cli.rb', line 10 def separator $stdout.puts end |
- (Object) warn(message)
35 36 37 |
# File 'lib/csd/user_interface/cli.rb', line 35 def warn() $stdout.puts 'NOTE: '.red + .red end |