raygun4ruby 1.0.0 → 1.0.1

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: 74c9d087f04bec97c26f86237576f5de7e5256fc
4
- data.tar.gz: 3173e17810478004877c6b68f5dde4b3c5b57bf2
3
+ metadata.gz: fa7ba6399d8af368de5bcffc1bf325f62210ac7e
4
+ data.tar.gz: e006f29f186d76c1fc5385f51f67c6b4ff8cbb0c
5
5
  SHA512:
6
- metadata.gz: 65c3da42fca2b153bc3441f50da61514b1c48236177a543daf296fc34a2a17500d2914d2bae63c3872d44840cbbbd3edb87bcc56eca987742413271bb1eeda0a
7
- data.tar.gz: d2fa421bf69de9ba84691eb3d9a5e93d256b08fed4ae6806c6801949c7e32f6cd3e9d389c636f5b6fe8d6db0d546841e69ccc685009ffc9f79a2f03c4ebe61b9
6
+ metadata.gz: f4b6bc2069544a6e41f22acc611ddee4583febacbb5815253078b8f89eb7b748968df342e03d929a2dfceadc7ae92d16a6a589bfde1a1bdf1d69976494d7eff5
7
+ data.tar.gz: e53d997aa95dfd1bf590074328165c6e1b656f90b78676a23b4edb021a65b90b69f544e28fbdaca8140fa48f58816fce04f1e0a99927a17022aaf3bfe9db455e
data/README.md CHANGED
@@ -50,6 +50,7 @@ require 'raygun4ruby'
50
50
 
51
51
  Raygun.setup do |config|
52
52
  config.api_key = "YOUR_RAYGUN_API_KEY"
53
+ config.filter_parameters = [ :password, :card_number, :cvv ] # don't forget to filter out sensitive parameters
53
54
  end
54
55
 
55
56
  begin
@@ -92,7 +93,7 @@ You can also check which [exceptions are ignored by default](https://github.com/
92
93
 
93
94
  Raygun can now track how many users have been affected by an error.
94
95
 
95
- By default, Raygun looks for a method called `current_user` on your controller, and calls either `email`, `username` or `id` on the object returned by that method.
96
+ By default, Raygun looks for a method called `current_user` on your controller, and calls either `email`, `username` or `id` on the object returned by that method.
96
97
 
97
98
  You can customize those method names in your configuration block:
98
99
 
@@ -106,13 +107,13 @@ end
106
107
 
107
108
  If you're using Rails, most authentication systems will have this method set and you should be good to go.
108
109
 
109
- The count of unique affected users will appear on the error group in the Raygun dashboard. If your user has an `email` method, and that email has a Gravatars associated, you will also see your user's avatar.
110
+ The count of unique affected users will appear on the error group in the Raygun dashboard. If your user has an `email` method, and that email has a Gravatars associated, you will also see your user's avatar.
110
111
 
111
112
  If you wish to keep it anonymous, you could set this identifier to something like `SecureRandom.uuid` and store that in a cookie, like so:
112
113
 
113
114
  ```ruby
114
115
  class ApplicationController < ActionController::Base
115
-
116
+
116
117
  def raygun_user
117
118
  cookies.permanent[:raygun_user_identifier] ||= SecureRandom.uuid
118
119
  end
@@ -5,13 +5,19 @@ module Raygun
5
5
 
6
6
  desc "This generator creates a configuration file for the Raygun ruby adapter inside config/initializers"
7
7
  def create_configuration_file
8
+ filter_parameters = if defined?(Rails)
9
+ "config.filter_parameters = Rails.application.config.filter_parameters"
10
+ else
11
+ "config.filter_parameters = [ :password, :card_number, :cvv ] # don't forget to filter out sensitive parameters"
12
+ end
8
13
  initializer "raygun.rb" do
9
14
  <<-EOS
10
15
  Raygun.setup do |config|
11
16
  config.api_key = "#{api_key}"
17
+ #{filter_parameters}
12
18
  end
13
19
  EOS
14
20
  end
15
21
  end
16
22
  end
17
- end
23
+ end
data/lib/raygun/client.rb CHANGED
@@ -35,7 +35,7 @@ module Raygun
35
35
  def error_details(exception)
36
36
  {
37
37
  className: exception.class.to_s,
38
- message: exception.message,
38
+ message: exception.message.encode('UTF-16', :undef => :replace, :invalid => :replace).encode('UTF-8'),
39
39
  stackTrace: (exception.backtrace || []).map { |line| stack_trace_for(line) }
40
40
  }
41
41
  end
@@ -130,10 +130,14 @@ module Raygun
130
130
  def filter_params(params_hash, extra_filter_keys = nil)
131
131
  filter_keys = (Array(extra_filter_keys) + Raygun.configuration.filter_parameters).map(&:to_s)
132
132
 
133
- params_hash.inject({}) do |result, pair|
134
- k, v = pair
135
- filtered_value = (filter_keys.include?(k)) ? "[FILTERED]" : v
136
- result[k] = filtered_value
133
+ # Recursive filtering of (nested) hashes
134
+ params_hash.inject({}) do |result, (k, v)|
135
+ result[k] = case v
136
+ when Hash
137
+ filter_params(v, extra_filter_keys)
138
+ else
139
+ filter_keys.include?(k) ? "[FILTERED]" : v
140
+ end
137
141
  result
138
142
  end
139
143
  end
@@ -1,3 +1,3 @@
1
1
  module Raygun
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raygun4ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mindscape
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-10 00:00:00.000000000 Z
12
+ date: 2014-05-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -144,19 +144,19 @@ executables: []
144
144
  extensions: []
145
145
  extra_rdoc_files: []
146
146
  files:
147
+ - README.md
148
+ - lib/generators/raygun/install_generator.rb
147
149
  - lib/raygun.rb
148
150
  - lib/raygun/client.rb
149
151
  - lib/raygun/configuration.rb
150
152
  - lib/raygun/middleware/rack_exception_interceptor.rb
151
153
  - lib/raygun/middleware/rails_insert_affected_user.rb
152
154
  - lib/raygun/railtie.rb
155
+ - lib/raygun/testable.rb
153
156
  - lib/raygun/version.rb
154
157
  - lib/raygun4ruby.rb
155
- - lib/generators/raygun/install_generator.rb
156
- - lib/raygun/testable.rb
157
- - lib/tasks/raygun.tasks
158
158
  - lib/resque/failure/raygun.rb
159
- - README.md
159
+ - lib/tasks/raygun.tasks
160
160
  homepage: http://raygun.io
161
161
  licenses:
162
162
  - MIT
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  version: '0'
178
178
  requirements: []
179
179
  rubyforge_project:
180
- rubygems_version: 2.0.3
180
+ rubygems_version: 2.2.2
181
181
  signing_key:
182
182
  specification_version: 4
183
183
  summary: This gem provides support for Ruby and Ruby on Rails for the Raygun.io error