Module Rudy::Routines::Handlers::Base

  1. lib/rudy/routines/handlers/base.rb

Methods

public instance

  1. keep_going?
  2. trap_rbox_errors

Included modules

  1. Rudy::Huxtable

Public instance methods

keep_going? ()
[show source]
    # File lib/rudy/routines/handlers/base.rb, line 31
31:    def keep_going?
32:      Annoy.pose_question("  Keep going?\a ", /yes|y|ya|sure|you bet!/i, STDERR)
33:    end
trap_rbox_errors (ret=nil, &command)
[show source]
    # File lib/rudy/routines/handlers/base.rb, line 7
 7:    def trap_rbox_errors(ret=nil, &command)
 8:      begin
 9:        ret = command.call if command
10:        return unless ret.is_a?(Rye::Rap)
11:        li '  ' << ret.stdout.join("#{$/}  ") if !ret.stdout.empty?
12:        print_response(ret)
13:      rescue IOError => ex
14:        le "  Connection Error (#{ex.message})".color(:red)
15:        choice = Annoy.get_user_input('(S)kip  (R)etry  (F)orce  (A)bort: ', nil, 3600) || ''
16:         if choice.match(/\AS/i)
17:           return
18:         elsif choice.match(/\AR/i)
19:           retry
20:         elsif choice.match(/\AF/i)
21:           @@global.force = true
22:           retry
23:         else
24:           exit 12
25:         end
26:      end
27:      
28:      ret
29:    end