Sha256: a7fa4cae7661cb451d6ce7433ce20969662598b1e5ea87e3df053271bf2fcbdf

Contents?: true

Size: 768 Bytes

Versions: 12

Compression:

Stored size: 768 Bytes

Contents

# frozen_string_literal: true

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
      <<-DESCRIPTION
        pry

        #{short_description}
      DESCRIPTION
    end

    def self.short_description
      "Starts a Pry session"
    end

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

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

      Pry.start(context.frame._binding)
    end
  end
end

Version data entries

12 entries across 12 versions & 5 rubygems

Version Path
mountapi-0.11.1 vendor/bundle/ruby/2.7.0/gems/byebug-10.0.2/lib/byebug/commands/pry.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/byebug-10.0.2/lib/byebug/commands/pry.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/byebug-10.0.2/lib/byebug/commands/pry.rb
dadapush_client-1.0.1 vendor/bundle/ruby/2.3.0/gems/byebug-10.0.2/lib/byebug/commands/pry.rb
jets-0.5.5 vendor/lambdagem/bundled/gems/ruby/2.5.0/gems/byebug-10.0.0/lib/byebug/commands/pry.rb
jets-0.5.4 vendor/lambdagem/bundled/gems/ruby/2.5.0/gems/byebug-10.0.0/lib/byebug/commands/pry.rb
jets-0.5.3 vendor/lambdagem/bundled/gems/ruby/2.5.0/gems/byebug-10.0.0/lib/byebug/commands/pry.rb
jets-0.5.2 vendor/lambdagem/bundled/gems/ruby/2.5.0/gems/byebug-10.0.0/lib/byebug/commands/pry.rb
jets-0.5.1 vendor/lambdagem/bundled/gems/ruby/2.5.0/gems/byebug-10.0.0/lib/byebug/commands/pry.rb
byebug-10.0.2 lib/byebug/commands/pry.rb
byebug-10.0.1 lib/byebug/commands/pry.rb
byebug-10.0.0 lib/byebug/commands/pry.rb