Sha256: 1093dd04605e235f8a3636f15084cda9e52c5f24bcd199b72859b2625468db1f

Contents?: true

Size: 1.09 KB

Versions: 17

Compression:

Stored size: 1.09 KB

Contents

module Debugger

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

    # An input line is matched against this regular expression. If we have
    # a match, run this command.
    def regexp
      / ^\s*
         (?:q(?:uit)?|exit) \s*
         (!|\s+unconditionally)? \s*
         $
      /ix
    end

    # The code that implements this command.
    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
      # The command name listed via 'help'
      def help_command
        %w[quit exit]
      end

      # Returns a String given the help description of this command
      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

17 entries across 17 versions & 3 rubygems

Version Path
ruby-debug-0.10.5.rc9 cli/ruby-debug/commands/quit.rb
ruby-debug-0.10.5.rc8 cli/ruby-debug/commands/quit.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/quit.rb
ruby-debug-0.10.5.rc7 cli/ruby-debug/commands/quit.rb
ruby-debug-0.10.5.rc5 cli/ruby-debug/commands/quit.rb
ruby-debug-0.10.5.rc4 cli/ruby-debug/commands/quit.rb
ruby-debug-0.10.5.rc3 cli/ruby-debug/commands/quit.rb
ruby-debug-0.10.5.rc2 cli/ruby-debug/commands/quit.rb
ruby-debug-0.10.5.rc1 cli/ruby-debug/commands/quit.rb
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/quit.rb
vim-jar-0.1.2 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/quit.rb
vim-jar-0.1.1 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/quit.rb
vim-jar-0.1.0 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/quit.rb
vim-jar-0.0.3 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/quit.rb
vim-jar-0.0.2 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/quit.rb
vim-jar-0.0.1 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/quit.rb
ruby-debug-0.10.4 cli/ruby-debug/commands/quit.rb