Skip to content

Instantly share code, notes, and snippets.

@richsoni
Created August 15, 2013 15:18
Show Gist options
  • Save richsoni/6241692 to your computer and use it in GitHub Desktop.
Save richsoni/6241692 to your computer and use it in GitHub Desktop.
Pry History Walker
#usage _! (2 previous lines) _! 3 (3 previous lines)
def _!(num = 2)
line = Pry.history.to_a[-1-num]
puts "evaling #{line}"
unless line == '_!' or line == '_'
Pry.send(:eval, line)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment