Sha256: b02a3ff65bab9c54661c38851dc11f9e127d1575d2f4286374bc8940d1f0a029

Contents?: true

Size: 878 Bytes

Versions: 1

Compression:

Stored size: 878 Bytes

Contents

# frozen_string_literal: true

module RubyJard
  module Commands
    # Command used to explore stacktrace.
    # Data attached in the throw:
    # * command: constant symbol (:frame)
    # * pry: current context pry instance
    # * frame (optional): frame id of the destination frame
    class FrameCommand < Pry::ClassCommand
      group 'RubyJard'
      description 'Explore to any frame of current stacktrace.'

      match 'frame'

      banner <<-BANNER
      Usage: frame

      Explore to any frame of current stacktrace.

      Examples:
        frame [FRAME_ID]
      BANNER

      def process
        throw :control_flow,
              command: :frame,
              pry: pry_instance,
              # TODO: Remove redundant options
              options: { frame: args.first }
      end
    end
  end
end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby_jard-0.1.0 lib/ruby_jard/commands/frame_command.rb