lib/byebug/commands/pry.rb



module Byebug
  #
  # Enter Pry from byebug's prompt
  #
  class PryCommand < Command
    def regexp
      /^\s* pry \s*$/x
    end

    def execute
      unless @state.interface.is_a?(LocalInterface)
        return errmsg('Command is available only in local mode.')
      end

      get_binding.pry
    end

    class << self
      def names
        %w(pry)
      end

      def description
        %(pry        Starts a Pry session.)
      end
    end
  end
end if defined?(Pry)