Sha256: 4164e6f8374a09c65b6bf5660c6660c80563eba252c88837892baf65c51a4829
Contents?: true
Size: 685 Bytes
Versions: 15
Compression:
Stored size: 685 Bytes
Contents
require 'json' module Heartcheck module Checks class WatchFile < Base def add_service(options) services << options.merge(runtime: installed(options[:file])) end def validate services.each do |service| if not service[:runtime].eql? installed(service[:file]) @errors << "App outdated, check /monitoring/info for more details!" end end end def info services.collect do |service| { runtime: service[:runtime], installed: installed(service[:file]) } end end private def installed(file) JSON.parse open(file).read end end end end
Version data entries
15 entries across 15 versions & 1 rubygems