yeller_ruby 0.1.4 → 0.2.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.
- checksums.yaml +4 -4
- data/lib/yeller/backtrace_filter.rb +1 -0
- data/lib/yeller/configuration.rb +1 -1
- data/lib/yeller/exception_formatter.rb +3 -3
- data/lib/yeller/rack.rb +1 -1
- data/lib/yeller/rails.rb +67 -25
- data/lib/yeller/server.rb +3 -1
- data/lib/yeller/startup_params.rb +1 -1
- data/lib/yeller/version.rb +1 -1
- data/lib/yeller.rb +10 -18
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5853d9f2c5962d8699ee7fed01219c03b80cd630
|
4
|
+
data.tar.gz: 7fb9baee25cf724a77c8f009204226987e99d1cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6f42956eeb821511c14cb9b505011a0e2792870e7f642005e15016e3ab1e5508524b8751029ff712d7569b0e2cb362e906fa089808b96d851a096ddb39c2c1a
|
7
|
+
data.tar.gz: 5b3e9c26c3e0a9ab9f56605ce254c52bded934e80bd4efe7c0c72353ff2df15520ed55de49d46c3acdc615f9b0016284a55bd08b3852c6af7d7358a2d38b6a7e
|
data/lib/yeller/configuration.rb
CHANGED
@@ -41,9 +41,9 @@ module Yeller
|
|
41
41
|
|
42
42
|
def to_hash
|
43
43
|
result = {
|
44
|
-
message
|
45
|
-
stacktrace
|
46
|
-
type
|
44
|
+
:message => message,
|
45
|
+
:stacktrace => formatted_backtrace,
|
46
|
+
:type => type,
|
47
47
|
:"custom-data" => options.fetch(:custom_data, {})
|
48
48
|
}
|
49
49
|
result[:url] = options[:url] if options.key?(:url)
|
data/lib/yeller/rack.rb
CHANGED
data/lib/yeller/rails.rb
CHANGED
@@ -1,13 +1,16 @@
|
|
1
|
-
require '
|
2
|
-
require 'yeller'
|
3
|
-
require 'yeller/rack'
|
1
|
+
require File.expand_path('../../yeller', __FILE__)
|
2
|
+
require File.expand_path('../../yeller/rack', __FILE__)
|
4
3
|
|
5
4
|
module Yeller
|
6
5
|
class Rails
|
7
6
|
def self.configure(&block)
|
8
7
|
Yeller::Rack.configure do |config|
|
9
|
-
|
10
|
-
|
8
|
+
if defined?(::Rails)
|
9
|
+
config.error_handler = Yeller::LogErrorHandler.new(::Rails.logger)
|
10
|
+
config.environment = ::Rails.env.to_s
|
11
|
+
elsif ENV['RAILS_ENV']
|
12
|
+
config.environment = ENV['RAILS_ENV']
|
13
|
+
end
|
11
14
|
block.call(config)
|
12
15
|
end
|
13
16
|
end
|
@@ -24,7 +27,7 @@ module Yeller
|
|
24
27
|
def _yeller_custom_data
|
25
28
|
out = {
|
26
29
|
:params => params,
|
27
|
-
:session => env.fetch('rack.session', {})
|
30
|
+
:session => request.env.fetch('rack.session', {})
|
28
31
|
}
|
29
32
|
out.merge!(yeller_user_data || {})
|
30
33
|
if respond_to?(:yeller_custom_data)
|
@@ -42,13 +45,12 @@ module Yeller
|
|
42
45
|
end
|
43
46
|
end
|
44
47
|
|
45
|
-
module
|
48
|
+
module Rails3AndFourCatchingHooks
|
46
49
|
def self.included(base)
|
47
50
|
base.send(:alias_method, :render_exception_without_yeller, :render_exception)
|
48
51
|
base.send(:alias_method, :render_exception, :render_exception_with_yeller)
|
49
52
|
end
|
50
53
|
|
51
|
-
protected
|
52
54
|
def render_exception_with_yeller(env, exception)
|
53
55
|
Yeller::VerifyLog.render_exception_with_yeller!
|
54
56
|
begin
|
@@ -65,35 +67,75 @@ module Yeller
|
|
65
67
|
)
|
66
68
|
else
|
67
69
|
Yeller::VerifyLog.action_controller_instance_not_in_env!
|
68
|
-
Yeller::Rack.
|
69
|
-
exception,
|
70
|
-
:url => request.url
|
71
|
-
)
|
70
|
+
Yeller::Rack.rescue_rack_exception(exception, env)
|
72
71
|
end
|
73
72
|
rescue => e
|
74
73
|
Yeller::VerifyLog.error_reporting_rails_error!(e)
|
75
74
|
end
|
76
|
-
|
77
75
|
render_exception_without_yeller(env, exception)
|
78
76
|
end
|
79
77
|
end
|
80
78
|
|
81
|
-
|
82
|
-
|
83
|
-
|
79
|
+
module Rails2CatchingHooks
|
80
|
+
def self.included(base)
|
81
|
+
Yeller::VerifyLog.monkey_patching_rails!("ActionController::Base.rescue_action_in_public")
|
82
|
+
base.send(:alias_method, :rescue_action_in_public_without_yeller, :rescue_action_in_public)
|
83
|
+
base.send(:alias_method, :rescue_action_in_public, :rescue_public_exception_with_yeller)
|
84
|
+
|
85
|
+
Yeller::VerifyLog.monkey_patching_rails!("ActionController::Base.rescue_action_locally")
|
86
|
+
base.send(:alias_method, :rescue_action_locally_without_yeller, :rescue_action_locally)
|
87
|
+
base.send(:alias_method, :rescue_action_locally, :rescue_local_exception_with_yeller)
|
84
88
|
end
|
85
89
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
90
|
+
protected
|
91
|
+
def rescue_public_exception_with_yeller(exception)
|
92
|
+
_send_to_yeller(exception)
|
93
|
+
rescue_action_in_public_without_yeller(exception)
|
94
|
+
end
|
95
|
+
|
96
|
+
def rescue_local_exception_with_yeller(exception)
|
97
|
+
_send_to_yeller(exception)
|
98
|
+
rescue_action_locally_without_yeller(exception)
|
99
|
+
end
|
100
|
+
|
101
|
+
def _send_to_yeller(exception)
|
102
|
+
Yeller::VerifyLog.render_exception_with_yeller!
|
103
|
+
controller = self
|
104
|
+
params = controller.send(:params)
|
105
|
+
Yeller::Rack.report(
|
106
|
+
exception,
|
107
|
+
:url => request.url,
|
108
|
+
:location => "#{controller.class.to_s}##{params[:action]}",
|
109
|
+
:custom_data => controller._yeller_custom_data
|
110
|
+
)
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
def self.monkeypatch_rails3!
|
115
|
+
if defined?(::ActionDispatch::DebugExceptions)
|
116
|
+
::ActionDispatch::DebugExceptions.send(:include, Yeller::Rails::Rails3AndFourCatchingHooks)
|
117
|
+
elsif defined?(::ActionDispatch::ShowExceptions)
|
118
|
+
::ActionDispatch::ShowExceptions.send(:include, Yeller::Rails::Rails3AndFourCatchingHooks)
|
119
|
+
end
|
120
|
+
|
121
|
+
if defined?(::ActionController)
|
122
|
+
::ActionController::Base.send(:include, Yeller::Rails::ControllerMethods)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
if defined?(::Rails) && defined?(::Rails::Railtie)
|
127
|
+
class Railtie < ::Rails::Railtie
|
128
|
+
initializer "yeller.use_rack_middleware" do |app|
|
129
|
+
app.config.middleware.insert 0, "Yeller::Rack"
|
94
130
|
end
|
95
|
-
|
131
|
+
|
132
|
+
config.after_initialize do
|
133
|
+
Yeller::Rails.monkeypatch_rails3!
|
134
|
+
end
|
96
135
|
end
|
136
|
+
elsif defined?(ActionController::Base)
|
137
|
+
ActionController::Base.send(:include, Yeller::Rails::Rails2CatchingHooks)
|
138
|
+
ActionController::Base.send(:include, Yeller::Rails::ControllerMethods)
|
97
139
|
end
|
98
140
|
end
|
99
141
|
end
|
data/lib/yeller/server.rb
CHANGED
@@ -15,7 +15,9 @@ module Yeller
|
|
15
15
|
http = Net::HTTP.new(host, port)
|
16
16
|
http.use_ssl = true
|
17
17
|
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
18
|
-
http.ciphers
|
18
|
+
if http.respond_to?(:ciphers=)
|
19
|
+
http.ciphers = "DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2"
|
20
|
+
end
|
19
21
|
http
|
20
22
|
end
|
21
23
|
end
|
data/lib/yeller/version.rb
CHANGED
data/lib/yeller.rb
CHANGED
@@ -1,24 +1,16 @@
|
|
1
1
|
require 'net/http'
|
2
2
|
require 'yajl/json_gem'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
if defined?(::Rails)
|
16
|
-
require 'yeller/rails'
|
17
|
-
end
|
18
|
-
|
19
|
-
if defined?(::Rails) && defined?(::Rake)
|
20
|
-
require 'yeller/rails/tasks'
|
21
|
-
end
|
4
|
+
require File.expand_path('../yeller/backtrace_filter', __FILE__)
|
5
|
+
require File.expand_path('../yeller/client', __FILE__)
|
6
|
+
require File.expand_path('../yeller/ignoring_client', __FILE__)
|
7
|
+
require File.expand_path('../yeller/configuration', __FILE__)
|
8
|
+
require File.expand_path('../yeller/exception_formatter', __FILE__)
|
9
|
+
require File.expand_path('../yeller/server', __FILE__)
|
10
|
+
require File.expand_path('../yeller/version', __FILE__)
|
11
|
+
require File.expand_path('../yeller/startup_params', __FILE__)
|
12
|
+
require File.expand_path('../yeller/log_error_handler', __FILE__)
|
13
|
+
require File.expand_path('../yeller/verify_log', __FILE__)
|
22
14
|
|
23
15
|
module Yeller
|
24
16
|
def self.client(*blocks, &block)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yeller_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Crayford
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|