[ruby] Make enter re-run the last command in Pry
change
commit af17852eb8b72a0fbc0275ff93873c7c7c1c0c00
author Alpha Chen <alpha.chen@gmail.com>
date
parent 456cc2f9
diff --git a/ruby/.pryrc b/ruby/.pryrc
index 1dcc8f60..e94dbd8e 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)