Sha256: dee2f1d094f131139fe19cc0030a0ac5b4e468f52397040584642801e6996a62

Contents?: true

Size: 957 Bytes

Versions: 12

Compression:

Stored size: 957 Bytes

Contents

class Binding
  def _irb(_host=nil)
    warn 'loading irb ...'

    if defined? Break and defined? IRB
      # This is need for work with looksee better.
      # See discuss on https://github.com/oggy/looksee/issues/57
      IRB.conf[:USE_COLORIZE] = false
    else
      warn "For work with Break and Looksee, please set
export RUBYOPT='-rpryx_irb'
instead of
export RUBYOPT='-rpryx'
"
    end

    self.irb
  end
end

module Kernel
  def irb!
    return unless ENV['IRB_was_started'].nil?

    ENV['IRB_was_started'] = 'true'

    require 'binding_of_caller'

    irb3(2)
  end

  def reirb!
    ENV['IRB_was_started'] = nil
  end

  def irb1
    ENV['IRB2_should_start'] = 'true'
  end

  def irb2
    if ENV['IRB2_should_start'] == 'true'
      ENV['IRB2_should_start'] = nil

      require 'binding_of_caller'

      irb3(2)
    end
  end

  def irb3(caller=1)
    require 'binding_of_caller'

    binding.of_caller(caller)._irb
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pryx-0.8.7 lib/pryx/irb_hack.rb
pryx-0.8.6 lib/pryx/irb_hack.rb
pryx-0.8.5 lib/pryx/irb_hack.rb
pryx-0.8.4 lib/pryx/irb_hack.rb
pryx-0.8.3 lib/pryx/irb_hack.rb
pryx-0.8.2 lib/pryx/irb_hack.rb
pryx-0.8.1 lib/pryx/irb_hack.rb
pryx-0.8.0 lib/pryx/irb_hack.rb
pryx-0.7.2 lib/pryx/irb_hack.rb
pryx-0.7.0 lib/pryx/irb_hack.rb
pryx-0.6.1 lib/pryx/irb_hack.rb
pryx-0.6.0 lib/pryx/irb_hack.rb