sentry-raven 0.15.4 → 0.15.5

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: 1c32e6b50c0d7de4f7e17c570e5e8a9bf79903d1
4
- data.tar.gz: 9be97f5863a940ff07b862be7398f33a488bf8cd
3
+ metadata.gz: 7bf4fa0f5648bc799d41aedaf83dba7cdf04d8ff
4
+ data.tar.gz: 8038cd249f6f681f9827d2de3bb2c1614d63efa9
5
5
  SHA512:
6
- metadata.gz: 38530147d817ec7c5f49859c3e498892a2fe1e85e3c034f38cf931996739b80a38af16598151507890a17072fdc0beea706146c3caaf6fca80bc6469fff76f74
7
- data.tar.gz: 6be4d40e98ff009d447ce7667afe959a269b08a002a30945f955f7efc51213af58272195b61b3903d8c12f9792e0e0da2ff68429fa59bd842110bdd3b8d618ae
6
+ metadata.gz: 824ad2ff4ca99cdb7a8b693d0fa0f764b4b9025f37394564e706dc425ddf44220689381922075267c53da1da2f33d1573ba95923c495e2e90379e8530c341484
7
+ data.tar.gz: 73715706e1ebda37bbe70a3045def94b2a0716149bc6275ee53a0e1a4dfcde260a4af33c9e7967cd9f27f0a6f3aa8ef947677c6c57c4b3f7953187ce10438629
@@ -210,7 +210,10 @@ module Raven
210
210
  end
211
211
 
212
212
  def detect_release_from_capistrano
213
- File.read(File.join(project_root, 'REVISION')).strip rescue nil
213
+ version = File.read(File.join(project_root, 'REVISION')).strip rescue nil
214
+
215
+ # Capistrano 3.0 - 3.1.x
216
+ version || File.open(File.join(project_root, '..', 'revisions.log')).to_a.last.strip.sub(/.*as release ([0-9]+).*/, '\1') rescue nil
214
217
  end
215
218
 
216
219
  def detect_release_from_git
@@ -16,10 +16,6 @@ module Delayed
16
16
  :id => job.id,
17
17
  :priority => job.priority,
18
18
  :attempts => job.attempts,
19
- # handlers are YAML objects in strings, we definitely can't
20
- # report all of that or the event will get truncated randomly
21
- :handler => job.handler[0...100],
22
- :last_error => job.last_error[0...100],
23
19
  :run_at => job.run_at,
24
20
  :locked_at => job.locked_at,
25
21
  :locked_by => job.locked_by,
@@ -27,6 +23,12 @@ module Delayed
27
23
  :created_at => job.created_at
28
24
  }
29
25
  }
26
+ # last_error can be nil
27
+ extra[:last_error] = job.last_error[0...100] if job.last_error
28
+ # handlers are YAML objects in strings, we definitely can't
29
+ # report all of that or the event will get truncated randomly
30
+ extra[:handler] = job.handler[0...100] if job.handler
31
+
30
32
  if job.respond_to?('payload_object') && job.payload_object.respond_to?('job_data')
31
33
  extra[:active_job] = job.payload_object.job_data
32
34
  end
@@ -3,7 +3,7 @@ require 'rails'
3
3
  module Raven
4
4
  class Rails < ::Rails::Railtie
5
5
  initializer "raven.use_rack_middleware" do |app|
6
- app.config.middleware.insert 0, "Raven::Rack"
6
+ app.config.middleware.insert 0, Raven::Rack
7
7
  end
8
8
 
9
9
  initializer 'raven.action_controller' do
@@ -13,7 +13,7 @@ module Raven
13
13
  end
14
14
  end
15
15
 
16
- config.after_initialize do
16
+ config.before_initialize do
17
17
  Raven.configure do |config|
18
18
  config.logger ||= ::Rails.logger
19
19
  config.project_root ||= ::Rails.root
@@ -6,9 +6,11 @@ module Raven
6
6
  base.send(:alias_method_chain, :render_exception, :raven)
7
7
  end
8
8
 
9
- def render_exception_with_raven(env, exception)
9
+ def render_exception_with_raven(env_or_request, exception)
10
+ env = env_or_request.respond_to?(:env) ? env_or_request.env : env_or_request
10
11
  Raven::Rack.capture_exception(exception, env)
11
- render_exception_without_raven(env, exception)
12
+ ensure
13
+ render_exception_without_raven(env_or_request, exception)
12
14
  end
13
15
  end
14
16
  end
data/lib/raven/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Raven
3
- VERSION = "0.15.4".freeze
3
+ VERSION = "0.15.5".freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentry-raven
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.4
4
+ version: 0.15.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sentry Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-28 00:00:00.000000000 Z
11
+ date: 2016-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday