Sha256: 2638c7b09622a191f5630188afe4562f051de2db5a7bf29b3c371b8c05438d65

Contents?: true

Size: 836 Bytes

Versions: 1

Compression:

Stored size: 836 Bytes

Contents

# frozen_string_literal: true

module RubyJard
  module Commands
    # Command used to exit program execution.
    class ExitCommand < Pry::ClassCommand
      group 'RubyJard'
      description 'Exit program execution.'

      match 'exit'

      banner <<-BANNER
      Usage: exit
      Examples:
        exit

      Exit the execution of the program. Interally, when `jard` receives this command, it removes all debugging hooks, and triggers `::Kernel.exit`. Some long-running processes like `puma` or `sidekiq` may capture this event, treat it as an error, and recover to keep the processes running. In such cases, it's recommended to use `continue` command instead.
      BANNER

      def process
        RubyJard::ControlFlow.dispatch(:exit)
      end
    end
  end
end

Pry::Commands.add_command(RubyJard::Commands::ExitCommand)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby_jard-0.3.1 lib/ruby_jard/commands/exit_command.rb