bugsnag 1.2.5 → 1.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bugsnag.gemspec +2 -2
- data/lib/bugsnag/capistrano.rb +9 -8
- data/lib/bugsnag/middleware_stack.rb +3 -3
- data/lib/bugsnag/rack.rb +2 -1
- data/lib/bugsnag/rails/action_controller_rescue.rb +2 -6
- data/lib/bugsnag/railtie.rb +2 -6
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.6
|
data/bugsnag.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "bugsnag"
|
8
|
-
s.version = "1.2.
|
8
|
+
s.version = "1.2.6"
|
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 = "2012-
|
12
|
+
s.date = "2012-12-02"
|
13
13
|
s.description = "Ruby notifier for bugsnag.com"
|
14
14
|
s.email = "james@bugsnag.com"
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/bugsnag/capistrano.rb
CHANGED
@@ -14,17 +14,18 @@ module Bugsnag
|
|
14
14
|
desc "Notify Bugsnag that new production code has been deployed"
|
15
15
|
task :deploy, :except => { :no_release => true }, :on_error => :continue do
|
16
16
|
# Build the rake command
|
17
|
-
rake
|
18
|
-
rails_env
|
19
|
-
|
17
|
+
rake = fetch(:rake, "rake")
|
18
|
+
rails_env = fetch(:rails_env, "production")
|
19
|
+
bugsnag_env = fetch(:bugsnag_env, rails_env)
|
20
|
+
rake_command = "cd '#{current_path}' && RAILS_ENV=#{rails_env} #{rake} bugsnag:deploy"
|
20
21
|
|
21
22
|
# Build the new environment to pass through to rake
|
22
23
|
new_env = {
|
23
|
-
"BUGSNAG_RELEASE_STAGE" =>
|
24
|
-
"BUGSNAG_REVISION"
|
25
|
-
"BUGSNAG_REPOSITORY"
|
26
|
-
"BUGSNAG_BRANCH"
|
27
|
-
}.reject {|
|
24
|
+
"BUGSNAG_RELEASE_STAGE" => bugsnag_env,
|
25
|
+
"BUGSNAG_REVISION" => fetch(:current_revision, nil),
|
26
|
+
"BUGSNAG_REPOSITORY" => fetch(:repository, nil),
|
27
|
+
"BUGSNAG_BRANCH" => fetch(:branch, nil)
|
28
|
+
}.reject { |_, v| v.nil? }
|
28
29
|
|
29
30
|
# Pass through any existing env variables
|
30
31
|
ALLOWED_ENV_SETTINGS.each { |opt| new_env[opt] = ENV[opt] if ENV[opt] }
|
@@ -13,11 +13,11 @@ module Bugsnag
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def insert_after(after, new_middleware)
|
16
|
-
index =
|
17
|
-
if index
|
16
|
+
index = @middlewares.rindex(after)
|
17
|
+
if index.nil?
|
18
18
|
@middlewares << new_middleware
|
19
19
|
else
|
20
|
-
@middlewares.insert index, new_middleware
|
20
|
+
@middlewares.insert index + 1, new_middleware
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
data/lib/bugsnag/rack.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "bugsnag/middleware/rack_request"
|
2
2
|
require "bugsnag/middleware/warden_user"
|
3
3
|
require "bugsnag/middleware/callbacks"
|
4
|
+
require "bugsnag/middleware/rails3_request"
|
4
5
|
|
5
6
|
module Bugsnag
|
6
7
|
class Rack
|
@@ -22,7 +23,7 @@ module Bugsnag
|
|
22
23
|
end
|
23
24
|
|
24
25
|
# Hook up rack-based notification middlewares
|
25
|
-
config.middleware.
|
26
|
+
config.middleware.insert_before(Bugsnag::Middleware::Rails3Request, Bugsnag::Middleware::RackRequest) if defined?(::Rack)
|
26
27
|
config.middleware.use Bugsnag::Middleware::WardenUser if defined?(Warden)
|
27
28
|
end
|
28
29
|
end
|
@@ -10,17 +10,13 @@ module Bugsnag::Rails
|
|
10
10
|
base.send(:alias_method, :rescue_action_locally, :rescue_action_locally_with_bugsnag)
|
11
11
|
|
12
12
|
# Run filters on requests to capture request data
|
13
|
-
base.send(:
|
14
|
-
base.send(:after_filter, :clear_bugsnag_request_data)
|
13
|
+
base.send(:prepend_before_filter, :set_bugsnag_request_data)
|
15
14
|
end
|
16
15
|
|
17
16
|
private
|
18
17
|
def set_bugsnag_request_data
|
19
|
-
Bugsnag.set_request_data(:rails2_request, request)
|
20
|
-
end
|
21
|
-
|
22
|
-
def clear_bugsnag_request_data
|
23
18
|
Bugsnag.clear_request_data
|
19
|
+
Bugsnag.set_request_data(:rails2_request, request)
|
24
20
|
end
|
25
21
|
|
26
22
|
def rescue_action_in_public_with_bugsnag(exception)
|
data/lib/bugsnag/railtie.rb
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
require "rails"
|
4
4
|
require "bugsnag"
|
5
5
|
require "bugsnag/middleware/rails3_request"
|
6
|
+
require "bugsnag/middleware/rack_request"
|
6
7
|
|
7
8
|
module Bugsnag
|
8
9
|
class Railtie < Rails::Railtie
|
@@ -17,6 +18,7 @@ module Bugsnag
|
|
17
18
|
config.release_stage = Rails.env.to_s
|
18
19
|
config.project_root = Rails.root.to_s
|
19
20
|
config.params_filters += Rails.configuration.filter_parameters
|
21
|
+
config.middleware.insert_after Bugsnag::Middleware::RackRequest, Bugsnag::Middleware::Rails3Request
|
20
22
|
end
|
21
23
|
|
22
24
|
# Auto-load configuration settings from config/bugsnag.yml if it exists
|
@@ -37,11 +39,5 @@ module Bugsnag
|
|
37
39
|
app.config.middleware.use "Bugsnag::Rack"
|
38
40
|
end
|
39
41
|
end
|
40
|
-
|
41
|
-
config.after_initialize do
|
42
|
-
Bugsnag.configure do |config|
|
43
|
-
config.middleware.use Bugsnag::Middleware::Rails3Request
|
44
|
-
end
|
45
|
-
end
|
46
42
|
end
|
47
43
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bugsnag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 6
|
10
|
+
version: 1.2.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- James Smith
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-12-02 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
requirement: &id001 !ruby/object:Gem::Requirement
|