sentry-raven 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sentry-raven might be problematic. Click here for more details.

@@ -77,6 +77,7 @@ module OkJson
77
77
  when Hash then objenc(x, visited)
78
78
  when Array then arrenc(x, visited)
79
79
  when String then strenc(x)
80
+ when Symbol then strenc(x.to_s)
80
81
  when Numeric then numenc(x)
81
82
  when true then "true"
82
83
  when false then "false"
@@ -444,6 +445,7 @@ private
444
445
  def keyenc(k)
445
446
  case k
446
447
  when String then strenc(k)
448
+ when Symbol then strenc(k.to_s)
447
449
  else
448
450
  strenc(k.inspect)
449
451
  end
@@ -1,5 +1,4 @@
1
1
  module Raven
2
-
3
2
  module Processor
4
3
  class Processor
5
4
  def initialize(client)
@@ -11,5 +10,4 @@ module Raven
11
10
  end
12
11
  end
13
12
  end
14
-
15
13
  end
@@ -8,12 +8,12 @@ module Raven
8
8
  FIELDS_RE = /(authorization|password|passwd|secret)/i
9
9
  VALUES_RE = /^\d{16}$/
10
10
 
11
- def apply(value, key=nil, visited=[], &block)
11
+ def apply(value, key = nil, visited = [], &block)
12
12
  if value.is_a?(Hash)
13
13
  return "{...}" if visited.include?(value.__id__)
14
14
  visited += [value.__id__]
15
15
 
16
- value.each.inject({}) do |memo, (k, v)|
16
+ value.each.reduce({}) do |memo, (k, v)|
17
17
  memo[k] = apply(v, k, visited, &block)
18
18
  memo
19
19
  end
@@ -32,7 +32,7 @@ module Raven
32
32
  def sanitize(key, value)
33
33
  if !value.is_a?(String) || value.empty?
34
34
  value
35
- elsif VALUES_RE.match(clean_invalid_utf8_bytes(value)) or FIELDS_RE.match(key)
35
+ elsif VALUES_RE.match(clean_invalid_utf8_bytes(value)) || FIELDS_RE.match(key)
36
36
  MASK
37
37
  else
38
38
  clean_invalid_utf8_bytes(value)
@@ -46,6 +46,7 @@ module Raven
46
46
  end
47
47
 
48
48
  private
49
+
49
50
  def clean_invalid_utf8_bytes(text)
50
51
  if RUBY_VERSION <= '1.8.7'
51
52
  text
@@ -45,7 +45,7 @@ module Raven
45
45
 
46
46
  begin
47
47
  response = @app.call(env)
48
- rescue Error => e
48
+ rescue Error
49
49
  raise # Don't capture Raven errors
50
50
  rescue Exception => e
51
51
  Raven::Rack.capture_exception(e, env)
@@ -56,9 +56,7 @@ module Raven
56
56
 
57
57
  error = env['rack.exception'] || env['sinatra.error']
58
58
 
59
- if error
60
- Raven::Rack.capture_exception(error, env)
61
- end
59
+ Raven::Rack.capture_exception(error, env) if error
62
60
 
63
61
  response
64
62
  end
@@ -34,4 +34,3 @@ module Raven
34
34
  end
35
35
  end
36
36
  end
37
-
@@ -1,18 +1,23 @@
1
1
  module Raven
2
2
  class Sidekiq
3
3
  def call(worker, msg, queue)
4
- begin
5
- yield
6
- rescue => ex
7
- Raven.capture_exception(ex, :extra => {:sidekiq => msg})
8
- raise
9
- end
4
+ yield
5
+ rescue => ex
6
+ Raven.capture_exception(ex, :extra => { :sidekiq => msg })
7
+ raise
10
8
  end
11
9
  end
12
10
  end
13
11
 
14
- ::Sidekiq.configure_server do |config|
15
- config.server_middleware do |chain|
16
- chain.add ::Raven::Sidekiq
12
+ if Sidekiq::VERSION < '3'
13
+ # old behavior
14
+ ::Sidekiq.configure_server do |config|
15
+ config.server_middleware do |chain|
16
+ chain.add ::Raven::Sidekiq
17
+ end
18
+ end
19
+ else
20
+ Sidekiq.configure_server do |config|
21
+ config.error_handlers << Proc.new {|ex,context| Raven.capture_exception(ex, context) }
17
22
  end
18
- end
23
+ end
@@ -5,9 +5,8 @@ require 'raven/cli'
5
5
  namespace :raven do
6
6
  desc "Send a test event to the remote Sentry server"
7
7
  task :test, [:dsn] do |t, args|
8
- if defined? Rails
9
- Rake::Task["environment"].invoke
10
- end
11
- Raven::CLI::test(args.dsn)
8
+ Rake::Task["environment"].invoke if defined? Rails
9
+
10
+ Raven::CLI.test(args.dsn)
12
11
  end
13
12
  end
@@ -1,9 +1,7 @@
1
1
  require 'raven/error'
2
2
 
3
3
  module Raven
4
-
5
4
  module Transports
6
-
7
5
  class Transport
8
6
 
9
7
  attr_accessor :configuration
@@ -16,7 +14,7 @@ module Raven
16
14
  raise Error.new('Abstract method not implemented')
17
15
  end
18
16
 
19
- protected
17
+ protected
20
18
 
21
19
  def verify_configuration
22
20
  raise Error.new('No server specified') unless self.configuration.server
@@ -24,9 +22,6 @@ module Raven
24
22
  raise Error.new('No secret key specified') unless self.configuration.secret_key
25
23
  raise Error.new('No project ID specified') unless self.configuration.project_id
26
24
  end
27
-
28
25
  end
29
-
30
26
  end
31
-
32
27
  end
@@ -4,9 +4,7 @@ require 'raven/transports'
4
4
  require 'raven/error'
5
5
 
6
6
  module Raven
7
-
8
7
  module Transports
9
-
10
8
  class HTTP < Transport
11
9
 
12
10
  def send(auth_header, data, options = {})
@@ -19,7 +17,7 @@ module Raven
19
17
  Raven.logger.warn "Error from Sentry server (#{response.status}): #{response.body}" unless response.status == 200
20
18
  end
21
19
 
22
- private
20
+ private
23
21
 
24
22
  def conn
25
23
  @conn ||= begin
@@ -51,9 +49,6 @@ module Raven
51
49
  def adapter
52
50
  configuration.http_adapter || Faraday.default_adapter
53
51
  end
54
-
55
52
  end
56
-
57
53
  end
58
-
59
54
  end
@@ -4,9 +4,7 @@ require 'raven/transports'
4
4
  require 'raven/error'
5
5
 
6
6
  module Raven
7
-
8
7
  module Transports
9
-
10
8
  class UDP < Transport
11
9
 
12
10
  def send(auth_header, data, options = {})
@@ -27,9 +25,6 @@ module Raven
27
25
  super
28
26
  raise Error.new('No port specified') unless self.configuration.port
29
27
  end
30
-
31
28
  end
32
-
33
29
  end
34
-
35
30
  end
@@ -1,3 +1,3 @@
1
1
  module Raven
2
- VERSION = "0.7.1"
2
+ VERSION = "0.8.0"
3
3
  end
@@ -1 +1 @@
1
- require "raven"
1
+ require "raven"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentry-raven
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-12-04 00:00:00.000000000 Z
13
+ date: 2014-04-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday
17
- requirement: &70257293798340 !ruby/object:Gem::Requirement
17
+ requirement: &70314193748940 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 0.7.6
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70257293798340
25
+ version_requirements: *70314193748940
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: uuidtools
28
- requirement: &70257293797940 !ruby/object:Gem::Requirement
28
+ requirement: &70314193747940 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70257293797940
36
+ version_requirements: *70314193747940
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: hashie
39
- requirement: &70257293797400 !ruby/object:Gem::Requirement
39
+ requirement: &70314198598820 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 1.1.0
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *70257293797400
47
+ version_requirements: *70314198598820
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rake
50
- requirement: &70257293796920 !ruby/object:Gem::Requirement
50
+ requirement: &70314198598160 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *70257293796920
58
+ version_requirements: *70314198598160
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: rspec
61
- requirement: &70257293796300 !ruby/object:Gem::Requirement
61
+ requirement: &70314198597480 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ~>
@@ -66,10 +66,21 @@ dependencies:
66
66
  version: '2.10'
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *70257293796300
69
+ version_requirements: *70314198597480
70
+ - !ruby/object:Gem::Dependency
71
+ name: mime-types
72
+ requirement: &70314198596820 !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '1.16'
78
+ type: :development
79
+ prerelease: false
80
+ version_requirements: *70314198596820
70
81
  - !ruby/object:Gem::Dependency
71
82
  name: coveralls
72
- requirement: &70257293795880 !ruby/object:Gem::Requirement
83
+ requirement: &70314198596420 !ruby/object:Gem::Requirement
73
84
  none: false
74
85
  requirements:
75
86
  - - ! '>='
@@ -77,7 +88,7 @@ dependencies:
77
88
  version: '0'
78
89
  type: :development
79
90
  prerelease: false
80
- version_requirements: *70257293795880
91
+ version_requirements: *70314198596420
81
92
  description:
82
93
  email: noah@coderanger.net
83
94
  executables:
@@ -88,6 +99,7 @@ extra_rdoc_files:
88
99
  - LICENSE
89
100
  files:
90
101
  - lib/raven/backtrace.rb
102
+ - lib/raven/base.rb
91
103
  - lib/raven/cli.rb
92
104
  - lib/raven/client.rb
93
105
  - lib/raven/configuration.rb