Skip to content

Commit

Permalink
Added more rdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
Cawllec committed Feb 6, 2018
1 parent 4038e58 commit 9aaf463
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/bugsnag/integrations/mailman.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ class Mailman
:framework => "Mailman"
}

##
# Extracts and appends mailman data to error notifications.
def initialize
Bugsnag.configuration.internal_middleware.use(Bugsnag::Middleware::Mailman)
Bugsnag.configuration.app_type = "mailman"
end

##
# Calls the mailman middleware.
def call(mail)
begin
Bugsnag.configuration.set_request_data :mailman_msg, mail.to_s
Expand Down
4 changes: 4 additions & 0 deletions lib/bugsnag/integrations/rack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ class Rack
:framework => "Rack"
}

##
# Automatically captures and adds Rack data to error notifications.
def initialize(app)
@app = app

Expand All @@ -31,6 +33,8 @@ def initialize(app)
end
end

##
# Wraps a call to the application with error capturing.
def call(env)
# Set the request data for bugsnag middleware to use
Bugsnag.configuration.set_request_data(:rack_env, env)
Expand Down
2 changes: 2 additions & 0 deletions lib/bugsnag/integrations/rake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class Rake::Task
:framework => "Rake"
}

##
# Executes the rake task with Bugsnag setup with contextual data.
def execute_with_bugsnag(args=nil)
Bugsnag.configuration.app_type ||= "rake"
old_task = Bugsnag.configuration.request_data[:bugsnag_running_task]
Expand Down

0 comments on commit 9aaf463

Please sign in to comment.