Class: Makesure::Verify
- Inherits:
-
Object
- Object
- Makesure::Verify
- Defined in:
- lib/makesure/verify.rb
Instance Attribute Summary collapse
-
#blk ⇒ Object
readonly
Returns the value of attribute blk.
-
#cron ⇒ Object
readonly
Returns the value of attribute cron.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, cron, blk) ⇒ Verify
constructor
A new instance of Verify.
- #run! ⇒ Object
Constructor Details
#initialize(name, cron, blk) ⇒ Verify
Returns a new instance of Verify.
7 8 9 10 11 |
# File 'lib/makesure/verify.rb', line 7 def initialize(name, cron, blk) @name = name @cron = cron @blk = blk end |
Instance Attribute Details
#blk ⇒ Object (readonly)
Returns the value of attribute blk.
5 6 7 |
# File 'lib/makesure/verify.rb', line 5 def blk @blk end |
#cron ⇒ Object (readonly)
Returns the value of attribute cron.
5 6 7 |
# File 'lib/makesure/verify.rb', line 5 def cron @cron end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/makesure/verify.rb', line 5 def name @name end |
Instance Method Details
#run! ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/makesure/verify.rb', line 13 def run! begin blk.call Makesure.log "Everything is copacetic" rescue Exception => e Makesure.warn "Uh oh, something's up" Makesure.warn "\t" + e. # send an email with the details body = "" body << "[#{Time.now.to_s}] Verification failure:\n\n" body << e.backtrace.join("\n") Makesure.send_alert("FAILED verification alert: #{e.}", body) return false #else #ensure end true end |