# File lib/cheat.rb, line 113 def execute(sheet_yaml) sheet_body = YAML.load(sheet_yaml).to_a.flatten.last puts "\n " + sheet_body.gsub("\r",'').gsub("\n", "\n ").wrap puts "\nWould you like to execute the above sheet? (Y/N)" answer = STDIN.gets case answer.chomp when "Y" then system YAML.load(sheet_yaml).to_a.flatten.last when "N" then puts "Not executing sheet." else puts "Must be Y or N!" end rescue Errno::EPIPE # do nothing rescue puts "That didn't work. Maybe try `$ cheat cheat' for help?" # Fix Emacs ruby-mode highlighting bug: `" end