Class: AIA::Subl

Inherits:
Tools show all
Defined in:
lib/aia/tools/subl.rb

Overview

lib/aia/tools/subl.rb

Constant Summary collapse

DEFAULT_PARAMETERS =
[
  "--new-window",   # Open a new window
  "--wait",         # Wait for the files to be closed before returning
].join(' ')

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Tools

catalog, get_meta, inherited, load_tools, #meta, meta, search_for, setup_backend, validate_tools

Constructor Details

#initialize(file: "") ⇒ Subl

Returns a new instance of Subl.



22
23
24
25
26
# File 'lib/aia/tools/subl.rb', line 22

def initialize(file: "")
  @file     = file

  build_command
end

Instance Attribute Details

#commandObject

Returns the value of attribute command.



19
20
21
# File 'lib/aia/tools/subl.rb', line 19

def command
  @command
end

Instance Method Details

#build_commandObject



29
30
31
# File 'lib/aia/tools/subl.rb', line 29

def build_command
  @command = "#{meta.name} #{DEFAULT_PARAMETERS} #{@file}"
end

#runObject



34
35
36
# File 'lib/aia/tools/subl.rb', line 34

def run
  `#{command}`
end