Skip to content
Browse files

Pry prompt shows pwd

  • Loading branch information...
1 parent c345cb4 commit f6e9693b3afe50de885adc9f61d4d41e203a0210 @nviennot committed Jul 22, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 irb/pry_loader.rb
View
9 irb/pry_loader.rb
@@ -3,12 +3,17 @@ module Pry
def self.setup
return unless IRB.try_require 'pry'
- ::Pry.prompt = [proc { |obj, nest_level| "(#{obj}) > " },
- proc { |obj, nest_level| "(#{obj}) * " }]
+ ::Pry.prompt = [proc { |obj, nest_level| "#{self.pwd} (#{obj}) > " },
+ proc { |obj, nest_level| "#{self.pwd} (#{obj}) * " }]
+ @@home = Dir.home
TopLevel.new.pry
exit
end
+
+ def self.pwd
+ Dir.pwd.gsub(/^#{@@home}/, '~')
+ end
end
class TopLevel

0 comments on commit f6e9693

Please sign in to comment.
Something went wrong with that request. Please try again.