Class: Chef::Handler::Genesis
- Inherits:
-
Chef::Handler
- Object
- Chef::Handler
- Chef::Handler::Genesis
- Defined in:
- lib/chef/handler/genesis.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(config = {}) ⇒ Genesis
constructor
A new instance of Genesis.
- #report ⇒ Object
Constructor Details
#initialize(config = {}) ⇒ Genesis
Returns a new instance of Genesis.
15 16 17 |
# File 'lib/chef/handler/genesis.rb', line 15 def initialize(config = {}) @config = Mash.new(config) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
13 14 15 |
# File 'lib/chef/handler/genesis.rb', line 13 def config @config end |
Instance Method Details
#report ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/chef/handler/genesis.rb', line 19 def report if defined?(Bugsnag) @bugsnag_config = Bugsnag::Configuration.new @bugsnag_config.api_key = @config.delete('bugsnag_api_key') @bugsnag_config.app_version = GenesisCollector::VERSION @bugsnag_config.project_root = File.('../../..', File.dirname(__FILE__)) @bugsnag_config.release_stage = run_context.node.chef_environment @config[:error_handler] = ->(e) { Bugsnag::Notification.new(e, @bugsnag_config).deliver } end prepare_report send_report end |