Created
December 29, 2018 09:07
-
-
Save davidmiani/a7f9e2ac4a4a50b880590774b47faf1f to your computer and use it in GitHub Desktop.
Load command ll, run again with no args to reload the last command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pry::Commands.create_command "ll" do | |
description "Loads a file. If no arg is passed, will reload the last file" | |
def process | |
if (args.length == 0) | |
if $PRY_MY_LAST_LL.nil? | |
output.puts "No last file, aborting" | |
else | |
load $PRY_MY_LAST_LL | |
end | |
else | |
$PRY_MY_LAST_LL = args.join(" ") | |
load $PRY_MY_LAST_LL | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment