Permalink
Browse files

add pry support

  • Loading branch information...
madsheep committed Sep 6, 2011
1 parent df85060 commit b2b721e0564f59f1136623803a586895b5c64a92
Showing with 9 additions and 2 deletions.
  1. +9 −2 lib/interactive_editor.rb
View
@@ -56,8 +56,15 @@ def execute
def self.edit(editor, self_, file=nil)
#maybe serialise last file to disk, for recovery
- (IRB.conf[:interactive_editors] ||=
- Hash.new { |h,k| h[k] = InteractiveEditor.new(k) })[editor].edit(self_, file)
+ (editors_storage ||= Hash.new { |h,k| h[k] = InteractiveEditor.new(k) })[editor].edit(self_, file)
+ end
+
+ def self.editors_storage
+ if defined?(Pry) and IRB == Pry
+ IRB.config.interactive_editors
+ else
+ IRB.conf[:interactive_editors]
+ end
end
module Exec

0 comments on commit b2b721e

Please sign in to comment.