Sha256: 00e94fe69194716bd6250dab60d6a4beef29c8d5e53027fa3c549f430b993b46

Contents?: true

Size: 793 Bytes

Versions: 3

Compression:

Stored size: 793 Bytes

Contents

# frozen_string_literal: true

module RubyJard
  module Commands
    # Command used to Step into the execution of the current line.
    class StepCommand < Pry::ClassCommand
      include RubyJard::Commands::ValidationHelpers

      group 'RubyJard'
      description 'Step into the execution of the current line'

      match 'step'

      banner <<-BANNER
        Usage: step [times]
        Examples:
          step
          step 1
          step 7

        Step into the execution of the current line.
      BANNER

      def process
        times = validate_positive_integer!(args.first || 1)

        RubyJard::ControlFlow.dispatch(:step, times: times.to_i)
      end
    end
  end
end

Pry::Commands.add_command(RubyJard::Commands::StepCommand)
Pry::Commands.alias_command 's', 'step'

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby_jard-0.3.1 lib/ruby_jard/commands/step_command.rb
ruby_jard-0.3.0 lib/ruby_jard/commands/step_command.rb
ruby_jard-0.2.3 lib/ruby_jard/commands/step_command.rb