Module: Command::Helpers
- Defined in:
- lib/command/helpers.rb
Instance Method Summary collapse
- #main_directory ⇒ Object
- #process_running?(command) ⇒ Boolean
- #settings ⇒ Object
- #settings_file ⇒ Object
Instance Method Details
#main_directory ⇒ Object
11 12 13 |
# File 'lib/command/helpers.rb', line 11 def main_directory settings.directory end |
#process_running?(command) ⇒ 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 |
#settings ⇒ Object
3 4 5 |
# File 'lib/command/helpers.rb', line 3 def settings @settings ||= Settings.new end |
#settings_file ⇒ Object
7 8 9 |
# File 'lib/command/helpers.rb', line 7 def settings_file settings.file end |