Sha256: 61c873c77c6e5763e18abea59bd75da47749f300c123b019bb75c4e2cbf7a43b
Contents?: true
Size: 796 Bytes
Versions: 24
Compression:
Stored size: 796 Bytes
Contents
module Beet module Interaction # Get a user's input # # ==== Example # # answer = ask("Should I freeze the latest Rails?") # freeze! if ask("Should I freeze the latest Rails?") == "yes" # def ask(string) log '', string print '> ' STDIN.gets.strip end # Helper to test if the user says yes(y)? # # ==== Example # # freeze! if yes?("Should I freeze the latest Rails?") # def yes?(question) answer = ask(question).downcase answer == "y" || answer == "yes" end # Helper to test if the user does NOT say yes(y)? # # ==== Example # # capify! if no?("Will you be using vlad to deploy your application?") # def no?(question) !yes?(question) end end end
Version data entries
24 entries across 24 versions & 2 rubygems