Methods

Class Index [+]

Quicksearch

Thor::Shell::HTML

Inherit from Thor::Shell::Basic and add set_color behavior. Check Thor::Shell::Basic to see all available methods.

Constants

BOLD

The start of an HTML bold sequence.

END_BOLD

The end of an HTML bold sequence.

CLEAR

Embed in a String to clear previous color selection.

BLACK

Set the terminal’s foreground HTML color to black.

RED

Set the terminal’s foreground HTML color to red.

GREEN

Set the terminal’s foreground HTML color to green.

YELLOW

Set the terminal’s foreground HTML color to yellow.

BLUE

Set the terminal’s foreground HTML color to blue.

MAGENTA

Set the terminal’s foreground HTML color to magenta.

CYAN

Set the terminal’s foreground HTML color to cyan.

WHITE

Set the terminal’s foreground HTML color to white.

ON_BLACK

Set the terminal’s background HTML color to black.

ON_RED

Set the terminal’s background HTML color to red.

ON_GREEN

Set the terminal’s background HTML color to green.

ON_YELLOW

Set the terminal’s background HTML color to yellow.

ON_BLUE

Set the terminal’s background HTML color to blue.

ON_MAGENTA

Set the terminal’s background HTML color to magenta.

ON_CYAN

Set the terminal’s background HTML color to cyan.

ON_WHITE

Set the terminal’s background HTML color to white.

Public Instance Methods

ask(statement, color=nil) click to toggle source

Ask something to the user and receives a response.

Example

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(string, color, bold=false) click to toggle source

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.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.