Class: Titan::System
- Inherits:
-
Object
- Object
- Titan::System
- Defined in:
- lib/titan/system.rb
Class Method Summary collapse
-
.check_filesystem ⇒ Object
Checks the file system for neccessary directories and permissions.
-
.pid_files ⇒ Object
Returns a list of all pid files available in the Titan::TITAN_DIRECTORY.
-
.ps(command, pid) ⇒ Object
Calls the ps function of the OS with a given command and process id.
Class Method Details
.check_filesystem ⇒ Object
Checks the file system for neccessary directories and permissions
24 25 26 |
# File 'lib/titan/system.rb', line 24 def check_filesystem Dir.mkdir(Titan::TITAN_DIRECTORY) unless File.directory?(Titan::TITAN_DIRECTORY) end |
.pid_files ⇒ Object
Returns a list of all pid files available in the Titan::TITAN_DIRECTORY
31 32 33 |
# File 'lib/titan/system.rb', line 31 def pid_files Dir.entries(Titan::TITAN_DIRECTORY) - [".", ".."] end |
.ps(command, pid) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/titan/system.rb', line 13 def ps(command, pid) if pid > 0 `ps -o #{command}= -p #{pid}` else nil end end |