Sha256: 6628948c1c348aef7c4a3e5bcdc940f5c6210766445c76abc38fea293a01fb47

Contents?: true

Size: 856 Bytes

Versions: 4

Compression:

Stored size: 856 Bytes

Contents

module Debugger

  # Implements debugger "quit" command
  class QuitCommand < Command
    self.allow_in_control = true

    def regexp
      / ^\s*
         (?:q(?:uit)?|exit) \s*
         (!|\s+unconditionally)? \s*
         $
      /ix
    end

    def execute
      if @match[1] or confirm("Really quit? (y/n) ") 
        @state.interface.finalize
        exit! # exit -> exit!: No graceful way to stop threads...
      end
    end

    class << self
      def help_command
        %w[quit exit]
      end

      def help(cmd)
        %{
          q[uit] [!|unconditionally]\texit from debugger. 
          exit[!]\talias to quit

          Normally we prompt before exiting. However if the parameter
          "unconditionally" or is given or suffixed with !, we stop
          without asking further questions.  
         }
     end
    end
  end
end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
ruby-debug193-0.0.1 cli/ruby-debug/commands/quit.rb
vanity-1.7.1 vendor/ruby/1.9.1/gems/ruby-debug19-0.11.6/cli/ruby-debug/commands/quit.rb
ruby-debug19-0.11.6 cli/ruby-debug/commands/quit.rb
ruby-debug19-0.11.5 cli/ruby-debug/commands/quit.rb