lib/cuker/high.rb in cuker-0.3.15 vs lib/cuker/high.rb in cuker-0.3.17

- old
+ new

@@ -1,57 +1,62 @@ +# require 'cuker' # require 'highline' # -# # Basic usage +# CCC = Cuker::CukerCmd.new +# CLI = HighLine.new # -# cli = HighLine.new -# answer = cli.ask "What do you think?" -# puts "You have answered: #{answer}" +# DEFAULT_REPORT_FILE_NAME = 'DEFAULT_REPORT_NAME' +# # DEFAULT_FEATURES_PATH = "../../features/uat/gcm/jira_stories/" +# DEFAULT_FEATURES_PATH = "." +# # DEFAULT_REPORT_PATH = './reports' # +# def ask_for_input_location +# loc = CLI.ask "\nType your JIRA number:\n" +# File.join DEFAULT_FEATURES_PATH, '**', loc +# end # -# # Default answer +# def ask_for_output_file_name +# name = CLI.ask "\nType your report file name: \n[hit enter to use default name => '#{DEFAULT_REPORT_FILE_NAME}']\n" +# name.empty? ? DEFAULT_REPORT_FILE_NAME : name +# end # -# cli.ask("Company? ") { |q| q.default = "none" } +# def handle_call preset +# begin +# feat_path = ask_for_input_location +# report_name = ask_for_output_file_name +# file_name = CCC.report preset, report_name, feat_path +# CLI.say("\n\nCreated '#{preset}' @ '#{file_name}' ... Enjoy!\n") if file_name +# rescue Exception +# puts "An Error occured\nplease contact NarenSS (v675166) for more details\n" +# puts e +# end +# end # +# def exit_message +# CLI.say("Thank you for using Cuker :)\nFeel free to reach out to NarenSS (v675166) for any feature request\nHave a very good day!") +# exit +# end # -# # Validation +# loop do +# # Menus: +# CLI.say("\nREPORT_NUMBERS:\n") +# CLI.choose do |menu| +# menu.prompt = "\n\nType the REPORT_NUMBER you want to generate?\n" # -# cli.ask("Age? ", Integer) { |q| q.in = 0..105 } -# cli.ask("Name? (last, first) ") { |q| q.validate = /\A\w+, ?\w+\Z/ } +# presets = Cuker::CukerCmd::PRESETS # +# presets.keys.each do |option| +# menu.choice(option) do +# handle_call option +# end +# end # -# # Type conversion for answers: +# menu.choice(:quit) {exit_message} +# menu.default = :quit +# end # -# cli.ask("Birthday? ", Date) -# cli.ask("Interests? (comma sep list) ", lambda { |str| str.split(/,\s*/) }) -# -# -# # Reading passwords: -# -# cli.ask("Enter your password: ") { |q| q.echo = false } -# cli.ask("Enter your password: ") { |q| q.echo = "x" } -# -# -# # ERb based output (with HighLine's ANSI color tools): -# -# cli.say("This should be <%= color('bold', BOLD) %>!") -# -# -# # Menus: -# -# cli.choose do |menu| -# menu.prompt = "Please choose your favorite programming language? " -# menu.choice(:ruby) { cli.say("Good choice!") } -# menu.choices(:python, :perl) { cli.say("Not from around here, are you?") } -# menu.default = :ruby +# answer = CLI.ask "\nWant to rerun? \n[ type anything and hit enter to rerun\nor just hit enter to quit this program ]\n" +# break if answer.empty? +# puts "\n... rebooting ...\n\n" # end # -# ## Using colored indices on Menus -# -# HighLine::Menu.index_color = :rgb_77bbff # set default index color -# -# cli.choose do |menu| -# menu.index_color = :rgb_999999 # override default color of index -# # you can also use constants like :blue -# menu.prompt = "Please choose your favorite programming language? " -# menu.choice(:ruby) { cli.say("Good choice!") } -# menu.choices(:python, :perl) { cli.say("Not from around here, are you?") } -# end +# exit_message \ No newline at end of file