bugsnag 1.4.2 → 1.5.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.
@@ -1,8 +1,13 @@
1
1
  language: ruby
2
+
2
3
  rvm:
3
4
  - 1.9.3
4
5
  - jruby-18mode
5
6
  - jruby-19mode
6
7
  - rbx-18mode
7
8
  - rbx-19mode
8
- - 1.8.7
9
+ - 1.8.7
10
+
11
+ notifications:
12
+ hipchat:
13
+ secure: "OLw2B1ggBDSeyJYgnZ2Ezf2fXbu5BHWSNFEJF38+TB4hYv+Wp3rElROhnyP6IttftLYz68Q8n9SjEUXTX9zXwTNt2fGBHIDwLnjt1uw7BrIOIHCUheOJdPheV2XxdJv9yem5MQ0vF+y33auLpyrA53b+nCbI5UsCXKISLe+C8ME="
data/README.md CHANGED
@@ -49,6 +49,9 @@ How to Install
49
49
  end
50
50
  ```
51
51
 
52
+ If you don't configure the api_key, the Bugsnag module will read the `BUGSNAG_API_KEY`
53
+ environment variable.
54
+
52
55
  4. **Rack/Sinatra apps only**: Activate the Bugsnag Rack middleware
53
56
 
54
57
  ```ruby
@@ -323,6 +326,38 @@ config.ignore_user_agents << %r{Chrome}
323
326
  By default, `ignore_user_agents` is empty, so exceptions caused by all
324
327
  user agents are reported.
325
328
 
329
+ ###proxy_host
330
+
331
+ Sets the address of the HTTP proxy that should be used for requests to bugsnag.
332
+
333
+ ```ruby
334
+ config.proxy_host = "10.10.10.10"
335
+ ```
336
+
337
+ ###proxy_port
338
+
339
+ Sets the port of the HTTP proxy that should be used for requests to bugsnag.
340
+
341
+ ```ruby
342
+ config.proxy_port = 1089
343
+ ```
344
+
345
+ ###proxy_user
346
+
347
+ Sets the user that should be used to send requests to the HTTP proxy for requests to bugsnag.
348
+
349
+ ```ruby
350
+ config.proxy_user = "proxy_user"
351
+ ```
352
+
353
+ ###proxy_password
354
+
355
+ Sets the password for the user that should be used to send requests to the HTTP proxy for requests to bugsnag.
356
+
357
+ ```ruby
358
+ config.proxy_password = "proxy_secret_password_here"
359
+ ```
360
+
326
361
  ###logger
327
362
 
328
363
  Sets which logger to use for Bugsnag log messages. In rails apps, this is
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.2
1
+ 1.5.0
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = "bugsnag"
8
- s.version = "1.4.2"
7
+ s.name = %q{bugsnag}
8
+ s.version = "1.5.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["James Smith"]
12
- s.date = "2013-08-06"
13
- s.description = "Ruby notifier for bugsnag.com"
14
- s.email = "james@bugsnag.com"
12
+ s.date = %q{2013-08-19}
13
+ s.description = %q{Ruby notifier for bugsnag.com}
14
+ s.email = %q{james@bugsnag.com}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
17
  "README.md"
@@ -60,31 +60,32 @@ Gem::Specification.new do |s|
60
60
  "spec/rack_spec.rb",
61
61
  "spec/spec_helper.rb"
62
62
  ]
63
- s.homepage = "http://github.com/bugsnag/bugsnag-ruby"
63
+ s.homepage = %q{http://github.com/bugsnag/bugsnag-ruby}
64
64
  s.licenses = ["MIT"]
65
65
  s.require_paths = ["lib"]
66
- s.rubygems_version = "1.8.24"
67
- s.summary = "Ruby notifier for bugsnag.com"
66
+ s.rubygems_version = %q{1.3.6}
67
+ s.summary = %q{Ruby notifier for bugsnag.com}
68
68
 
69
69
  if s.respond_to? :specification_version then
70
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
70
71
  s.specification_version = 3
71
72
 
72
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
73
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
73
74
  s.add_runtime_dependency(%q<multi_json>, ["~> 1.0"])
74
- s.add_runtime_dependency(%q<httparty>, ["< 1.0", ">= 0.6"])
75
+ s.add_runtime_dependency(%q<httparty>, [">= 0.6", "< 1.0"])
75
76
  s.add_development_dependency(%q<rspec>, ["~> 2.11.0"])
76
77
  s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
77
78
  s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
78
79
  else
79
80
  s.add_dependency(%q<multi_json>, ["~> 1.0"])
80
- s.add_dependency(%q<httparty>, ["< 1.0", ">= 0.6"])
81
+ s.add_dependency(%q<httparty>, [">= 0.6", "< 1.0"])
81
82
  s.add_dependency(%q<rspec>, ["~> 2.11.0"])
82
83
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
83
84
  s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
84
85
  end
85
86
  else
86
87
  s.add_dependency(%q<multi_json>, ["~> 1.0"])
87
- s.add_dependency(%q<httparty>, ["< 1.0", ">= 0.6"])
88
+ s.add_dependency(%q<httparty>, [">= 0.6", "< 1.0"])
88
89
  s.add_dependency(%q<rspec>, ["~> 2.11.0"])
89
90
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
90
91
  s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
@@ -19,6 +19,10 @@ module Bugsnag
19
19
  attr_accessor :middleware
20
20
  attr_accessor :delay_with_resque
21
21
  attr_accessor :debug
22
+ attr_accessor :proxy_host
23
+ attr_accessor :proxy_port
24
+ attr_accessor :proxy_user
25
+ attr_accessor :proxy_password
22
26
 
23
27
  THREAD_LOCAL_NAME = "bugsnag_req_data"
24
28
 
@@ -40,8 +44,6 @@ module Bugsnag
40
44
 
41
45
  def initialize
42
46
  # Set up the defaults
43
- self.release_stage = nil
44
- self.notify_release_stages = nil
45
47
  self.auto_notify = true
46
48
  self.use_ssl = false
47
49
  self.params_filters = Set.new(DEFAULT_PARAMS_FILTERS)
@@ -49,6 +51,9 @@ module Bugsnag
49
51
  self.ignore_user_agents = Set.new(DEFAULT_IGNORE_USER_AGENTS)
50
52
  self.endpoint = DEFAULT_ENDPOINT
51
53
 
54
+ # Read the API key from the environment
55
+ self.api_key = ENV["BUGSNAG_API_KEY"]
56
+
52
57
  # Set up logging
53
58
  self.logger = Logger.new(STDOUT)
54
59
  self.logger.level = Logger::WARN
@@ -79,6 +79,8 @@ module Bugsnag
79
79
  ex = nil
80
80
  end
81
81
  end
82
+
83
+ self.class.http_proxy configuration.proxy_host, configuration.proxy_port, configuration.proxy_user, configuration.proxy_password if configuration.proxy_host
82
84
  end
83
85
 
84
86
  # Add a single value as custom data, to this notification
@@ -31,6 +31,21 @@ describe Bugsnag::Notification do
31
31
  Bugsnag.notify(BugsnagTestException.new("It crashed"))
32
32
  end
33
33
 
34
+ it "should use the env variable apiKey" do
35
+ ENV["BUGSNAG_API_KEY"] = "c9d60ae4c7e70c4b6c4ebd3e8056d2b9"
36
+
37
+ Bugsnag.instance_variable_set(:@configuration, Bugsnag::Configuration.new)
38
+ Bugsnag.configure do |config|
39
+ config.release_stage = "production"
40
+ end
41
+
42
+ Bugsnag::Notification.should_receive(:deliver_exception_payload) do |endpoint, payload|
43
+ payload[:apiKey].should be == "c9d60ae4c7e70c4b6c4ebd3e8056d2b9"
44
+ end
45
+
46
+ Bugsnag.notify(BugsnagTestException.new("It crashed"))
47
+ end
48
+
34
49
  it "should have the right exception class" do
35
50
  Bugsnag::Notification.should_receive(:deliver_exception_payload) do |endpoint, payload|
36
51
  exception = get_exception_from_payload(payload)
@@ -507,4 +522,56 @@ describe Bugsnag::Notification do
507
522
 
508
523
  Bugsnag.notify(ex)
509
524
  end
525
+
526
+ it "should use a proxy host if configured" do
527
+ Bugsnag.configure do |config|
528
+ config.proxy_host = "host_name"
529
+ end
530
+
531
+ Bugsnag::Notification.should_receive(:http_proxy) do |*args|
532
+ args.length.should be == 4
533
+ args[0].should be == "host_name"
534
+ args[1].should be == nil
535
+ args[2].should be == nil
536
+ args[3].should be == nil
537
+ end
538
+
539
+ Bugsnag.notify("test message")
540
+ end
541
+
542
+ it "should use a proxy host/port if configured" do
543
+ Bugsnag.configure do |config|
544
+ config.proxy_host = "host_name"
545
+ config.proxy_port = 1234
546
+ end
547
+
548
+ Bugsnag::Notification.should_receive(:http_proxy) do |*args|
549
+ args.length.should be == 4
550
+ args[0].should be == "host_name"
551
+ args[1].should be == 1234
552
+ args[2].should be == nil
553
+ args[3].should be == nil
554
+ end
555
+
556
+ Bugsnag.notify("test message")
557
+ end
558
+
559
+ it "should use a proxy host/port/user/pass if configured" do
560
+ Bugsnag.configure do |config|
561
+ config.proxy_host = "host_name"
562
+ config.proxy_port = 1234
563
+ config.proxy_user = "user"
564
+ config.proxy_password = "password"
565
+ end
566
+
567
+ Bugsnag::Notification.should_receive(:http_proxy) do |*args|
568
+ args.length.should be == 4
569
+ args[0].should be == "host_name"
570
+ args[1].should be == 1234
571
+ args[2].should be == "user"
572
+ args[3].should be == "password"
573
+ end
574
+
575
+ Bugsnag.notify("test message")
576
+ end
510
577
  end
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bugsnag
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
5
- prerelease:
4
+ prerelease: false
6
5
  segments:
7
6
  - 1
8
- - 4
9
- - 2
10
- version: 1.4.2
7
+ - 5
8
+ - 0
9
+ version: 1.5.0
11
10
  platform: ruby
12
11
  authors:
13
12
  - James Smith
@@ -15,92 +14,82 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2013-08-06 00:00:00 Z
17
+ date: 2013-08-19 00:00:00 -07:00
18
+ default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- requirement: &id001 !ruby/object:Gem::Requirement
22
- none: false
21
+ prerelease: false
22
+ type: :runtime
23
+ name: multi_json
24
+ version_requirements: &id001 !ruby/object:Gem::Requirement
23
25
  requirements:
24
26
  - - ~>
25
27
  - !ruby/object:Gem::Version
26
- hash: 15
27
28
  segments:
28
29
  - 1
29
30
  - 0
30
31
  version: "1.0"
31
- type: :runtime
32
- version_requirements: *id001
33
- name: multi_json
34
- prerelease: false
32
+ requirement: *id001
35
33
  - !ruby/object:Gem::Dependency
36
- requirement: &id002 !ruby/object:Gem::Requirement
37
- none: false
34
+ prerelease: false
35
+ type: :runtime
36
+ name: httparty
37
+ version_requirements: &id002 !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - <
40
- - !ruby/object:Gem::Version
41
- hash: 15
42
- segments:
43
- - 1
44
- - 0
45
- version: "1.0"
46
39
  - - ">="
47
40
  - !ruby/object:Gem::Version
48
- hash: 7
49
41
  segments:
50
42
  - 0
51
43
  - 6
52
44
  version: "0.6"
53
- type: :runtime
54
- version_requirements: *id002
55
- name: httparty
56
- prerelease: false
45
+ - - <
46
+ - !ruby/object:Gem::Version
47
+ segments:
48
+ - 1
49
+ - 0
50
+ version: "1.0"
51
+ requirement: *id002
57
52
  - !ruby/object:Gem::Dependency
58
- requirement: &id003 !ruby/object:Gem::Requirement
59
- none: false
53
+ prerelease: false
54
+ type: :development
55
+ name: rspec
56
+ version_requirements: &id003 !ruby/object:Gem::Requirement
60
57
  requirements:
61
58
  - - ~>
62
59
  - !ruby/object:Gem::Version
63
- hash: 35
64
60
  segments:
65
61
  - 2
66
62
  - 11
67
63
  - 0
68
64
  version: 2.11.0
69
- type: :development
70
- version_requirements: *id003
71
- name: rspec
72
- prerelease: false
65
+ requirement: *id003
73
66
  - !ruby/object:Gem::Dependency
74
- requirement: &id004 !ruby/object:Gem::Requirement
75
- none: false
67
+ prerelease: false
68
+ type: :development
69
+ name: rdoc
70
+ version_requirements: &id004 !ruby/object:Gem::Requirement
76
71
  requirements:
77
72
  - - ~>
78
73
  - !ruby/object:Gem::Version
79
- hash: 31
80
74
  segments:
81
75
  - 3
82
76
  - 12
83
77
  version: "3.12"
84
- type: :development
85
- version_requirements: *id004
86
- name: rdoc
87
- prerelease: false
78
+ requirement: *id004
88
79
  - !ruby/object:Gem::Dependency
89
- requirement: &id005 !ruby/object:Gem::Requirement
90
- none: false
80
+ prerelease: false
81
+ type: :development
82
+ name: jeweler
83
+ version_requirements: &id005 !ruby/object:Gem::Requirement
91
84
  requirements:
92
85
  - - ~>
93
86
  - !ruby/object:Gem::Version
94
- hash: 63
95
87
  segments:
96
88
  - 1
97
89
  - 8
98
90
  - 4
99
91
  version: 1.8.4
100
- type: :development
101
- version_requirements: *id005
102
- name: jeweler
103
- prerelease: false
92
+ requirement: *id005
104
93
  description: Ruby notifier for bugsnag.com
105
94
  email: james@bugsnag.com
106
95
  executables: []
@@ -153,6 +142,7 @@ files:
153
142
  - spec/notification_spec.rb
154
143
  - spec/rack_spec.rb
155
144
  - spec/spec_helper.rb
145
+ has_rdoc: true
156
146
  homepage: http://github.com/bugsnag/bugsnag-ruby
157
147
  licenses:
158
148
  - MIT
@@ -162,27 +152,23 @@ rdoc_options: []
162
152
  require_paths:
163
153
  - lib
164
154
  required_ruby_version: !ruby/object:Gem::Requirement
165
- none: false
166
155
  requirements:
167
156
  - - ">="
168
157
  - !ruby/object:Gem::Version
169
- hash: 3
170
158
  segments:
171
159
  - 0
172
160
  version: "0"
173
161
  required_rubygems_version: !ruby/object:Gem::Requirement
174
- none: false
175
162
  requirements:
176
163
  - - ">="
177
164
  - !ruby/object:Gem::Version
178
- hash: 3
179
165
  segments:
180
166
  - 0
181
167
  version: "0"
182
168
  requirements: []
183
169
 
184
170
  rubyforge_project:
185
- rubygems_version: 1.8.24
171
+ rubygems_version: 1.3.6
186
172
  signing_key:
187
173
  specification_version: 3
188
174
  summary: Ruby notifier for bugsnag.com