bugsnag 5.1.0 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f0f6a45c465fe50809b882075249dcfcc1ef50b
4
- data.tar.gz: be4d6495a21ed0d396e8c225520d3f99c3809796
3
+ metadata.gz: d4b00bead73bfc579980368d65edb60286f0531b
4
+ data.tar.gz: fbb45b08f2dc84545752c020110bb5c0bc746706
5
5
  SHA512:
6
- metadata.gz: 922f1851260cfe26d8f650eaeb2363a79a6f8d23c4eb5967cf3d9cbcf4343eab4649bc4bb61e1b96b93943396644820f31af8b1c0ade13e8507aa02693151f0f
7
- data.tar.gz: 3950c972f77ccd51637f3f167207cc4b2b17be9db6ff4165b88ba8d1bae5416a0313e48923d84c021038983bfa8caa9d20b54e163653737113e37fdf413d9ca9
6
+ metadata.gz: 08581bdce123264cbd592ddb6c4074f03b4d7d044bfa8ef8e72ee4af29dce3c34d183bb5db93b2fe770eee9b170ce39220969c6d93f784ab87dc50fb270a355b
7
+ data.tar.gz: baa4a8957c00e2ac6608471ff19b3976dbe076b4c63fb3277c3c24ecfb18586fb40a80a896c3d8a1685cc3062d859311730f26e0e03fa0e1eb3586caf5c97b43
@@ -1,6 +1,26 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## 5.2.0 (10 February 2017)
5
+
6
+ ### Enhancements
7
+
8
+ * Allow provider attribute in Deploy#notify
9
+ | [@jbaranov](https://github.com/jbaranov)
10
+ | [#339](https://github.com/bugsnag/bugsnag-ruby/pull/339)
11
+
12
+ ### Bug fixes
13
+
14
+ * Correctly hook on Action Controller
15
+ | [@rafaelfranca](https://github.com/rafaelfranca)
16
+ | [#338](https://github.com/bugsnag/bugsnag-ruby/pull/338)
17
+ * Fix Bugsnag error message typo
18
+ | [@Adsidera](https://github.com/Adsidera)
19
+ | [#344](https://github.com/bugsnag/bugsnag-ruby/pull/344)
20
+ * Default delivery method
21
+ | [@martin308](https://github.com/martin308)
22
+ | [#346](https://github.com/bugsnag/bugsnag-ruby/pull/346)
23
+
4
24
  ## 5.1.0 (23 January 2017)
5
25
 
6
26
  ### Bug fixes
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.1.0
1
+ 5.2.0
@@ -18,7 +18,7 @@ module Bugsnag
18
18
  :app_version => fetch(:app_version, ENV["BUGSNAG_APP_VERSION"]))
19
19
  })
20
20
  rescue
21
- logger.important("Bugnsag deploy notification failed, #{$!.inspect}")
21
+ logger.important("Bugsnag deploy notification failed, #{$!.inspect}")
22
22
  end
23
23
 
24
24
  logger.info "Bugsnag deploy notification complete."
@@ -31,7 +31,6 @@ module Bugsnag
31
31
  attr_accessor :proxy_password
32
32
  attr_accessor :timeout
33
33
  attr_accessor :hostname
34
- attr_accessor :delivery_method
35
34
  attr_writer :ignore_classes
36
35
 
37
36
  THREAD_LOCAL_NAME = "bugsnag_req_data"
@@ -77,7 +76,6 @@ module Bugsnag
77
76
  self.ignore_user_agents = Set.new(DEFAULT_IGNORE_USER_AGENTS)
78
77
  self.endpoint = DEFAULT_ENDPOINT
79
78
  self.hostname = default_hostname
80
- self.delivery_method = DEFAULT_DELIVERY_METHOD
81
79
  self.timeout = 15
82
80
  self.vendor_paths = [%r{vendor/}]
83
81
  self.notify_release_stages = nil
@@ -96,6 +94,30 @@ module Bugsnag
96
94
  self.middleware.use Bugsnag::Middleware::Callbacks
97
95
  end
98
96
 
97
+ ##
98
+ # Gets the delivery_method that Bugsnag will use to communicate with the
99
+ # notification endpoint.
100
+ #
101
+ def delivery_method
102
+ @delivery_method || @default_delivery_method || DEFAULT_DELIVERY_METHOD
103
+ end
104
+
105
+ ##
106
+ # Sets the delivery_method that Bugsnag will use to communicate with the
107
+ # notification endpoint.
108
+ #
109
+ def delivery_method=(delivery_method)
110
+ @delivery_method = delivery_method
111
+ end
112
+
113
+ ##
114
+ # Used to set a new default delivery method that will be used if one is not
115
+ # set with #delivery_method.
116
+ #
117
+ def default_delivery_method=(delivery_method)
118
+ @default_delivery_method = delivery_method
119
+ end
120
+
99
121
  # Accept both String and Class instances as an ignored class
100
122
  def ignore_classes
101
123
  @mutex.synchronize { @ignore_classes.map! { |klass| klass.is_a?(Class) ? klass.name : klass } }
@@ -22,7 +22,8 @@ module Bugsnag
22
22
  "appVersion" => configuration.app_version,
23
23
  "revision" => opts[:revision],
24
24
  "repository" => opts[:repository],
25
- "branch" => opts[:branch]
25
+ "branch" => opts[:branch],
26
+ "provider" => opts[:provider]
26
27
  }.reject {|k,v| v == nil}
27
28
 
28
29
  raise RuntimeError.new("No API key found when notifying of deploy") if !parameters["apiKey"] || parameters["apiKey"].empty?
@@ -37,12 +37,9 @@ module Bugsnag
37
37
  config = YAML.load_file(config_file) if File.exist?(config_file)
38
38
  Bugsnag.configure(config[::Rails.env] ? config[::Rails.env] : config) if config
39
39
 
40
- if defined?(::ActionController::Base)
40
+ ActiveSupport.on_load(:action_controller) do
41
41
  require "bugsnag/rails/controller_methods"
42
- ::ActionController::Base.send(:include, Bugsnag::Rails::ControllerMethods)
43
- end
44
- if defined?(ActionController::API)
45
- ActionController::API.send(:include, Bugsnag::Rails::ControllerMethods)
42
+ include Bugsnag::Rails::ControllerMethods
46
43
  end
47
44
  ActiveSupport.on_load(:active_record) do
48
45
  require "bugsnag/rails/active_record_rescue"
@@ -26,7 +26,7 @@ module Bugsnag
26
26
  end
27
27
 
28
28
  def save
29
- Bugsnag.auto_notify(exception, {:context => "#{payload['class']}@#{queue}", :payload => payload, :delivery_method => :synchronous})
29
+ Bugsnag.auto_notify(exception, {:context => "#{payload['class']}@#{queue}", :payload => payload})
30
30
  end
31
31
  end
32
32
  end
@@ -39,5 +39,5 @@ Bugsnag::Resque.add_failure_backend
39
39
 
40
40
  Resque.before_first_fork do
41
41
  Bugsnag.configuration.app_type = "resque"
42
- Bugsnag.configuration.delivery_method = :synchronous
42
+ Bugsnag.configuration.default_delivery_method = :synchronous
43
43
  end
@@ -4,7 +4,7 @@ module Bugsnag
4
4
  class Shoryuken
5
5
  def initialize
6
6
  Bugsnag.configuration.app_type = "shoryuken"
7
- Bugsnag.configuration.delivery_method = :synchronous
7
+ Bugsnag.configuration.default_delivery_method = :synchronous
8
8
  end
9
9
 
10
10
  def call(_, queue, _, body)
@@ -5,7 +5,7 @@ module Bugsnag
5
5
  def initialize
6
6
  Bugsnag.configuration.internal_middleware.use(Bugsnag::Middleware::Sidekiq)
7
7
  Bugsnag.configuration.app_type = "sidekiq"
8
- Bugsnag.configuration.delivery_method = :synchronous
8
+ Bugsnag.configuration.default_delivery_method = :synchronous
9
9
  end
10
10
 
11
11
  def call(worker, msg, queue)
@@ -0,0 +1,26 @@
1
+ # encoding: utf-8
2
+ require 'spec_helper'
3
+
4
+ describe Bugsnag::Configuration do
5
+ describe "delivery_method" do
6
+ it "should have the default delivery method" do
7
+ expect(subject.delivery_method).to eq(Bugsnag::Configuration::DEFAULT_DELIVERY_METHOD)
8
+ end
9
+
10
+ it "should have the defined delivery_method" do
11
+ subject.delivery_method = :test
12
+ expect(subject.delivery_method).to eq(:test)
13
+ end
14
+
15
+ it "should allow a new default delivery_method to be set" do
16
+ subject.default_delivery_method = :test
17
+ expect(subject.delivery_method).to eq(:test)
18
+ end
19
+
20
+ it "should allow the delivery_method to be set over a default" do
21
+ subject.default_delivery_method = :test
22
+ subject.delivery_method = :wow
23
+ expect(subject.delivery_method).to eq(:wow)
24
+ end
25
+ end
26
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bugsnag
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.0
4
+ version: 5.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-23 00:00:00.000000000 Z
11
+ date: 2017-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -158,6 +158,7 @@ files:
158
158
  - rails/init.rb
159
159
  - spec/cleaner_spec.rb
160
160
  - spec/code_spec.rb
161
+ - spec/configuration_spec.rb
161
162
  - spec/fixtures/crashes/end_of_file.rb
162
163
  - spec/fixtures/crashes/short_file.rb
163
164
  - spec/fixtures/crashes/start_of_file.rb