Skip to content

Instantly share code, notes, and snippets.

@davidmiani
Created December 29, 2018 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidmiani/a7f9e2ac4a4a50b880590774b47faf1f to your computer and use it in GitHub Desktop.
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
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