Module: InteractiveEditing
- Defined in:
- lib/utility_belt/interactive_editor.rb
Instance Method Summary collapse
- #edit_interactively(editor = InteractiveEditor.sensible_editor) ⇒ Object
-
#emacs ⇒ Object
TODO: Hardcore Emacs users use emacsclient or gnuclient to open documents in their existing sessions, rather than starting a brand new Emacs process.
- #handling_jruby_bug(&block) ⇒ Object
- #mate ⇒ Object
- #vi ⇒ Object
Instance Method Details
#edit_interactively(editor = InteractiveEditor.sensible_editor) ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/utility_belt/interactive_editor.rb', line 47 def edit_interactively(editor = InteractiveEditor.sensible_editor) unless IRB.conf[:interactive_editors] && IRB.conf[:interactive_editors][editor] IRB.conf[:interactive_editors] ||= {} IRB.conf[:interactive_editors][editor] = InteractiveEditor.new(editor) end IRB.conf[:interactive_editors][editor].edit_interactively end |
#emacs ⇒ Object
TODO: Hardcore Emacs users use emacsclient or gnuclient to open documents in their existing sessions, rather than starting a brand new Emacs process.
75 76 77 |
# File 'lib/utility_belt/interactive_editor.rb', line 75 def emacs handling_jruby_bug {edit_interactively(:emacs)} end |
#handling_jruby_bug(&block) ⇒ Object
55 56 57 58 59 60 61 62 63 |
# File 'lib/utility_belt/interactive_editor.rb', line 55 def handling_jruby_bug(&block) if RUBY_PLATFORM =~ /java/ puts "JRuby IRB has a bug which prevents successful IRB vi/emacs editing." puts "The JRuby team is aware of this and working on it. But it might be unfixable." puts "(http://jira.codehaus.org/browse/JRUBY-2049)" else yield end end |
#mate ⇒ Object
69 70 71 |
# File 'lib/utility_belt/interactive_editor.rb', line 69 def mate edit_interactively(:mate) end |
#vi ⇒ Object
65 66 67 |
# File 'lib/utility_belt/interactive_editor.rb', line 65 def vi handling_jruby_bug {edit_interactively(:vim)} end |