def ask_editor(input = nil, preferred_editor = nil)
      editor = available_editor preferred_editor
      program = Commander::Runner.instance.program(:name).downcase rescue 'commander'
      tmpfile = Tempfile.new program
      begin
        tmpfile.write input if input
        tmpfile.close
        system("#{editor} #{tmpfile.path.shellescape}") ? IO.read(tmpfile.path) : nil
      ensure
        tmpfile.unlink
      end
    end
def ask_editor(input = nil, preferred_editor = nil)
      editor = available_editor preferred_editor
      program = Commander::Runner.instance.program(:name).downcase rescue 'commander'
      tmpfile = Tempfile.new program
      begin
        tmpfile.write input if input
        tmpfile.close
        system("#{editor} #{tmpfile.path.shellescape}") ? IO.read(tmpfile.path) : nil
      ensure
        tmpfile.unlink
      end
    end
Prompt an editor for input. Optionally supply initial
 _input_ which is written to the editor.

 _preferred_editor_ can be hinted.

 === Examples

   ask_editor                # => prompts EDITOR with no input
   ask_editor('foo')         # => prompts EDITOR with default text of 'foo'
   ask_editor('foo', 'mate -w')  # => prompts TextMate with default text of 'foo'