Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix bug introduced in 0.0.9

  [Closes GH-12]
  • Loading branch information...
commit baf13b09fd3543a5c52759758533ed292061b588 1 parent 925bb5f
@jberkel authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 lib/interactive_editor.rb
View
11 lib/interactive_editor.rb
@@ -10,6 +10,7 @@
class InteractiveEditor
VERSION = '0.0.9'
+ EDITORS = Hash.new { |h,k| h[k] = InteractiveEditor.new(k) }
attr_accessor :editor
@@ -55,15 +56,15 @@ def execute
end
def self.edit(editor, self_, file=nil)
- #maybe serialise last file to disk, for recovery
- (editors_storage ||= Hash.new { |h,k| h[k] = InteractiveEditor.new(k) })[editor].edit(self_, file)
+ find_editor[editor].edit(self_, file)
end
- def self.editors_storage
+ def self.find_editor
+ #maybe serialise last file to disk, for recovery
if defined?(Pry) and IRB == Pry
- IRB.config.interactive_editors
+ IRB.config.interactive_editors ||= EDITORS
else
- IRB.conf[:interactive_editors]
+ IRB.conf[:interactive_editors] ||= EDITORS
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.