bugsnag 4.2.1 → 6.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. checksums.yaml +5 -5
  2. data/.yardopts +12 -0
  3. data/CHANGELOG.md +814 -0
  4. data/README.md +21 -25
  5. data/VERSION +1 -1
  6. data/bugsnag.gemspec +19 -8
  7. data/lib/bugsnag/breadcrumb_type.rb +14 -0
  8. data/lib/bugsnag/breadcrumbs/breadcrumb.rb +109 -0
  9. data/lib/bugsnag/breadcrumbs/breadcrumbs.rb +13 -0
  10. data/lib/bugsnag/breadcrumbs/on_breadcrumb_callback_list.rb +48 -0
  11. data/lib/bugsnag/breadcrumbs/validator.rb +29 -0
  12. data/lib/bugsnag/cleaner.rb +170 -59
  13. data/lib/bugsnag/code_extractor.rb +137 -0
  14. data/lib/bugsnag/configuration.rb +670 -45
  15. data/lib/bugsnag/delivery/synchronous.rb +31 -14
  16. data/lib/bugsnag/delivery/thread_queue.rb +23 -6
  17. data/lib/bugsnag/delivery.rb +13 -0
  18. data/lib/bugsnag/endpoint_configuration.rb +11 -0
  19. data/lib/bugsnag/endpoint_validator.rb +80 -0
  20. data/lib/bugsnag/error.rb +25 -0
  21. data/lib/bugsnag/event.rb +5 -0
  22. data/lib/bugsnag/feature_flag.rb +74 -0
  23. data/lib/bugsnag/helpers.rb +121 -25
  24. data/lib/bugsnag/integrations/delayed_job.rb +51 -0
  25. data/lib/bugsnag/integrations/mailman.rb +43 -0
  26. data/lib/bugsnag/integrations/mongo.rb +133 -0
  27. data/lib/bugsnag/integrations/que.rb +53 -0
  28. data/lib/bugsnag/integrations/rack.rb +83 -0
  29. data/lib/bugsnag/integrations/rails/active_job.rb +100 -0
  30. data/lib/bugsnag/{rails → integrations/rails}/active_record_rescue.rb +10 -1
  31. data/lib/bugsnag/{rails → integrations/rails}/controller_methods.rb +1 -9
  32. data/lib/bugsnag/integrations/rails/rails_breadcrumbs.rb +115 -0
  33. data/lib/bugsnag/integrations/railtie.rb +153 -0
  34. data/lib/bugsnag/integrations/rake.rb +74 -0
  35. data/lib/bugsnag/integrations/resque.rb +94 -0
  36. data/lib/bugsnag/integrations/shoryuken.rb +50 -0
  37. data/lib/bugsnag/integrations/sidekiq.rb +68 -0
  38. data/lib/bugsnag/meta_data.rb +1 -0
  39. data/lib/bugsnag/middleware/active_job.rb +18 -0
  40. data/lib/bugsnag/middleware/breadcrumbs.rb +21 -0
  41. data/lib/bugsnag/middleware/callbacks.rb +6 -8
  42. data/lib/bugsnag/middleware/classify_error.rb +50 -0
  43. data/lib/bugsnag/middleware/clearance_user.rb +33 -0
  44. data/lib/bugsnag/middleware/delayed_job.rb +93 -0
  45. data/lib/bugsnag/middleware/discard_error_class.rb +30 -0
  46. data/lib/bugsnag/middleware/exception_meta_data.rb +42 -0
  47. data/lib/bugsnag/middleware/ignore_error_class.rb +26 -0
  48. data/lib/bugsnag/middleware/mailman.rb +6 -4
  49. data/lib/bugsnag/middleware/rack_request.rb +126 -30
  50. data/lib/bugsnag/middleware/rails3_request.rb +15 -17
  51. data/lib/bugsnag/middleware/rake.rb +7 -5
  52. data/lib/bugsnag/middleware/session_data.rb +25 -0
  53. data/lib/bugsnag/middleware/sidekiq.rb +9 -4
  54. data/lib/bugsnag/middleware/suggestion_data.rb +34 -0
  55. data/lib/bugsnag/middleware/warden_user.rb +11 -6
  56. data/lib/bugsnag/middleware_stack.rb +62 -9
  57. data/lib/bugsnag/on_error_callbacks.rb +33 -0
  58. data/lib/bugsnag/report.rb +516 -0
  59. data/lib/bugsnag/session_tracker.rb +182 -0
  60. data/lib/bugsnag/stacktrace.rb +82 -0
  61. data/lib/bugsnag/tasks/bugsnag.rake +2 -70
  62. data/lib/bugsnag/utility/circular_buffer.rb +62 -0
  63. data/lib/bugsnag/utility/duplicator.rb +124 -0
  64. data/lib/bugsnag/utility/feature_data_store.rb +41 -0
  65. data/lib/bugsnag/utility/feature_flag_delegate.rb +89 -0
  66. data/lib/bugsnag/utility/metadata_delegate.rb +102 -0
  67. data/lib/bugsnag.rb +528 -80
  68. metadata +61 -123
  69. data/.document +0 -5
  70. data/.gitignore +0 -52
  71. data/.rspec +0 -3
  72. data/.travis.yml +0 -14
  73. data/CONTRIBUTING.md +0 -47
  74. data/Gemfile +0 -2
  75. data/Rakefile +0 -29
  76. data/lib/bugsnag/capistrano.rb +0 -7
  77. data/lib/bugsnag/capistrano2.rb +0 -32
  78. data/lib/bugsnag/delay/resque.rb +0 -21
  79. data/lib/bugsnag/delayed_job.rb +0 -57
  80. data/lib/bugsnag/deploy.rb +0 -34
  81. data/lib/bugsnag/mailman.rb +0 -28
  82. data/lib/bugsnag/middleware/rails2_request.rb +0 -52
  83. data/lib/bugsnag/notification.rb +0 -459
  84. data/lib/bugsnag/rack.rb +0 -53
  85. data/lib/bugsnag/rails/action_controller_rescue.rb +0 -62
  86. data/lib/bugsnag/rails.rb +0 -66
  87. data/lib/bugsnag/railtie.rb +0 -80
  88. data/lib/bugsnag/rake.rb +0 -25
  89. data/lib/bugsnag/resque.rb +0 -40
  90. data/lib/bugsnag/sidekiq.rb +0 -42
  91. data/lib/bugsnag/tasks/bugsnag.cap +0 -48
  92. data/rails/init.rb +0 -7
  93. data/spec/cleaner_spec.rb +0 -138
  94. data/spec/code_spec.rb +0 -86
  95. data/spec/fixtures/crashes/end_of_file.rb +0 -9
  96. data/spec/fixtures/crashes/short_file.rb +0 -1
  97. data/spec/fixtures/crashes/start_of_file.rb +0 -9
  98. data/spec/fixtures/middleware/internal_info_setter.rb +0 -11
  99. data/spec/fixtures/middleware/public_info_setter.rb +0 -11
  100. data/spec/fixtures/tasks/Rakefile +0 -15
  101. data/spec/helper_spec.rb +0 -163
  102. data/spec/integration_spec.rb +0 -132
  103. data/spec/middleware_spec.rb +0 -181
  104. data/spec/notification_spec.rb +0 -877
  105. data/spec/rack_spec.rb +0 -56
  106. data/spec/spec_helper.rb +0 -53
metadata CHANGED
@@ -1,99 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bugsnag
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: 6.27.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Smith
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-23 00:00:00.000000000 Z
11
+ date: 2024-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rake
14
+ name: concurrent-ruby
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 10.1.1
20
- type: :development
19
+ version: '1.0'
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 10.1.1
27
- - !ruby/object:Gem::Dependency
28
- name: rspec
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: rdoc
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: pry
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: addressable
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: 2.3.8
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: 2.3.8
83
- - !ruby/object:Gem::Dependency
84
- name: webmock
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
26
+ version: '1.0'
97
27
  description: Ruby notifier for bugsnag.com
98
28
  email: james@bugsnag.com
99
29
  executables: []
@@ -103,76 +33,85 @@ extra_rdoc_files:
103
33
  - README.md
104
34
  - CHANGELOG.md
105
35
  files:
106
- - ".document"
107
- - ".gitignore"
108
- - ".rspec"
109
- - ".travis.yml"
36
+ - ".yardopts"
110
37
  - CHANGELOG.md
111
- - CONTRIBUTING.md
112
- - Gemfile
113
38
  - LICENSE.txt
114
39
  - README.md
115
- - Rakefile
116
40
  - VERSION
117
41
  - bugsnag.gemspec
118
42
  - lib/bugsnag.rb
119
- - lib/bugsnag/capistrano.rb
120
- - lib/bugsnag/capistrano2.rb
43
+ - lib/bugsnag/breadcrumb_type.rb
44
+ - lib/bugsnag/breadcrumbs/breadcrumb.rb
45
+ - lib/bugsnag/breadcrumbs/breadcrumbs.rb
46
+ - lib/bugsnag/breadcrumbs/on_breadcrumb_callback_list.rb
47
+ - lib/bugsnag/breadcrumbs/validator.rb
121
48
  - lib/bugsnag/cleaner.rb
49
+ - lib/bugsnag/code_extractor.rb
122
50
  - lib/bugsnag/configuration.rb
123
- - lib/bugsnag/delay/resque.rb
124
- - lib/bugsnag/delayed_job.rb
125
51
  - lib/bugsnag/delivery.rb
126
52
  - lib/bugsnag/delivery/synchronous.rb
127
53
  - lib/bugsnag/delivery/thread_queue.rb
128
- - lib/bugsnag/deploy.rb
54
+ - lib/bugsnag/endpoint_configuration.rb
55
+ - lib/bugsnag/endpoint_validator.rb
56
+ - lib/bugsnag/error.rb
57
+ - lib/bugsnag/event.rb
58
+ - lib/bugsnag/feature_flag.rb
129
59
  - lib/bugsnag/helpers.rb
130
- - lib/bugsnag/mailman.rb
60
+ - lib/bugsnag/integrations/delayed_job.rb
61
+ - lib/bugsnag/integrations/mailman.rb
62
+ - lib/bugsnag/integrations/mongo.rb
63
+ - lib/bugsnag/integrations/que.rb
64
+ - lib/bugsnag/integrations/rack.rb
65
+ - lib/bugsnag/integrations/rails/active_job.rb
66
+ - lib/bugsnag/integrations/rails/active_record_rescue.rb
67
+ - lib/bugsnag/integrations/rails/controller_methods.rb
68
+ - lib/bugsnag/integrations/rails/rails_breadcrumbs.rb
69
+ - lib/bugsnag/integrations/railtie.rb
70
+ - lib/bugsnag/integrations/rake.rb
71
+ - lib/bugsnag/integrations/resque.rb
72
+ - lib/bugsnag/integrations/shoryuken.rb
73
+ - lib/bugsnag/integrations/sidekiq.rb
131
74
  - lib/bugsnag/meta_data.rb
75
+ - lib/bugsnag/middleware/active_job.rb
76
+ - lib/bugsnag/middleware/breadcrumbs.rb
132
77
  - lib/bugsnag/middleware/callbacks.rb
78
+ - lib/bugsnag/middleware/classify_error.rb
79
+ - lib/bugsnag/middleware/clearance_user.rb
80
+ - lib/bugsnag/middleware/delayed_job.rb
81
+ - lib/bugsnag/middleware/discard_error_class.rb
82
+ - lib/bugsnag/middleware/exception_meta_data.rb
83
+ - lib/bugsnag/middleware/ignore_error_class.rb
133
84
  - lib/bugsnag/middleware/mailman.rb
134
85
  - lib/bugsnag/middleware/rack_request.rb
135
- - lib/bugsnag/middleware/rails2_request.rb
136
86
  - lib/bugsnag/middleware/rails3_request.rb
137
87
  - lib/bugsnag/middleware/rake.rb
88
+ - lib/bugsnag/middleware/session_data.rb
138
89
  - lib/bugsnag/middleware/sidekiq.rb
90
+ - lib/bugsnag/middleware/suggestion_data.rb
139
91
  - lib/bugsnag/middleware/warden_user.rb
140
92
  - lib/bugsnag/middleware_stack.rb
141
- - lib/bugsnag/notification.rb
142
- - lib/bugsnag/rack.rb
143
- - lib/bugsnag/rails.rb
144
- - lib/bugsnag/rails/action_controller_rescue.rb
145
- - lib/bugsnag/rails/active_record_rescue.rb
146
- - lib/bugsnag/rails/controller_methods.rb
147
- - lib/bugsnag/railtie.rb
148
- - lib/bugsnag/rake.rb
149
- - lib/bugsnag/resque.rb
150
- - lib/bugsnag/sidekiq.rb
93
+ - lib/bugsnag/on_error_callbacks.rb
94
+ - lib/bugsnag/report.rb
95
+ - lib/bugsnag/session_tracker.rb
96
+ - lib/bugsnag/stacktrace.rb
151
97
  - lib/bugsnag/tasks.rb
152
- - lib/bugsnag/tasks/bugsnag.cap
153
98
  - lib/bugsnag/tasks/bugsnag.rake
99
+ - lib/bugsnag/utility/circular_buffer.rb
100
+ - lib/bugsnag/utility/duplicator.rb
101
+ - lib/bugsnag/utility/feature_data_store.rb
102
+ - lib/bugsnag/utility/feature_flag_delegate.rb
103
+ - lib/bugsnag/utility/metadata_delegate.rb
154
104
  - lib/bugsnag/version.rb
155
105
  - lib/generators/bugsnag/bugsnag_generator.rb
156
- - rails/init.rb
157
- - spec/cleaner_spec.rb
158
- - spec/code_spec.rb
159
- - spec/fixtures/crashes/end_of_file.rb
160
- - spec/fixtures/crashes/short_file.rb
161
- - spec/fixtures/crashes/start_of_file.rb
162
- - spec/fixtures/middleware/internal_info_setter.rb
163
- - spec/fixtures/middleware/public_info_setter.rb
164
- - spec/fixtures/tasks/Rakefile
165
- - spec/helper_spec.rb
166
- - spec/integration_spec.rb
167
- - spec/middleware_spec.rb
168
- - spec/notification_spec.rb
169
- - spec/rack_spec.rb
170
- - spec/spec_helper.rb
171
- homepage: http://github.com/bugsnag/bugsnag-ruby
106
+ homepage: https://github.com/bugsnag/bugsnag-ruby
172
107
  licenses:
173
108
  - MIT
174
- metadata: {}
175
- post_install_message:
109
+ metadata:
110
+ changelog_uri: https://github.com/bugsnag/bugsnag-ruby/blob/v6.27.1/CHANGELOG.md
111
+ documentation_uri: https://docs.bugsnag.com/platforms/ruby/
112
+ source_code_uri: https://github.com/bugsnag/bugsnag-ruby/
113
+ rubygems_mfa_required: 'true'
114
+ post_install_message:
176
115
  rdoc_options: []
177
116
  require_paths:
178
117
  - lib
@@ -187,9 +126,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
126
  - !ruby/object:Gem::Version
188
127
  version: '0'
189
128
  requirements: []
190
- rubyforge_project:
191
- rubygems_version: 2.4.5
192
- signing_key:
129
+ rubygems_version: 3.4.10
130
+ signing_key:
193
131
  specification_version: 4
194
132
  summary: Ruby notifier for bugsnag.com
195
133
  test_files: []
data/.document DELETED
@@ -1,5 +0,0 @@
1
- lib/**/*.rb
2
- bin/*
3
- -
4
- features/**/*.feature
5
- LICENSE.txt
data/.gitignore DELETED
@@ -1,52 +0,0 @@
1
- # rcov generated
2
- coverage
3
-
4
- # rdoc generated
5
- rdoc
6
-
7
- # yard generated
8
- doc
9
- .yardoc
10
-
11
- # bundler
12
- .bundle
13
- Gemfile.lock
14
-
15
- # jeweler generated
16
- pkg
17
- *.gem
18
-
19
- vendor
20
- # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
21
- #
22
- # * Create a file at ~/.gitignore
23
- # * Include files you want ignored
24
- # * Run: git config --global core.excludesfile ~/.gitignore
25
- #
26
- # After doing this, these files will be ignored in all your git projects,
27
- # saving you from having to 'pollute' every project you touch with them
28
- #
29
- # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
30
- #
31
- # For MacOS:
32
- #
33
- #.DS_Store
34
-
35
- # For TextMate
36
- #*.tmproj
37
- #tmtags
38
-
39
- # For emacs:
40
- #*~
41
- #\#*
42
- #.\#*
43
-
44
- # For vim:
45
- #*.swp
46
-
47
- # For redcar:
48
- #.redcar
49
-
50
- # For rubinius:
51
- #*.rbc
52
- bin
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --backtrace
2
- --color
3
- --format doc
data/.travis.yml DELETED
@@ -1,14 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.3.0
6
- - 2.2.4
7
- - 2.1.8
8
- - 2.0.0
9
- - 1.9.3
10
- - jruby-19mode
11
-
12
- before_install:
13
- - gem update --system 2.1.11
14
- - gem --version
data/CONTRIBUTING.md DELETED
@@ -1,47 +0,0 @@
1
-
2
- ## How to contribute
3
-
4
- - [Fork](https://help.github.com/articles/fork-a-repo) the [notifier on github](https://github.com/bugsnag/bugsnag-ruby)
5
- - Commit and push until you are happy with your contribution
6
- - Run the tests with and make sure they all pass
7
-
8
- ```
9
- rake spec
10
- ```
11
-
12
- - [Make a pull request](https://help.github.com/articles/using-pull-requests)
13
- - Thanks!
14
-
15
-
16
- ## How to release
17
-
18
- If you're a member of the core team, follow these instructions for releasing bugsnag-ruby.
19
-
20
- ### First time setup
21
-
22
- * Create a Rubygems account
23
- * Get James/Simon to add you as contributor on bugsnag-ruby in Rubygems
24
-
25
- ### Every time
26
-
27
- * Update `VERSION`
28
- * Update `CHANGELOG.md`
29
- * Update `README.md` if necessary
30
- * Commit/push your changes
31
-
32
- ```
33
- git commit -am v2.X.X
34
- git push origin master
35
- ```
36
-
37
- * Release to rubygems
38
-
39
- ```
40
- bundle exec rake release
41
- ```
42
-
43
- * Update the version running in the bugsnag-website project
44
-
45
- ### Update docs.bugsnag.com
46
-
47
- Update the setup guides for Ruby (and its frameworks) with any new content.
data/Gemfile DELETED
@@ -1,2 +0,0 @@
1
- source "https://rubygems.org"
2
- gemspec
data/Rakefile DELETED
@@ -1,29 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require 'rubygems'
4
- require 'bundler'
5
- require 'bundler/gem_tasks'
6
- begin
7
- Bundler.setup(:default, :development)
8
- rescue Bundler::BundlerError => e
9
- $stderr.puts e.message
10
- $stderr.puts "Run `bundle install` to install missing gems"
11
- exit e.status_code
12
- end
13
-
14
- require 'rdoc/task'
15
- RDoc::Task.new do |rdoc|
16
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
17
-
18
- rdoc.rdoc_dir = 'rdoc'
19
- rdoc.title = "bugsnag #{version}"
20
- rdoc.rdoc_files.include('README*')
21
- rdoc.rdoc_files.include('lib/**/*.rb')
22
- end
23
-
24
- # RSpec tasks
25
- require 'rspec/core'
26
- require "rspec/core/rake_task"
27
- RSpec::Core::RakeTask.new(:spec)
28
-
29
- task :default => :spec
@@ -1,7 +0,0 @@
1
- require "bugsnag"
2
-
3
- if defined?(Capistrano::VERSION) && Gem::Version.new(Capistrano::VERSION).release >= Gem::Version.new('3.0.0')
4
- load File.expand_path('../tasks/bugsnag.cap', __FILE__)
5
- else
6
- require_relative 'capistrano2'
7
- end
@@ -1,32 +0,0 @@
1
- module Bugsnag
2
- module Capistrano
3
- def self.load_into(configuration)
4
- configuration.load do
5
- after "deploy", "bugsnag:deploy"
6
- after "deploy:migrations", "bugsnag:deploy"
7
-
8
- namespace :bugsnag do
9
- desc "Notify Bugsnag that new production code has been deployed"
10
- task :deploy, :except => { :no_release => true }, :on_error => :continue do
11
- begin
12
- Bugsnag::Deploy.notify({
13
- :api_key => fetch(:bugsnag_api_key, ENV["BUGSNAG_API_KEY"]),
14
- :release_stage => fetch(:rails_env, ENV["BUGSNAG_RELEASE_STAGE"] || "production"),
15
- :revision => fetch(:current_revision, ENV["BUGSNAG_REVISION"]),
16
- :repository => fetch(:repository, ENV["BUGSNAG_REPOSITORY"]),
17
- :branch => fetch(:branch, ENV["BUGSNAG_BRANCH"],
18
- :app_version => fetch(:app_version, ENV["BUGSNAG_APP_VERSION"]))
19
- })
20
- rescue
21
- logger.important("Bugnsag deploy notification failed, #{$!.inspect}")
22
- end
23
-
24
- logger.info "Bugsnag deploy notification complete."
25
- end
26
- end
27
- end
28
- end
29
- end
30
- end
31
-
32
- Bugsnag::Capistrano.load_into(Capistrano::Configuration.instance) if Capistrano::Configuration.instance
@@ -1,21 +0,0 @@
1
- module Bugsnag
2
- module Delay
3
- class Resque
4
- @queue = "bugsnag"
5
- def self.perform(*args)
6
- Bugsnag::Notification.deliver_exception_payload_without_resque(*args)
7
- end
8
- end
9
- end
10
- end
11
-
12
- Bugsnag::Notification.class_eval do
13
- class << self
14
- def deliver_exception_payload_with_resque(*args)
15
- Resque.enqueue(Bugsnag::Delay::Resque, *args)
16
- end
17
-
18
- alias_method :deliver_exception_payload_without_resque, :deliver_exception_payload
19
- alias_method :deliver_exception_payload, :deliver_exception_payload_with_resque
20
- end
21
- end
@@ -1,57 +0,0 @@
1
- require 'delayed_job'
2
-
3
- # See Issue #99
4
- unless defined?(Delayed::Plugin)
5
- raise LoadError, "bugsnag requires delayed_job > 3.x"
6
- end
7
-
8
- unless defined? Delayed::Plugins::Bugsnag
9
- module Delayed
10
- module Plugins
11
-
12
-
13
- class Bugsnag < Plugin
14
- module Notify
15
- def error(job, error)
16
- overrides = {
17
- :job => {
18
- :class => job.class.name,
19
- :id => job.id,
20
- }
21
- }
22
- if payload = job.payload_object
23
- p = {
24
- :class => payload.class.name,
25
- }
26
- p[:id] = payload.id if payload.respond_to?(:id)
27
- p[:display_name] = payload.display_name if payload.respond_to?(:display_name)
28
- p[:method_name] = payload.method_name if payload.respond_to?(:method_name)
29
- p[:args] = payload.args if payload.respond_to?(:args)
30
- if payload.is_a?(::Delayed::PerformableMethod) && (object = payload.object)
31
- p[:object] = {
32
- :class => object.class.name,
33
- }
34
- p[:object][:id] = object.id if object.respond_to?(:id)
35
- end
36
- overrides[:job][:payload] = p
37
- end
38
-
39
- ::Bugsnag.auto_notify(error, overrides)
40
-
41
- super if defined?(super)
42
- end
43
- end
44
-
45
- callbacks do |lifecycle|
46
- lifecycle.before(:invoke_job) do |job|
47
- payload = job.payload_object
48
- payload = payload.object if payload.is_a? Delayed::PerformableMethod
49
- payload.extend Notify
50
- end
51
- end
52
- end
53
- end
54
- end
55
-
56
- Delayed::Worker.plugins << Delayed::Plugins::Bugsnag
57
- end
@@ -1,34 +0,0 @@
1
- require "json"
2
-
3
- module Bugsnag
4
- class Deploy
5
- def self.notify(opts = {})
6
-
7
- configuration = Bugsnag.configuration.dup
8
-
9
- # update configuration based on parameters passed in
10
- [:api_key, :app_version, :release_stage, :endpoint, :use_ssl,
11
- :proxy_host, :proxy_port, :proxy_user, :proxy_password].each do |param|
12
- unless opts[param].nil?
13
- configuration.send :"#{param}=", opts[param]
14
- end
15
- end
16
-
17
- endpoint = (configuration.use_ssl ? "https://" : "http://") + configuration.endpoint + "/deploy"
18
-
19
- parameters = {
20
- "apiKey" => configuration.api_key,
21
- "releaseStage" => configuration.release_stage,
22
- "appVersion" => configuration.app_version,
23
- "revision" => opts[:revision],
24
- "repository" => opts[:repository],
25
- "branch" => opts[:branch]
26
- }.reject {|k,v| v == nil}
27
-
28
- raise RuntimeError.new("No API key found when notifying of deploy") if !parameters["apiKey"] || parameters["apiKey"].empty?
29
-
30
- payload_string = ::JSON.dump(parameters)
31
- Bugsnag::Delivery::Synchronous.deliver(endpoint, payload_string, configuration)
32
- end
33
- end
34
- end
@@ -1,28 +0,0 @@
1
- require 'mailman'
2
-
3
- module Bugsnag
4
- class Mailman
5
- def call(mail)
6
- begin
7
-
8
- Bugsnag.set_request_data :mailman_msg, mail.to_s
9
-
10
- yield
11
- rescue Exception => ex
12
- raise ex if [Interrupt, SystemExit, SignalException].include? ex.class
13
- Bugsnag.auto_notify(ex)
14
- raise
15
- ensure
16
- Bugsnag.clear_request_data
17
- end
18
- end
19
- end
20
- end
21
-
22
-
23
- if Mailman.config.respond_to?(:middleware)
24
- Mailman.config.middleware.add ::Bugsnag::Mailman
25
- end
26
-
27
- Bugsnag.configuration.internal_middleware.use(Bugsnag::Middleware::Mailman)
28
- Bugsnag.configuration.app_type = "mailman"
@@ -1,52 +0,0 @@
1
- module Bugsnag::Middleware
2
- class Rails2Request
3
- def initialize(bugsnag)
4
- @bugsnag = bugsnag
5
- end
6
-
7
- def call(notification)
8
- if notification.request_data[:rails2_request]
9
- request = notification.request_data[:rails2_request]
10
- params = request.parameters || {}
11
- session_data = request.session.respond_to?(:to_hash) ? request.session.to_hash : request.session.data
12
-
13
- # Set the context
14
- notification.context = "#{params[:controller]}##{params[:action]}"
15
-
16
- # Set a sensible default for user_id
17
- notification.user_id = request.remote_ip if request.respond_to?(:remote_ip)
18
-
19
- # Build the clean url
20
- url = "#{request.protocol}#{request.host}"
21
- url << ":#{request.port}" unless [80, 443].include?(request.port)
22
- url << Bugsnag::Cleaner.new(notification.configuration.params_filters).clean_url(request.fullpath)
23
-
24
- # Add a request tab
25
- notification.add_tab(:request, {
26
- :url => url,
27
- :params => params.to_hash,
28
- :controller => params[:controller],
29
- :action => params[:action]
30
- })
31
-
32
- # Add an environment tab
33
- if request.env && notification.configuration.send_environment
34
- notification.add_tab(:environment, request.env)
35
- end
36
-
37
- # Add a session tab
38
- notification.add_tab(:session, session_data) if session_data
39
-
40
- # Add a cookies tab
41
- notification.add_tab(:cookies, request.cookies) if request.cookies
42
-
43
- # Add the rails version
44
- notification.add_tab(:environment, {
45
- :railsVersion => Rails::VERSION::STRING
46
- })
47
- end
48
-
49
- @bugsnag.call(notification)
50
- end
51
- end
52
- end