Module: Thor::Shell
- Defined in:
- lib/thor/shell.rb,
lib/thor/shell/html.rb,
lib/thor/shell/basic.rb,
lib/thor/shell/color.rb,
lib/thor/shell/terminal.rb,
lib/thor/shell/table_printer.rb,
lib/thor/shell/column_printer.rb,
lib/thor/shell/wrapped_printer.rb
Defined Under Namespace
Modules: Terminal Classes: Basic, Color, ColumnPrinter, HTML, TablePrinter, WrappedPrinter
Constant Summary collapse
- SHELL_DELEGATED_METHODS =
[:ask, :error, :set_color, :yes?, :no?, :say, :say_error, :say_status, :print_in_columns, :print_table, :print_wrapped, :file_collision, :terminal_width]
Instance Attribute Summary collapse
-
#shell ⇒ Object
Holds the shell for the given Thor instance.
Instance Method Summary collapse
-
#initialize(args = [], options = {}, config = {}) ⇒ Object
Add shell to initialize config values.
-
#with_padding ⇒ Object
Yields the given block with padding.
Instance Attribute Details
Instance Method Details
#initialize(args = [], options = {}, config = {}) ⇒ Object
44 45 46 47 48 |
# File 'lib/thor/shell.rb', line 44 def initialize(args = [], = {}, config = {}) super self.shell = config[:shell] shell.base ||= self if shell.respond_to?(:base) end |
#with_padding ⇒ Object
Yields the given block with padding.
66 67 68 69 70 71 |
# File 'lib/thor/shell.rb', line 66 def with_padding shell.padding += 1 yield ensure shell.padding -= 1 end |