Skip to content

Commit

Permalink
By default notify on all release stages
Browse files Browse the repository at this point in the history
  • Loading branch information
snmaynard committed Mar 20, 2013
1 parent 342a085 commit 86962df
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,9 @@ apps it is automatically set to `RACK_ENV`. Otherwise the default is

###notify_release_stages

By default, we will only notify Bugsnag of exceptions that happen when
your `release_stage` is set to be "production". If you would like to
change which release stages notify Bugsnag of exceptions you can
set `notify_release_stages`:
By default, we will notify Bugsnag of exceptions that happen in any
`release_stage`. If you would like to change which release stages
notify Bugsnag of exceptions you can set `notify_release_stages`:

```ruby
config.notify_release_stages = ["production", "development"]
Expand Down
4 changes: 2 additions & 2 deletions lib/bugsnag/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Configuration
def initialize
# Set up the defaults
self.release_stage = nil
self.notify_release_stages = ["production"]
self.notify_release_stages = nil
self.auto_notify = true
self.use_ssl = false
self.params_filters = Set.new(DEFAULT_PARAMS_FILTERS)
Expand All @@ -55,7 +55,7 @@ def initialize
end

def should_notify?
@release_stage.nil? || @notify_release_stages.include?(@release_stage)
@release_stage.nil? || @notify_release_stages || @notify_release_stages.include?(@release_stage)
end

def request_data
Expand Down
4 changes: 3 additions & 1 deletion spec/notification_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ class BugsnagTestExceptionWithMetaData < Exception; include Bugsnag::MetaData; e
it "should respect the notify_release_stages setting by not sending in development" do
Bugsnag::Notification.should_not_receive(:deliver_exception_payload)

Bugsnag.configuration.notify_release_stages = ["production"]
Bugsnag.configuration.release_stage = "development"

Bugsnag.notify(BugsnagTestException.new("It crashed"))
end

Expand All @@ -266,7 +268,7 @@ class BugsnagTestExceptionWithMetaData < Exception; include Bugsnag::MetaData; e
end

Bugsnag.configuration.release_stage = "development"
Bugsnag.configuration.notify_release_stages << "development"
Bugsnag.configuration.notify_release_stages = ["development"]
Bugsnag.notify(BugsnagTestException.new("It crashed"))
end

Expand Down

0 comments on commit 86962df

Please sign in to comment.