opbeat 3.0.7 → 3.0.8
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 +4 -4
- data/.travis.yml +16 -3
- data/Gemfile +1 -2
- data/HISTORY.md +5 -0
- data/gemfiles/Gemfile.base +0 -2
- data/gemfiles/Gemfile.rails-3.2.x +1 -0
- data/gemfiles/Gemfile.rails-4.0.x +1 -0
- data/gemfiles/Gemfile.rails-4.1.x +1 -0
- data/gemfiles/Gemfile.rails-4.2.x +1 -0
- data/gemfiles/Gemfile.rails-5.0.x +4 -0
- data/gemfiles/Gemfile.rails-HEAD +7 -0
- data/lib/opbeat/client.rb +7 -4
- data/lib/opbeat/configuration.rb +2 -0
- data/lib/opbeat/error_message/http.rb +4 -1
- data/lib/opbeat/filter.rb +1 -1
- data/lib/opbeat/injections.rb +4 -4
- data/lib/opbeat/injections/sequel.rb +8 -5
- data/lib/opbeat/integration/delayed_job.rb +1 -0
- data/lib/opbeat/integration/rails/inject_exceptions_catcher.rb +2 -1
- data/lib/opbeat/normalizers/action_view.rb +2 -2
- data/lib/opbeat/version.rb +1 -1
- data/spec/opbeat/integration/rails_spec.rb +1 -1
- data/spec/spec_helper.rb +3 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe5eca3de7470c1ef43e2c2b30f87550aa9f4248
|
4
|
+
data.tar.gz: 3bcd257e092fe001230a0b424b4069ae092bf340
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01d4b4e1ac7fb68dcdf8b9fdd56c994f75ddd42f8fe906157de6daf1ace792bfa0238d81f1ce46aaf9ebf6d8cfc8a8b4052adc0e7689788e0fc0d88fcb0402e4
|
7
|
+
data.tar.gz: 99050c7c14d10f27692ef5e1a0e8ffa32526fb804fff70451a44a396d03202077a258ee68b8c320c24f4dd94803e9ca2ec33025e0f32cf2da45545c98377fa05
|
data/.travis.yml
CHANGED
@@ -6,20 +6,33 @@ rvm:
|
|
6
6
|
- 2.0.0
|
7
7
|
- 2.1.6
|
8
8
|
- 2.2.3
|
9
|
+
- 2.3.1
|
9
10
|
gemfile:
|
10
11
|
- gemfiles/Gemfile.rails-3.2.x
|
11
12
|
- gemfiles/Gemfile.rails-4.0.x
|
12
13
|
- gemfiles/Gemfile.rails-4.1.x
|
13
14
|
- gemfiles/Gemfile.rails-4.2.x
|
15
|
+
- gemfiles/Gemfile.rails-5.0.x
|
14
16
|
matrix:
|
17
|
+
include:
|
18
|
+
- rvm: 2.3.1
|
19
|
+
gemfile: gemfiles/Gemfile.rails-HEAD
|
20
|
+
|
15
21
|
exclude:
|
16
22
|
# Rails 4.0+ requires ruby 2.0+
|
17
23
|
- rvm: 1.9.3
|
18
|
-
|
24
|
+
gemfile: gemfiles/Gemfile.rails-4.0.x
|
25
|
+
- rvm: 1.9.3
|
26
|
+
gemfile: gemfiles/Gemfile.rails-4.1.x
|
19
27
|
- rvm: 1.9.3
|
20
|
-
|
28
|
+
gemfile: gemfiles/Gemfile.rails-4.2.x
|
29
|
+
# Rails 5.0+ requires ruby 2.2+
|
21
30
|
- rvm: 1.9.3
|
22
|
-
|
31
|
+
gemfile: gemfiles/Gemfile.rails-5.0.x
|
32
|
+
- rvm: 2.0.0
|
33
|
+
gemfile: gemfiles/Gemfile.rails-5.0.x
|
34
|
+
- rvm: 2.1.6
|
35
|
+
gemfile: gemfiles/Gemfile.rails-5.0.x
|
23
36
|
|
24
37
|
notifications:
|
25
38
|
email: false
|
data/Gemfile
CHANGED
data/HISTORY.md
CHANGED
data/gemfiles/Gemfile.base
CHANGED
data/lib/opbeat/client.rb
CHANGED
@@ -193,15 +193,18 @@ module Opbeat
|
|
193
193
|
exception.set_backtrace caller
|
194
194
|
end
|
195
195
|
|
196
|
-
error_message = ErrorMessage.from_exception(config, exception, opts)
|
197
|
-
|
198
|
-
|
199
|
-
|
196
|
+
if error_message = ErrorMessage.from_exception(config, exception, opts)
|
197
|
+
error_message.add_extra(@context) if @context
|
198
|
+
data = @data_builders.error_message.build error_message
|
199
|
+
enqueue Worker::PostRequest.new('/errors/', data)
|
200
|
+
end
|
200
201
|
end
|
201
202
|
|
202
203
|
def report_message message, opts = {}
|
203
204
|
return if config.disable_errors
|
204
205
|
|
206
|
+
ensure_worker_running
|
207
|
+
|
205
208
|
error_message = ErrorMessage.new(config, message, opts)
|
206
209
|
error_message.add_extra(@context) if @context
|
207
210
|
data = @data_builders.error_message.build error_message
|
data/lib/opbeat/configuration.rb
CHANGED
@@ -26,7 +26,10 @@ module Opbeat
|
|
26
26
|
{} # env
|
27
27
|
)
|
28
28
|
|
29
|
-
|
29
|
+
# In Rails < 5 ActionDispatch::Request inherits from Hash
|
30
|
+
headers = env.respond_to?(:headers) ? env.headers : env
|
31
|
+
|
32
|
+
headers.each do |k, v|
|
30
33
|
next unless k.upcase == k # lower case stuff isn't relevant
|
31
34
|
|
32
35
|
if k.match(HTTP_ENV_KEY)
|
data/lib/opbeat/filter.rb
CHANGED
@@ -62,7 +62,7 @@ module Opbeat
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def rails_filters
|
65
|
-
if defined?(::Rails) && Rails.application
|
65
|
+
if defined?(::Rails) && Rails.respond_to?(:application) && Rails.application
|
66
66
|
if filters = ::Rails.application.config.filter_parameters
|
67
67
|
filters.any? ? filters : nil
|
68
68
|
end
|
data/lib/opbeat/injections.rb
CHANGED
@@ -37,8 +37,8 @@ module Opbeat
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def self.register_require_hook registration
|
40
|
-
registration.require_paths.each do |
|
41
|
-
require_hooks[
|
40
|
+
registration.require_paths.each do |path|
|
41
|
+
require_hooks[path] = registration
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
@@ -49,8 +49,8 @@ module Opbeat
|
|
49
49
|
installed[registration.const_name] = registration
|
50
50
|
registration.install
|
51
51
|
|
52
|
-
registration.require_paths.each do |
|
53
|
-
require_hooks.delete
|
52
|
+
registration.require_paths.each do |path|
|
53
|
+
require_hooks.delete path
|
54
54
|
end
|
55
55
|
end
|
56
56
|
end
|
@@ -11,18 +11,21 @@ module Opbeat
|
|
11
11
|
def install
|
12
12
|
require 'sequel/database/logging'
|
13
13
|
|
14
|
-
::Sequel::Database.
|
15
|
-
|
14
|
+
log_method = ::Sequel::Database.method_defined?(:log_connection_yield) ?
|
15
|
+
'log_connection_yield' : 'log_yield'
|
16
16
|
|
17
|
-
|
18
|
-
|
17
|
+
::Sequel::Database.class_eval <<-end_eval
|
18
|
+
alias #{log_method}_without_opb #{log_method}
|
19
|
+
|
20
|
+
def #{log_method} sql, *args, &block
|
21
|
+
#{log_method}_without_opb(sql, *args) do
|
19
22
|
sig = Opbeat::Injections::Sequel::Injector.sql_parser.signature_for(sql)
|
20
23
|
Opbeat.trace(sig, KIND, sql: sql) do
|
21
24
|
block.call
|
22
25
|
end
|
23
26
|
end
|
24
27
|
end
|
25
|
-
|
28
|
+
end_eval
|
26
29
|
end
|
27
30
|
end
|
28
31
|
end
|
@@ -3,7 +3,8 @@ module Opbeat
|
|
3
3
|
module Rails
|
4
4
|
module InjectExceptionsCatcher
|
5
5
|
def self.included(cls)
|
6
|
-
cls.send(:
|
6
|
+
cls.send(:alias_method, :render_exception_without_opbeat, :render_exception)
|
7
|
+
cls.send(:alias_method, :render_exception, :render_exception_with_opbeat)
|
7
8
|
end
|
8
9
|
|
9
10
|
def render_exception_with_opbeat(env, exception)
|
@@ -19,11 +19,11 @@ module Opbeat
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def relative_path path
|
22
|
-
root = config.view_paths.find { |
|
22
|
+
root = config.view_paths.find { |vp| path.start_with? vp }
|
23
23
|
type = :app
|
24
24
|
|
25
25
|
unless root
|
26
|
-
root = Gem.path.find { |
|
26
|
+
root = Gem.path.find { |gp| path.start_with? gp }
|
27
27
|
type = :gem
|
28
28
|
end
|
29
29
|
|
data/lib/opbeat/version.rb
CHANGED
@@ -20,7 +20,7 @@ describe 'Rails integration' do
|
|
20
20
|
class TinderButForHotDogs < ::Rails::Application
|
21
21
|
config.secret_key_base = '__secret_key_base'
|
22
22
|
|
23
|
-
config.logger = Logger.new(
|
23
|
+
config.logger = Logger.new(STDOUT)
|
24
24
|
config.logger.level = Logger::DEBUG
|
25
25
|
|
26
26
|
config.eager_load = false
|
data/spec/spec_helper.rb
CHANGED
@@ -12,13 +12,15 @@ require 'opbeat'
|
|
12
12
|
module Opbeat
|
13
13
|
class Configuration
|
14
14
|
# Override defaults to enable http (caught by WebMock) in test env
|
15
|
-
defaults = DEFAULTS.dup.merge enabled_environments: %{test}
|
15
|
+
defaults = DEFAULTS.dup.merge enabled_environments: %w{test}
|
16
16
|
remove_const(:DEFAULTS)
|
17
17
|
const_set(:DEFAULTS, defaults.freeze)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
RSpec.configure do |config|
|
22
|
+
config.backtrace_exclusion_patterns += [%r{/gems/}]
|
23
|
+
|
22
24
|
config.before :each do
|
23
25
|
@request_stub = stub_request(:post, /intake\.opbeat\.com/)
|
24
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opbeat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikkel Malmberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -46,6 +46,8 @@ files:
|
|
46
46
|
- gemfiles/Gemfile.rails-4.0.x
|
47
47
|
- gemfiles/Gemfile.rails-4.1.x
|
48
48
|
- gemfiles/Gemfile.rails-4.2.x
|
49
|
+
- gemfiles/Gemfile.rails-5.0.x
|
50
|
+
- gemfiles/Gemfile.rails-HEAD
|
49
51
|
- lib/opbeat.rb
|
50
52
|
- lib/opbeat/capistrano.rb
|
51
53
|
- lib/opbeat/client.rb
|