Class: CampfireHandler
- Inherits:
-
Chef::Handler
- Object
- Chef::Handler
- CampfireHandler
- Defined in:
- lib/campfire_handler.rb
Constant Summary collapse
- VERSION =
"0.0.1"
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ CampfireHandler
constructor
A new instance of CampfireHandler.
- #report ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ CampfireHandler
Returns a new instance of CampfireHandler.
7 8 9 |
# File 'lib/campfire_handler.rb', line 7 def initialize(opts = {}) @config = opts end |
Instance Method Details
#report ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/campfire_handler.rb', line 11 def report() if run_status.failed? Chef::Log.error("Creating Campfire exception report") campfire = Tinder::Campfire.new(@config[:subdomain], :token => @config[:token]) campfire.rooms.first.speak("#{node.hostname} #{run_status.formatted_exception}") campfire.rooms.first.paste(Array(backtrace).join("\n")) end end |