Permalink
Browse files

Merge pull request #11 from madsheep/master

Support for pry.
  • Loading branch information...
2 parents df85060 + b2b721e commit 1fd17e7090640da251b76b0fbab054d97a4098c2 @jberkel committed Sep 6, 2011
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 1fd17e7

Please sign in to comment.