Skip to content

Instantly share code, notes, and snippets.

@swarley
Created November 19, 2012 20:47
Show Gist options
  • Select an option

  • Save swarley/4113770 to your computer and use it in GitHub Desktop.

Select an option

Save swarley/4113770 to your computer and use it in GitHub Desktop.
pry/pry-hack
class Pry
if VERSION <= "0.9.10"
alias old_retrieve_line retrieve_line
def retrieve_line(eval_string, *args)
old_retrieve_line(eval_string, *args)
eval_string.sub!(/\A.+?\Z/, Hackage.hack_line(eval_string))
end
else
hooks.add_hook(:foo, :pry_hack) do {|line| Hackage.hack_line(line) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment