interactive_editor 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,8 +7,8 @@ Gem::Specification.new do |s|
7
7
  ## If your rubyforge_project name is different, then edit it and comment out
8
8
  ## the sub! line in the Rakefile
9
9
  s.name = 'interactive_editor'
10
- s.version = '0.0.9'
11
- s.date = '2011-09-06'
10
+ s.version = '0.0.10'
11
+ s.date = '2011-09-07'
12
12
  s.rubyforge_project = 'interactive_editor'
13
13
 
14
14
  ## Make sure your summary is short. The description may be as long
@@ -9,7 +9,8 @@ require 'shellwords'
9
9
  require 'yaml'
10
10
 
11
11
  class InteractiveEditor
12
- VERSION = '0.0.9'
12
+ VERSION = '0.0.10'
13
+ EDITORS = Hash.new { |h,k| h[k] = InteractiveEditor.new(k) }
13
14
 
14
15
  attr_accessor :editor
15
16
 
@@ -55,15 +56,15 @@ class InteractiveEditor
55
56
  end
56
57
 
57
58
  def self.edit(editor, self_, file=nil)
58
- #maybe serialise last file to disk, for recovery
59
- (editors_storage ||= Hash.new { |h,k| h[k] = InteractiveEditor.new(k) })[editor].edit(self_, file)
59
+ find_editor[editor].edit(self_, file)
60
60
  end
61
-
62
- def self.editors_storage
61
+
62
+ def self.find_editor
63
+ #maybe serialise last file to disk, for recovery
63
64
  if defined?(Pry) and IRB == Pry
64
- IRB.config.interactive_editors
65
+ IRB.config.interactive_editors ||= EDITORS
65
66
  else
66
- IRB.conf[:interactive_editors]
67
+ IRB.conf[:interactive_editors] ||= EDITORS
67
68
  end
68
69
  end
69
70
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 9
9
- version: 0.0.9
8
+ - 10
9
+ version: 0.0.10
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jan Berkel
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-09-06 00:00:00 +02:00
17
+ date: 2011-09-07 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency