Sha256: bf433d951355dac6a2f2de0d6ed2fae676ab893626d7985fdec7362978ddbe77

Contents?: true

Size: 846 Bytes

Versions: 32

Compression:

Stored size: 846 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

def stop_here
  warn "[END OF DEBUG]"
  exit
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
muflax-0.5.1 lib/muflax/debug.rb
muflax-0.5.0 lib/muflax/debug.rb
muflax-0.4.2 lib/muflax/debug.rb
muflax-0.4.1 lib/muflax/debug.rb
muflax-0.4.0 lib/muflax/debug.rb
muflax-0.3.23 lib/muflax/debug.rb
muflax-0.3.22 lib/muflax/debug.rb
muflax-0.3.21 lib/muflax/debug.rb
muflax-0.3.20 lib/muflax/debug.rb
muflax-0.3.19 lib/muflax/debug.rb
muflax-0.3.18 lib/muflax/debug.rb
muflax-0.3.17 lib/muflax/debug.rb
muflax-0.3.16 lib/muflax/debug.rb
muflax-0.3.14 lib/muflax/debug.rb
muflax-0.3.13 lib/muflax/debug.rb
muflax-0.3.12 lib/muflax/debug.rb
muflax-0.3.11 lib/muflax/debug.rb
muflax-0.3.10 lib/muflax/debug.rb
muflax-0.3.9 lib/muflax/debug.rb
muflax-0.3.8 lib/muflax/debug.rb