Class: Thor::Shell::Basic

Inherits:
Object
  • Object
show all
Defined in:
lib/thor/shell/basic.rb

Instance Method Summary collapse

Instance Method Details

#ask(statement, *args) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/thor/shell/basic.rb', line 7

def ask(statement, *args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  color = args.pop
  default = options[:default]
  if options[:limited_to] 
    ask_filtered(statement, options[:limited_to], color, default)
  else
    ask_simply(statement, color, default)
  end
end

#yes?(statement, *args) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/thor/shell/basic.rb', line 18

def yes?(statement, *args)
  !!(ask(statement, *args) =~ is?(:yes))
end