Sha256: 96752dad7c0e6f16a0367fe570d36ff7152e32dc8bdb147a293ea1d08e276e9d

Contents?: true

Size: 951 Bytes

Versions: 20

Compression:

Stored size: 951 Bytes

Contents

module Debugger

  # Implements debugger "kill" command
  class KillCommand < Command
    self.allow_in_control = true

    def regexp
      / ^\s*
         (?:kill) \s*
         (?:\s+(\S+))?\s*
         $
      /ix
    end

    def execute
      if @match[1] 
        signame = @match[1]
        unless Signal.list.member?(signame)
          errmsg("signal name #{signame} is not a signal I know about\n")
          return false
        end
        if 'KILL' == signame
            @state.interface.finalize
        end
      else
        if not confirm("Really kill? (y/n) ")
          return
        else 
          signame = 'KILL'
        end
      end
      Process.kill(signame, Process.pid)
    end

    class << self
      def help_command
        %w[kill]
      end

      def help(cmd)
        %{
          kill [SIGNAL]

          Send [signal] to Process.pid
Equivalent of Process.kill(Process.pid)
         }
     end
    end
  end
end

Version data entries

20 entries across 20 versions & 4 rubygems

Version Path
ruby-debug-0.11.0 cli/ruby-debug/commands/kill.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/ruby-debug-0.10.6/cli/ruby-debug/commands/kill.rb
ruby-debug-0.10.6 cli/ruby-debug/commands/kill.rb
ruby-debug-0.10.5.rc9 cli/ruby-debug/commands/kill.rb
ruby-debug-0.10.5.rc8 cli/ruby-debug/commands/kill.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/kill.rb
ruby-debug-0.10.5.rc7 cli/ruby-debug/commands/kill.rb
ruby-debug-0.10.5.rc5 cli/ruby-debug/commands/kill.rb
ruby-debug-0.10.5.rc4 cli/ruby-debug/commands/kill.rb
ruby-debug-0.10.5.rc3 cli/ruby-debug/commands/kill.rb
ruby-debug-0.10.5.rc2 cli/ruby-debug/commands/kill.rb
ruby-debug-0.10.5.rc1 cli/ruby-debug/commands/kill.rb
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/kill.rb
vim-jar-0.1.2 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/kill.rb
vim-jar-0.1.1 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/kill.rb
vim-jar-0.1.0 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/kill.rb
vim-jar-0.0.3 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/kill.rb
vim-jar-0.0.2 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/kill.rb
vim-jar-0.0.1 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/kill.rb
ruby-debug-0.10.4 cli/ruby-debug/commands/kill.rb