0.0
No commit activity in last 3 years
No release in over 3 years
Ill Be Back Longer description
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 0
~> 3.2
 Project Readme

IllBeBack

A line of code runs a million times but it has some kind of trouble in determinated conditions not given (or accessible) by the object who owns this line of code. I want to say when to stop and debug, from outside. Thats what IllBeBack does.

Installation

gem 'ill_be_back'

Basic usage

require 'pry'
require 'ill_be_back'

class Model

  def magic
    IllBeBack.debug { binding.pry }
    puts "Something"
  end

end

model = Model.new

model.magic # prints something
model.magic # prints something, again

IllBeBack.prepare!

model.magic # stops in pry, and then prints something
model.magic # back to normallity: prints something

Advanced usage

    IllBeBack.debug { binding.pry } # stops once after 'prepare!' call
    IllBeBack.debug(2.times) { binding.pry } # stops twice after 'prepare!' call
    IllBeBack.debug_at_call(4) { binding.pry } # stops at 4th call after 'prepare!' call
    IllBeBack.debug_between_calls(2, 4) { binding.pry } # stops at calls 2, 3 and 4 after 'prepare!' call
    IllBeBack.armed? # true if 'prepare!' was called

Ext

    require 'ill_be_back/ext'
    binding.prepare!
    binding.armed?
    binding.debug { binding.pry }
    # and etc...