Sha256: aaf4331b1000464dd86b4d4e6afbe7ce1147027ea697afba04e30a668fa826a8

Contents?: true

Size: 796 Bytes

Versions: 5

Compression:

Stored size: 796 Bytes

Contents

#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
# Copyright muflax <mail@muflax.com>, 2013
# License: GNU GPL 3 <http://www.gnu.org/copyleft/gpl.html>

# This is very stupid and shouldn't be used in real code, which is why I will use it in real code.

def bp
  require "debug_inspector"
  require "pry"
  RubyVM::DebugInspector.open do |inspector|
    eval("binding.pry", inspector.frame_binding(2))
  end
end

def bpe
  require "debug_inspector"
  require "pry"
  RubyVM::DebugInspector.open do |inspector|
    eval("binding.pry; exit", inspector.frame_binding(2))
  end
end

def v *variables
  require "debug_inspector"
  RubyVM::DebugInspector.open do |inspector|
    variables.each do |variable|
      eval("print '#{variable}: '; ap #{variable}", inspector.frame_binding(2))
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
muflax-0.2.2 lib/muflax/debug.rb
muflax-0.2.1 lib/muflax/debug.rb
muflax-0.2.0 lib/muflax/debug.rb
muflax-0.1.35 lib/muflax/debug.rb
muflax-0.1.34 lib/muflax/debug.rb