Skip to content

Instantly share code, notes, and snippets.

@banister
Created December 4, 2011 11:01
Show Gist options
  • Save banister/1429902 to your computer and use it in GitHub Desktop.
Save banister/1429902 to your computer and use it in GitHub Desktop.
Pry.commands.command "alias" do |name, action|
Pry.commands.command name do |*args|
run action, *args
end
end
# => #<struct Pry::CommandSet::Command
# name="alias",
# description="No description.",
# options=
# {:requires_gem=>[],
# :keep_retval=>false,
# :argument_required=>false,
# :interpolate=>true,
# :shellwords=>true,
# :listing=>"alias",
# :use_prefix=>true},
# block=#<Proc:0x0000010106e9b8@(pry):1>>
[4] (pry) main: 0> alias hello "ls -M"
[5] (pry) main: 0> hello Pry
Pry#methods: backtrace backtrace= binding_stack binding_stack= commands commands= custom_completions custom_completions= exception_handler exception_handler= hooks hooks= incomplete_user_input_exception? inject_local inject_special_locals input input= input_array input_stack input_stack= last_dir last_dir= last_exception last_exception= last_file last_file= last_result last_result= last_result_is_exception? memory_size memory_size= output output= output_array pop_prompt print print= process_command prompt prompt= push_prompt r re readline refresh rep repl repl_epilogue repl_prologue retrieve_line run_command select_prompt set_last_exception set_last_result should_print? show_result special_locals update_input_history valid_expression?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment