From af17852eb8b72a0fbc0275ff93873c7c7c1c0c00 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Thu, 18 Sep 2014 13:56:30 -0700 Subject: [PATCH] [ruby] Make enter re-run the last command in Pry --- ruby/.pryrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ruby/.pryrc b/ruby/.pryrc index 1dcc8f6..e94dbd8 100644 --- a/ruby/.pryrc +++ b/ruby/.pryrc @@ -22,5 +22,9 @@ end def tic; @_tic = Time.now; end def toc; Time.now - @_tic; end +Pry::Commands.command /^$/, "repeat last command" do + _pry_.input = StringIO.new(Pry.history.to_a.last) +end + pryrc_local = File.expand_path('../.pryrc.local', __FILE__) load pryrc_local if File.exists?(pryrc_local)