Class: ProcessSanity::Processes
- Inherits:
-
Object
- Object
- ProcessSanity::Processes
- Defined in:
- lib/process_sanity.rb
Instance Attribute Summary collapse
-
#is_aggressive ⇒ Object
Returns the value of attribute is_aggressive.
-
#names ⇒ Object
Returns the value of attribute names.
Instance Method Summary collapse
Instance Attribute Details
#is_aggressive ⇒ Object
Returns the value of attribute is_aggressive.
3 4 5 |
# File 'lib/process_sanity.rb', line 3 def is_aggressive @is_aggressive end |
#names ⇒ Object
Returns the value of attribute names.
3 4 5 |
# File 'lib/process_sanity.rb', line 3 def names @names end |
Instance Method Details
#check_processes ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/process_sanity.rb', line 5 def check_processes names.each do |process_name| id = system("pgrep -f #{process_name} > /dev/null 2>&1") unless id puts "SanityCheck: #{process_name} IS A DEPENDENCY YET IT IS NOT RUNNING!" end end if is_aggressive raise "SanityCheck:: YOU HAVE FORGOT TO PRE-RUN SOME PROCESSES" end end |