28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/shell/shell.rb', line 28
def self.yesno message
STDOUT.flush
has_result = false
while has_result == false
print message.strip + " "
input = STDIN.gets.strip
if input == "yes" or input == "y" then
final_input = "yes"
elsif input == "no" or input == "n" then
final_input = "no"
end
if ( final_input == "yes" or final_input == "no" )
has_result = true
end
end
if final_input == "yes"
result = true
else
result = false
end
result
end
|