Sha256: 1871a0c47ced1ec0639512efec1f46f3821b10d5543aa30a6b7ebfe2a4983dae

Contents?: true

Size: 693 Bytes

Versions: 13

Compression:

Stored size: 693 Bytes

Contents

require 'byebug/command'
require 'byebug/helpers/eval'

module Byebug
  #
  # Enter Pry from byebug's prompt
  #
  class PryCommand < Command
    self.allow_in_post_mortem = true

    def self.regexp
      /^\s* pry \s*$/x
    end

    def self.description
      <<-EOD
        pry

        #{short_description}
      EOD
    end

    def self.short_description
      'Starts a Pry session'
    end

    def execute
      unless processor.interface.is_a?(LocalInterface)
        return errmsg(pr('base.errors.only_local'))
      end

      begin
        require 'pry'
      rescue LoadError
        errmsg(pr('pry.errors.not_installed'))
      end

      context.binding.pry
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
byebug-8.2.5 lib/byebug/commands/pry.rb
byebug-8.2.4 lib/byebug/commands/pry.rb
byebug-8.2.3 lib/byebug/commands/pry.rb
byebug-8.2.2 lib/byebug/commands/pry.rb
byebug-8.2.1 lib/byebug/commands/pry.rb
byebug-8.2.0 lib/byebug/commands/pry.rb
byebug-8.1.0 lib/byebug/commands/pry.rb
byebug-8.0.1 lib/byebug/commands/pry.rb
byebug-8.0.0 lib/byebug/commands/pry.rb
byebug-7.0.0 lib/byebug/commands/pry.rb
byebug-6.0.2 lib/byebug/commands/pry.rb
byebug-6.0.1 lib/byebug/commands/pry.rb
byebug-6.0.0 lib/byebug/commands/pry.rb