Top Level Namespace

Defined Under Namespace

Modules: StringExtensions Classes: String

Instance Method Summary collapse

Instance Method Details

#ask(question) ⇒ Object



26
27
28
29
30
31
# File 'lib/funkenplate.rb', line 26

def ask(question)
  puts
  say_status :QUESTION, question, :blue
  print ' ' * 16
  $stdin.gets.strip
end

#shout_status(*args) ⇒ Object



20
21
22
23
24
# File 'lib/funkenplate.rb', line 20

def shout_status(*args)
  puts
  say_status(*args)
  puts
end

#yes?(question) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
36
37
# File 'lib/funkenplate.rb', line 33

def yes?(question)
  answer = ask("#{question} (ENTER: yes)").downcase
  puts
  answer == '' or answer == "\n" or answer == 'y' or answer == 'yes' or answer == 'j' or answer == 'ja'
end