Module: Thor::Shell
- Defined in:
- lib/vendor/thor/lib/thor/shell.rb,
 lib/vendor/thor/lib/thor/shell/html.rb,
 lib/vendor/thor/lib/thor/shell/basic.rb,
 lib/vendor/thor/lib/thor/shell/color.rb
Defined Under Namespace
Constant Summary collapse
- SHELL_DELEGATED_METHODS =
- [:ask, :error, :set_color, :yes?, :no?, :say, :say_status, :print_in_columns, :print_table, :print_wrapped, :file_collision, :terminal_width] 
Instance Method Summary collapse
- 
  
    
      #initialize(args = [], options = {}, config = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Add shell to initialize config values. 
- 
  
    
      #shell  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Holds the shell for the given Thor instance. 
- 
  
    
      #shell=(shell)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Sets the shell for this thor class. 
- 
  
    
      #with_padding  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Yields the given block with padding. 
Instance Method Details
#initialize(args = [], options = {}, config = {}) ⇒ Object
| 45 46 47 48 49 | # File 'lib/vendor/thor/lib/thor/shell.rb', line 45 def initialize(args=[], ={}, config={}) super self.shell = config[:shell] self.shell.base ||= self if self.shell.respond_to?(:base) end | 
#shell ⇒ Object
Holds the shell for the given Thor instance. If no shell is given, it gets a default shell from Thor::Base.shell.
| 53 54 55 | # File 'lib/vendor/thor/lib/thor/shell.rb', line 53 def shell @shell ||= Thor::Base.shell.new end | 
#shell=(shell) ⇒ Object
Sets the shell for this thor class.
| 58 59 60 | # File 'lib/vendor/thor/lib/thor/shell.rb', line 58 def shell=(shell) @shell = shell end | 
#with_padding ⇒ Object
Yields the given block with padding.
| 72 73 74 75 76 77 | # File 'lib/vendor/thor/lib/thor/shell.rb', line 72 def with_padding shell.padding += 1 yield ensure shell.padding -= 1 end |