bugsnag 1.7.0 → 1.8.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea271d0d36a02d47b465c7a9fccd390cec2f447a
4
- data.tar.gz: aa1f7cacb476081242d3969624ac9b52dcf613f1
3
+ metadata.gz: bf8c0fe6917926d4d428f338c52fc186d1f8ee5d
4
+ data.tar.gz: 036c41b693442bf0538a10c39a23c6f63035af68
5
5
  SHA512:
6
- metadata.gz: 920c18c4fa6679f2a0b7f9609ca542100734fd113fb4fc624d7960c32cf029d6f2b1950fab1ee0ae5bc55cbc5be7b4fc4ed05cccf20993ac06031ed47122e25a
7
- data.tar.gz: 89acbdf699198a962b65c51e6935459a7310ce30581ee7f35e2963ccd799b03615b986505d768a4a6144a7b817fe3f700541250695f00bb5f77c7ad86a46c457
6
+ metadata.gz: fc81f6071dd7064a9fa916440d0c44858a830d4ef516fb401ab186fac1bf0b57df767efd1c43dc7acd1dacb065f2217514abeea5916aed3e70d6f0eadb0f7ef9
7
+ data.tar.gz: 9b5acfbc17863ef59e5e67730e14f702b17dfe6c163d8c4d648d8db5dd8288162fe14972a75805222dc36d1c8a37b3c74d5dabaf2ec98eb579a14f2217dc7622
data/.gitignore ADDED
@@ -0,0 +1,51 @@
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
+ # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
20
+ #
21
+ # * Create a file at ~/.gitignore
22
+ # * Include files you want ignored
23
+ # * Run: git config --global core.excludesfile ~/.gitignore
24
+ #
25
+ # After doing this, these files will be ignored in all your git projects,
26
+ # saving you from having to 'pollute' every project you touch with them
27
+ #
28
+ # 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)
29
+ #
30
+ # For MacOS:
31
+ #
32
+ #.DS_Store
33
+
34
+ # For TextMate
35
+ #*.tmproj
36
+ #tmtags
37
+
38
+ # For emacs:
39
+ #*~
40
+ #\#*
41
+ #.\#*
42
+
43
+ # For vim:
44
+ #*.swp
45
+
46
+ # For redcar:
47
+ #.redcar
48
+
49
+ # For rubinius:
50
+ #*.rbc
51
+ bin
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ 1.8.0
5
+ -----
6
+ - Move away from Jeweler
7
+ - Support for Exception#cause in ruby 2.1.0
8
+
4
9
  1.7.0
5
10
  -----
6
11
  - Allow users to configure app type
data/Gemfile CHANGED
@@ -1,14 +1,2 @@
1
- source "http://rubygems.org"
2
- # Add dependencies required to use your gem here.
3
- # Example:
4
- # gem "activesupport", ">= 2.3.5"
5
- gem "multi_json", "~> 1.0"
6
- gem "httparty", ">= 0.6", "< 1.0"
7
-
8
- # Add dependencies to develop your gem here.
9
- # Include everything needed to run rake, tests, features, etc.
10
- group :development do
11
- gem "rspec", "~> 2.11.0"
12
- gem "rdoc", "~> 3.12"
13
- gem "jeweler", "~> 1.8.4"
14
- end
1
+ source "https://rubygems.org"
2
+ gemspec
data/README.md CHANGED
@@ -406,6 +406,16 @@ automatically set to use `Rails.logger`, otherwise it will be set to
406
406
  Provides access to the middleware stack, see the
407
407
  [Bugsnag Middleware](#bugsnag-middleware) section below for details.
408
408
 
409
+ ###app_type
410
+
411
+ You can set the type of application executing the current code by using `app_type`:
412
+
413
+ ```ruby
414
+ config.app_type = "resque"
415
+ ```
416
+
417
+ This is usually used to represent if you are running in a Rails server, Sidekiq job or
418
+ Rake task for example. Bugsnag will automatically detect most application types for you.
409
419
 
410
420
  Bugsnag Middleware
411
421
  ------------------
data/Rakefile CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'rubygems'
4
4
  require 'bundler'
5
+ require 'bundler/gem_tasks'
5
6
  begin
6
7
  Bundler.setup(:default, :development)
7
8
  rescue Bundler::BundlerError => e
@@ -9,20 +10,6 @@ rescue Bundler::BundlerError => e
9
10
  $stderr.puts "Run `bundle install` to install missing gems"
10
11
  exit e.status_code
11
12
  end
12
- require 'rake'
13
-
14
- require 'jeweler'
15
- Jeweler::Tasks.new do |gem|
16
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
- gem.name = "bugsnag"
18
- gem.homepage = "http://github.com/bugsnag/bugsnag-ruby"
19
- gem.license = "MIT"
20
- gem.summary = %Q{Ruby notifier for bugsnag.com}
21
- gem.description = %Q{Ruby notifier for bugsnag.com}
22
- gem.email = "james@bugsnag.com"
23
- gem.authors = ["James Smith"]
24
- end
25
- Jeweler::RubygemsDotOrgTasks.new
26
13
 
27
14
  require 'rdoc/task'
28
15
  RDoc::Task.new do |rdoc|
@@ -41,4 +28,4 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
41
28
  spec.pattern = FileList['spec/**/*_spec.rb']
42
29
  end
43
30
 
44
- task :default => :spec
31
+ task :default => :spec
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.0
1
+ 1.8.0
data/bugsnag.gemspec CHANGED
@@ -1,95 +1,27 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
5
-
6
1
  Gem::Specification.new do |s|
7
2
  s.name = "bugsnag"
8
- s.version = "1.7.0"
3
+ s.version = File.read("VERSION").strip
9
4
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
5
  s.authors = ["James Smith"]
12
- s.date = "2013-12-17"
13
- s.description = "Ruby notifier for bugsnag.com"
14
6
  s.email = "james@bugsnag.com"
7
+
8
+ s.description = "Ruby notifier for bugsnag.com"
9
+ s.summary = "Ruby notifier for bugsnag.com"
10
+ s.homepage = "http://github.com/bugsnag/bugsnag-ruby"
11
+ s.licenses = ["MIT"]
12
+
13
+ s.files = `git ls-files`.split("\n")
15
14
  s.extra_rdoc_files = [
16
15
  "LICENSE.txt",
17
16
  "README.md"
18
17
  ]
19
- s.files = [
20
- ".document",
21
- ".rspec",
22
- ".travis.yml",
23
- "CHANGELOG.md",
24
- "Gemfile",
25
- "Gemfile.lock",
26
- "LICENSE.txt",
27
- "README.md",
28
- "Rakefile",
29
- "VERSION",
30
- "bugsnag.gemspec",
31
- "lib/bugsnag.rb",
32
- "lib/bugsnag/capistrano.rb",
33
- "lib/bugsnag/configuration.rb",
34
- "lib/bugsnag/delay/resque.rb",
35
- "lib/bugsnag/helpers.rb",
36
- "lib/bugsnag/mailman.rb",
37
- "lib/bugsnag/meta_data.rb",
38
- "lib/bugsnag/middleware/callbacks.rb",
39
- "lib/bugsnag/middleware/rack_request.rb",
40
- "lib/bugsnag/middleware/rails2_request.rb",
41
- "lib/bugsnag/middleware/rails3_request.rb",
42
- "lib/bugsnag/middleware/warden_user.rb",
43
- "lib/bugsnag/middleware_stack.rb",
44
- "lib/bugsnag/notification.rb",
45
- "lib/bugsnag/rack.rb",
46
- "lib/bugsnag/rails.rb",
47
- "lib/bugsnag/rails/action_controller_rescue.rb",
48
- "lib/bugsnag/rails/active_record_rescue.rb",
49
- "lib/bugsnag/rails/controller_methods.rb",
50
- "lib/bugsnag/railtie.rb",
51
- "lib/bugsnag/rake.rb",
52
- "lib/bugsnag/resque.rb",
53
- "lib/bugsnag/sidekiq.rb",
54
- "lib/bugsnag/tasks.rb",
55
- "lib/bugsnag/tasks/bugsnag.rake",
56
- "lib/bugsnag/version.rb",
57
- "lib/generators/bugsnag/bugsnag_generator.rb",
58
- "rails/init.rb",
59
- "spec/helper_spec.rb",
60
- "spec/middleware_spec.rb",
61
- "spec/notification_spec.rb",
62
- "spec/rack_spec.rb",
63
- "spec/spec_helper.rb"
64
- ]
65
- s.homepage = "http://github.com/bugsnag/bugsnag-ruby"
66
- s.licenses = ["MIT"]
67
18
  s.require_paths = ["lib"]
68
- s.rubygems_version = "2.0.3"
69
- s.summary = "Ruby notifier for bugsnag.com"
70
19
 
71
- if s.respond_to? :specification_version then
72
- s.specification_version = 4
20
+ s.add_runtime_dependency 'multi_json', ["~> 1.0"]
21
+ s.add_runtime_dependency 'httparty', ["< 1.0", ">= 0.6"]
73
22
 
74
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
75
- s.add_runtime_dependency(%q<multi_json>, ["~> 1.0"])
76
- s.add_runtime_dependency(%q<httparty>, ["< 1.0", ">= 0.6"])
77
- s.add_development_dependency(%q<rspec>, ["~> 2.11.0"])
78
- s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
79
- s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
80
- else
81
- s.add_dependency(%q<multi_json>, ["~> 1.0"])
82
- s.add_dependency(%q<httparty>, ["< 1.0", ">= 0.6"])
83
- s.add_dependency(%q<rspec>, ["~> 2.11.0"])
84
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
85
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
86
- end
87
- else
88
- s.add_dependency(%q<multi_json>, ["~> 1.0"])
89
- s.add_dependency(%q<httparty>, ["< 1.0", ">= 0.6"])
90
- s.add_dependency(%q<rspec>, ["~> 2.11.0"])
91
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
92
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
93
- end
23
+ s.add_development_dependency 'rspec'
24
+ s.add_development_dependency 'rdoc'
25
+ s.add_development_dependency 'rake'
94
26
  end
95
27
 
@@ -77,7 +77,9 @@ module Bugsnag
77
77
 
78
78
  @exceptions << ex
79
79
 
80
- if ex.respond_to?(:continued_exception) && ex.continued_exception
80
+ if ex.respond_to?(:cause) && ex.cause
81
+ ex = ex.cause
82
+ elsif ex.respond_to?(:continued_exception) && ex.continued_exception
81
83
  ex = ex.continued_exception
82
84
  elsif ex.respond_to?(:original_exception) && ex.original_exception
83
85
  ex = ex.original_exception
@@ -6,6 +6,15 @@ module ActiveRecord; class RecordNotFound < RuntimeError; end; end
6
6
  class NestedException < StandardError; attr_accessor :original_exception; end
7
7
  class BugsnagTestExceptionWithMetaData < Exception; include Bugsnag::MetaData; end
8
8
 
9
+ class Ruby21Exception < RuntimeError
10
+ attr_accessor :cause
11
+ def self.raise!(msg)
12
+ e = new(msg)
13
+ e.cause = $!
14
+ raise e
15
+ end
16
+ end
17
+
9
18
  describe Bugsnag::Notification do
10
19
  it "should contain an api_key if one is set" do
11
20
  Bugsnag::Notification.should_receive(:deliver_exception_payload) do |endpoint, payload|
@@ -467,6 +476,23 @@ describe Bugsnag::Notification do
467
476
  Bugsnag.notify_or_ignore(BugsnagTestException.new("It crashed"))
468
477
  end
469
478
 
479
+ it "should send the cause of the exception" do
480
+ Bugsnag::Notification.should_receive(:deliver_exception_payload) do |endpoint, payload|
481
+ event = get_event_from_payload(payload)
482
+ event[:exceptions].should have(2).items
483
+ end
484
+
485
+ begin
486
+ begin
487
+ raise "jiminey"
488
+ rescue
489
+ Ruby21Exception.raise! "cricket"
490
+ end
491
+ rescue
492
+ Bugsnag.notify $!
493
+ end
494
+ end
495
+
470
496
  it "should not unwrap the same exception twice" do
471
497
  Bugsnag::Notification.should_receive(:deliver_exception_payload) do |endpoint, payload|
472
498
  event = get_event_from_payload(payload)
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: 1.7.0
4
+ version: 1.8.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: 2013-12-17 00:00:00.000000000 Z
11
+ date: 2013-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -48,44 +48,44 @@ dependencies:
48
48
  name: rspec
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ~>
51
+ - - '>='
52
52
  - !ruby/object:Gem::Version
53
- version: 2.11.0
53
+ version: '0'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ~>
58
+ - - '>='
59
59
  - !ruby/object:Gem::Version
60
- version: 2.11.0
60
+ version: '0'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: rdoc
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - ~>
65
+ - - '>='
66
66
  - !ruby/object:Gem::Version
67
- version: '3.12'
67
+ version: '0'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - ~>
72
+ - - '>='
73
73
  - !ruby/object:Gem::Version
74
- version: '3.12'
74
+ version: '0'
75
75
  - !ruby/object:Gem::Dependency
76
- name: jeweler
76
+ name: rake
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ~>
79
+ - - '>='
80
80
  - !ruby/object:Gem::Version
81
- version: 1.8.4
81
+ version: '0'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ~>
86
+ - - '>='
87
87
  - !ruby/object:Gem::Version
88
- version: 1.8.4
88
+ version: '0'
89
89
  description: Ruby notifier for bugsnag.com
90
90
  email: james@bugsnag.com
91
91
  executables: []
@@ -95,11 +95,11 @@ extra_rdoc_files:
95
95
  - README.md
96
96
  files:
97
97
  - .document
98
+ - .gitignore
98
99
  - .rspec
99
100
  - .travis.yml
100
101
  - CHANGELOG.md
101
102
  - Gemfile
102
- - Gemfile.lock
103
103
  - LICENSE.txt
104
104
  - README.md
105
105
  - Rakefile
data/Gemfile.lock DELETED
@@ -1,67 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- addressable (2.3.5)
5
- builder (3.2.2)
6
- diff-lcs (1.1.3)
7
- faraday (0.8.8)
8
- multipart-post (~> 1.2.0)
9
- git (1.2.6)
10
- github_api (0.10.1)
11
- addressable
12
- faraday (~> 0.8.1)
13
- hashie (>= 1.2)
14
- multi_json (~> 1.4)
15
- nokogiri (~> 1.5.2)
16
- oauth2
17
- hashie (2.0.5)
18
- highline (1.6.19)
19
- httparty (0.10.2)
20
- multi_json (~> 1.0)
21
- multi_xml (>= 0.5.2)
22
- httpauth (0.2.0)
23
- jeweler (1.8.8)
24
- builder
25
- bundler (~> 1.0)
26
- git (>= 1.2.5)
27
- github_api (= 0.10.1)
28
- highline (>= 1.6.15)
29
- nokogiri (= 1.5.10)
30
- rake
31
- rdoc
32
- json (1.8.0)
33
- jwt (0.1.8)
34
- multi_json (>= 1.5)
35
- multi_json (1.7.2)
36
- multi_xml (0.5.3)
37
- multipart-post (1.2.0)
38
- nokogiri (1.5.10)
39
- oauth2 (0.9.2)
40
- faraday (~> 0.8)
41
- httpauth (~> 0.2)
42
- jwt (~> 0.1.4)
43
- multi_json (~> 1.0)
44
- multi_xml (~> 0.5)
45
- rack (~> 1.2)
46
- rack (1.5.2)
47
- rake (10.1.0)
48
- rdoc (3.12.2)
49
- json (~> 1.4)
50
- rspec (2.11.0)
51
- rspec-core (~> 2.11.0)
52
- rspec-expectations (~> 2.11.0)
53
- rspec-mocks (~> 2.11.0)
54
- rspec-core (2.11.1)
55
- rspec-expectations (2.11.3)
56
- diff-lcs (~> 1.1.3)
57
- rspec-mocks (2.11.3)
58
-
59
- PLATFORMS
60
- ruby
61
-
62
- DEPENDENCIES
63
- httparty (>= 0.6, < 1.0)
64
- jeweler (~> 1.8.4)
65
- multi_json (~> 1.0)
66
- rdoc (~> 3.12)
67
- rspec (~> 2.11.0)