summaryrefslogtreecommitdiff
path: root/lib/irb/command/force_exit.rb
blob: c2c5542e2490f7b00a9a7142bf349cc106ec60aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

module IRB
  # :stopdoc:

  module Command
    class ForceExit < Base
      category "IRB"
      description "Exit the current process."

      def execute(*)
        throw :IRB_EXIT, true
      rescue UncaughtThrowError
        Kernel.exit!
      end
    end
  end

  # :startdoc:
end