class Cue::Command::Utils::Editor

Public Instance Methods

basename() click to toggle source
# File lib/cue/command/utils/editor.rb, line 7
def basename
  'cue'
end
command() click to toggle source
# File lib/cue/command/utils/editor.rb, line 11
def command
  ENV['EDITOR'] || default_editor
end
dir() click to toggle source
# File lib/cue/command/utils/editor.rb, line 24
def dir
  '/tmp'
end
path() click to toggle source
# File lib/cue/command/utils/editor.rb, line 28
def path
  @path ||= File.expand_path(Dir::Tmpname::make_tmpname(basename, nil), dir)
end
read() click to toggle source
# File lib/cue/command/utils/editor.rb, line 15
def read
  Process.wait(spawn([command, path].join(' ')))
  content = File.read(path)
  
  File.delete(path)
  
  content
end

Private Instance Methods

default_editor() click to toggle source
# File lib/cue/command/utils/editor.rb, line 34
def default_editor
  'vi'
end