lib/bluepill/process_conditions/file_time.rb in bluepill-0.0.68 vs lib/bluepill/process_conditions/file_time.rb in bluepill-0.0.69
- old
+ new
@@ -1,26 +1,25 @@
-# -*- encoding: utf-8 -*-
module Bluepill
module ProcessConditions
class FileTime < ProcessCondition
def initialize(options = {})
@below = options[:below]
@filename = options[:filename]
end
- def run(pid, include_children)
- if File.exists?(@filename)
- Time.now()-File::mtime(@filename)
+ def run(_pid, _include_children)
+ if File.exist?(@filename)
+ Time.now - File.mtime(@filename)
else
nil
end
rescue
- $!
+ $ERROR_INFO
end
def check(value)
return false if value.nil?
- return value < @below
+ value < @below
end
end
end
end