Top Level Namespace
Defined Under Namespace
Modules: Hercules, Ragios
Classes: String
Constant Summary
collapse
- RAGIOS_HERCULES_SCREENSHOT_DIR =
"#{Dir.pwd}/screenshots/tmp"
- RAGIOS_HERCULES_ENABLE_SCREENSHOTS =
ENV['RAGIOS_HERCULES_ENABLE_SCREENSHOTS'] == 'true' ? true : false
- RAGIOS_HERCULES_S3_DIR =
ENV["RAGIOS_HERCULES_S3_DIR"]
Instance Method Summary
collapse
Instance Method Details
#clear_screenshots_cache! ⇒ Object
28
29
30
31
|
# File 'lib/uptime_monitor.rb', line 28
def clear_screenshots_cache!
Dir.chdir(RAGIOS_HERCULES_SCREENSHOT_DIR)
Dir.glob("*.*").each { |filename| File.delete(filename) if file_age(filename) > 1 }
end
|
#file_age(name) ⇒ Object
24
25
26
|
# File 'lib/uptime_monitor.rb', line 24
def file_age(name)
(Time.now - File.ctime(name))/(24*3600)
end
|
#require_all(path) ⇒ Object
8
9
10
11
12
|
# File 'lib/uptime_monitor.rb', line 8
def require_all(path)
Dir.glob(File.dirname(__FILE__) + path + '/*.rb') do |file|
require File.dirname(__FILE__) + path + '/' + File.basename(file, File.extname(file))
end
end
|
#setup_screenshot_dir ⇒ Object