Permalink
Browse files

version 0.4.3, fixed example_command_override.rb

  • Loading branch information...
1 parent 7fa6041 commit 5750854339082b364593dc791a4938f2fdf2be52 @banister committed Jan 27, 2011
Showing with 11 additions and 4 deletions.
  1. +10 −3 examples/example_command_override.rb
  2. +1 −1 lib/pry/version.rb
@@ -13,14 +13,21 @@ class MyCommands < Pry::CommandBase
output.puts "No, i refuse to display any useful information."
end
+ # bring in just the status command from Pry::Commands
+ import_from Pry::Commands, "status"
+
+ # analagy to Ruby's native alias_method idiom for decorating a method
+ alias_command "old_status", "status", ""
+
# Invoke one command from within another using `run`
- command "status2" do |x|
+ command "status", "Modified status." do |x|
output.puts "About to show status, are you ready?"
- run "status", x
+ run "old_status", x
output.puts "Finished showing status."
end
- import_from Pry::Commands, "quit", "show_method", "ls"
+ # bring in a few other commands
+ import_from Pry::Commands, "quit", "show_method"
end
# Start a Pry session using the commands defined in MyCommands
View
@@ -1,3 +1,3 @@
class Pry
- VERSION = "0.4.2"
+ VERSION = "0.4.3"
end

0 comments on commit 5750854

Please sign in to comment.