Module: Command::Helpers

Defined in:
lib/command/helpers.rb

Instance Method Summary collapse

Instance Method Details

#main_directoryObject



11
12
13
# File 'lib/command/helpers.rb', line 11

def main_directory
  settings.directory
end

#process_running?(command) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/command/helpers.rb', line 15

def process_running?(command)
  ! %x(ps ux | awk '/#{command}/ && !/#{Process.ppid}/ && !/#{Process.pid}/ && !/awk/ {print $2}').empty?
end

#settingsObject



3
4
5
# File 'lib/command/helpers.rb', line 3

def settings
  @settings ||= Settings.new
end

#settings_fileObject



7
8
9
# File 'lib/command/helpers.rb', line 7

def settings_file
  settings.file
end