Class: Tabby::Editor

Inherits:
Object
  • Object
show all
Defined in:
lib/tabby/editor.rb

Instance Method Summary collapse

Constructor Details

#initialize(project = nil) ⇒ Editor

Returns a new instance of Editor.



3
4
5
# File 'lib/tabby/editor.rb', line 3

def initialize(project=nil)
  @project = project
end

Instance Method Details

#pathObject



15
16
17
# File 'lib/tabby/editor.rb', line 15

def path
  TABBYDIR.join("#{@project}.rb")
end

#run!Object



7
8
9
10
11
12
13
# File 'lib/tabby/editor.rb', line 7

def run!
  if path.exist?
    system("$EDITOR #{TABBYDIR.join("#{@project}.rb")}")
  else
    Tabby::Creator.new(@project).run!
  end
end