Sha256: dc27ffc90573372de821f1f32abe2094f843410fd06409c47c0aff6e9a2b4825

Contents?: true

Size: 644 Bytes

Versions: 2

Compression:

Stored size: 644 Bytes

Contents

require 'pry' unless defined? Pry
require 'pry-nav/tracer'

class << Pry
  alias start_without_pry_nav start

  def start_with_pry_nav(target = TOPLEVEL_BINDING, options = {})
    old_options = options.reject { |k, _| k == :pry_remote }

    if target.is_a?(Binding) && PryNav.check_file_context(target)
      # Wrap the tracer around the usual Pry.start
      PryNav::Tracer.new(options).run do
        start_without_pry_nav(target, old_options)
      end
    else
      # No need for the tracer unless we have a file context to step through
      start_without_pry_nav(target, old_options)
    end
  end

  alias start start_with_pry_nav
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
pryx-0.11.0 lib/pry-nav/pry_ext.rb
pry-nav-1.0.0 lib/pry-nav/pry_ext.rb