ratchetio 0.4.8 → 0.4.9
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.
- data/CHANGELOG.md +4 -0
- data/lib/ratchetio/configuration.rb +1 -1
- data/lib/ratchetio/rails/controller_methods.rb +2 -2
- data/lib/ratchetio/version.rb +1 -1
- data/lib/ratchetio.rb +15 -5
- metadata +2 -3
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
**0.4.9**
|
4
|
+
- Start including a UUID in reported exceptions
|
5
|
+
- Fix issue with scrub_fields, and add `:password_confirmation` to the default list
|
6
|
+
|
3
7
|
**0.4.8**
|
4
8
|
- Add ability to send reports asynchronously, using girl_friday or Threading by default.
|
5
9
|
- Add ability to save reports to a file (for use with ratchet-agent) instead of sending across to Ratchet servers.
|
@@ -40,7 +40,7 @@ module Ratchetio
|
|
40
40
|
@person_id_method = 'id'
|
41
41
|
@person_username_method = 'username'
|
42
42
|
@person_email_method = 'email'
|
43
|
-
@scrub_fields = [:passwd, :password, :secret]
|
43
|
+
@scrub_fields = [:passwd, :password, :password_confirmation, :secret]
|
44
44
|
@use_async = false
|
45
45
|
@async_handler = nil
|
46
46
|
end
|
@@ -50,7 +50,7 @@ module Ratchetio
|
|
50
50
|
end
|
51
51
|
elsif v.is_a? Hash
|
52
52
|
filtered[k] = ratchetio_filter_params v
|
53
|
-
elsif Ratchetio.configuration.scrub_fields.include? k
|
53
|
+
elsif Ratchetio.configuration.scrub_fields.include? k.to_sym
|
54
54
|
filtered[k] = "*" * v.length
|
55
55
|
else
|
56
56
|
filtered[k] = v
|
@@ -95,7 +95,7 @@ module Ratchetio
|
|
95
95
|
|
96
96
|
def ratchetio_session_data
|
97
97
|
if session.respond_to?(:to_hash)
|
98
|
-
session.to_hash
|
98
|
+
ratchetio_filter_params(session.to_hash)
|
99
99
|
else
|
100
100
|
session.data
|
101
101
|
end
|
data/lib/ratchetio/version.rb
CHANGED
data/lib/ratchetio.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
require 'net/https'
|
2
|
+
require 'securerandom' if defined?(SecureRandom)
|
2
3
|
require 'socket'
|
3
4
|
require 'thread'
|
4
5
|
require 'uri'
|
5
6
|
|
6
|
-
require
|
7
|
+
require "girl_friday" if defined?(GirlFriday)
|
8
|
+
|
7
9
|
require 'ratchetio/configuration'
|
8
|
-
require 'ratchetio/railtie' if defined?(Rails)
|
9
10
|
require 'ratchetio/goalie' if defined?(Goalie)
|
10
|
-
require
|
11
|
+
require 'ratchetio/railtie' if defined?(Rails)
|
12
|
+
require 'ratchetio/version'
|
11
13
|
|
12
14
|
module Ratchetio
|
13
15
|
class << self
|
@@ -39,7 +41,7 @@ module Ratchetio
|
|
39
41
|
@configuration ||= Configuration.new
|
40
42
|
end
|
41
43
|
|
42
|
-
# Reports an exception to Ratchet.io
|
44
|
+
# Reports an exception to Ratchet.io. Returns the exception data hash.
|
43
45
|
#
|
44
46
|
# @example
|
45
47
|
# begin
|
@@ -70,8 +72,10 @@ module Ratchetio
|
|
70
72
|
|
71
73
|
payload = build_payload(data)
|
72
74
|
schedule_payload(payload)
|
75
|
+
data
|
73
76
|
rescue => e
|
74
77
|
logger.error "[Ratchet.io] Error reporting exception to Ratchet.io: #{e}"
|
78
|
+
nil
|
75
79
|
end
|
76
80
|
|
77
81
|
# Reports an arbitrary message to Ratchet.io
|
@@ -241,7 +245,7 @@ module Ratchetio
|
|
241
245
|
|
242
246
|
def base_data(level = 'error')
|
243
247
|
config = configuration
|
244
|
-
{
|
248
|
+
data = {
|
245
249
|
:timestamp => Time.now.to_i,
|
246
250
|
:environment => config.environment,
|
247
251
|
:level => level,
|
@@ -252,6 +256,12 @@ module Ratchetio
|
|
252
256
|
:version => VERSION
|
253
257
|
}
|
254
258
|
}
|
259
|
+
|
260
|
+
if defined?(SecureRandom)
|
261
|
+
data[:uuid] = SecureRandom.uuid
|
262
|
+
end
|
263
|
+
|
264
|
+
data
|
255
265
|
end
|
256
266
|
|
257
267
|
def server_data
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ratchetio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -253,4 +253,3 @@ test_files:
|
|
253
253
|
- spec/ratchetio_spec.rb
|
254
254
|
- spec/spec_helper.rb
|
255
255
|
- spec/support/devise.rb
|
256
|
-
has_rdoc:
|