Inherit from Thor::Shell::Basic and add set_color behavior. Check Thor::Shell::Basic to see all available methods.
The start of an HTML bold sequence.
The end of an HTML bold sequence.
Embed in a String to clear previous color selection.
Set the terminal’s foreground HTML color to black.
Set the terminal’s foreground HTML color to red.
Set the terminal’s foreground HTML color to green.
Set the terminal’s foreground HTML color to yellow.
Set the terminal’s foreground HTML color to blue.
Set the terminal’s foreground HTML color to magenta.
Set the terminal’s foreground HTML color to cyan.
Set the terminal’s foreground HTML color to white.
Set the terminal’s background HTML color to black.
Set the terminal’s background HTML color to red.
Set the terminal’s background HTML color to green.
Set the terminal’s background HTML color to yellow.
Set the terminal’s background HTML color to blue.
Set the terminal’s background HTML color to magenta.
Set the terminal’s background HTML color to cyan.
Set the terminal’s background HTML color to white.
Ask something to the user and receives a response.
ask(“What is your name?”)
TODO: Implement ask for Thor::Shell::HTML
# File lib/bundler/vendor/thor/shell/html.rb, line 68 68: def ask(statement, color=nil) 69: raise NotImplementedError, "Implement #ask for Thor::Shell::HTML" 70: end
Set color by using a string or one of the defined constants. If a third option is set to true, it also adds bold to the string. This is based on Highline implementation and it automatically appends CLEAR to the end of the returned String.
# File lib/bundler/vendor/thor/shell/html.rb, line 56 56: def set_color(string, color, bold=false) 57: color = self.class.const_get(color.to_s.upcase) if color.is_a?(Symbol) 58: bold, end_bold = bold ? [BOLD, END_BOLD] : ['', ''] 59: "#{bold}#{color}#{string}#{CLEAR}#{end_bold}" 60: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.