Class: VER::Executor::ExWrite

Inherits:
ExPath show all
Defined in:
lib/ver/executor/path.rb

Overview

Create new buffer with given filename and copy contents of current buffer into it. Then save it for good measure.

Constant Summary

Constants inherited from VER::Entry

VER::Entry::BACKWARD_WORD, VER::Entry::FORWARD_WORD

Instance Method Summary collapse

Methods inherited from ExPath

#choices

Methods inherited from VER::Entry

#accept_line, #beginning_of_history, #cursor=, #delete, #delete_next_char, #delete_next_word, #delete_prev_char, #delete_prev_word, #deleting, #end_of_history, #end_of_line, #error, #event, #events, #insert, #insert_selection, #insert_string, #insert_tab, #kill, #kill_end_of_line, #killing, #message, #next_char, #next_history, #next_word, #paste, #prev_char, #prev_word, #previous_history, #sel_end_of_line, #sel_next_char, #sel_next_word, #sel_prev_char, #sel_prev_word, #sel_start_of_line, #start_of_line, #style, #transpose_chars, #value=, #virtual_movement

Instance Method Details

#action(selected) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/ver/executor/path.rb', line 31

def action(selected)
  path = selected || value
  throw(:invalid) if File.directory?(path)

  VER.find_or_create_buffer(path) do |buffer|
    text = buffer.text
    text.value = caller.value.chomp
    Methods::Save.file_save(text)
  end

  callback.destroy(false)
end