raygun4ruby 1.1.11 → 1.1.12

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: 7b22ae9933b9637f53a24773b8800aee07dfd2a7
4
- data.tar.gz: b3315855c999c88dfdfb6f76480af30686f88d07
3
+ metadata.gz: 3d4305c691bbd89f3d54ba89ba86700fe30cc9b6
4
+ data.tar.gz: cc9292411c93c1f5515daa8beafe5258a2ac6127
5
5
  SHA512:
6
- metadata.gz: 010a55d887baaa612b9756dd46f37dbb9735556308af92ab1e34e91cd3f271cd64687d52ac8823b2fecdbc42b245cf5d28f2271558965381cefd3c5acefdb21f
7
- data.tar.gz: c2334158d5b54824430fe98a18faad05a8341cb96741a66e99833b82042bf8161411382dc72389c5fa30b7db118d04fb0f71d4a2c9a42b1f3274171778113344
6
+ metadata.gz: c0db0e82e960a9e65ebbcf22aa95ef25582772db257e0a11058902703178d2636b2d5f7c3bb84e2cd1b41ba88a62b28139f74d5de5d147ab26b949470e89dc8d
7
+ data.tar.gz: 9b352669522765bad9a218bcdc41cd291fcd8ffe2220978d0f1373a2b4de025cd88e07d62019da44fc9b8b6eaba6bd37ac26b3730c30ba1e512de0692d3651f0
@@ -5,10 +5,10 @@ script:
5
5
  - bundle exec rake
6
6
 
7
7
  rvm:
8
- - 1.9.3
9
8
  - 2.0.0
10
9
  - 2.2.5
11
- - 2.3.1
10
+ - 2.3.3
11
+ - 2.4.0
12
12
 
13
13
  gemfile:
14
14
  - Gemfile
data/README.md CHANGED
@@ -115,7 +115,20 @@ Raygun.setup do |config|
115
115
  end
116
116
  ```
117
117
 
118
- You can also check which [exceptions are ignored by default](https://github.com/MindscapeHQ/raygun4ruby/blob/master/lib/raygun/configuration.rb#L26) and unignore them if needed by doing the following:
118
+ The following exceptions are ignored by default:
119
+
120
+ ```
121
+ ActiveRecord::RecordNotFound
122
+ ActionController::RoutingError
123
+ ActionController::InvalidAuthenticityToken
124
+ ActionDispatch::ParamsParser::ParseError
125
+ CGI::Session::CookieStore::TamperedWithCookie
126
+ ActionController::UnknownAction
127
+ AbstractController::ActionNotFound
128
+ Mongoid::Errors::DocumentNotFound
129
+ ```
130
+
131
+ [You can see this here](https://github.com/MindscapeHQ/raygun4ruby/blob/master/lib/raygun/configuration.rb#L51) and unignore them if needed by doing the following:
119
132
 
120
133
  ```ruby
121
134
  Raygun.setup do |config|
@@ -82,8 +82,8 @@ module Raygun
82
82
  ENV["RACK_ENV"]
83
83
  end
84
84
 
85
- def rack_env_present?
86
- !!ENV["RACK_ENV"]
85
+ def rails_env
86
+ ENV["RAILS_ENV"]
87
87
  end
88
88
 
89
89
  def request_information(env)
@@ -135,11 +135,17 @@ module Raygun
135
135
  end
136
136
  end
137
137
 
138
+ def filter_custom_data(env)
139
+ params = env.delete(:custom_data) || {}
140
+ filter_params(params, env["action_dispatch.parameter_filter"])
141
+ end
142
+
138
143
  # see http://raygun.io/raygun-providers/rest-json-api?v=1
139
144
  def build_payload_hash(exception_instance, env = {})
140
- custom_data = env.delete(:custom_data) || {}
145
+ custom_data = filter_custom_data(env) || {}
141
146
  tags = env.delete(:tags) || []
142
- tags << rack_env if rack_env_present?
147
+
148
+ tags << rails_env || rack_env
143
149
 
144
150
  grouping_key = env.delete(:grouping_key)
145
151
 
@@ -149,7 +155,7 @@ module Raygun
149
155
  client: client_details,
150
156
  error: error_details(exception_instance),
151
157
  userCustomData: Raygun.configuration.custom_data.merge(custom_data),
152
- tags: Raygun.configuration.tags.concat(tags).uniq,
158
+ tags: Raygun.configuration.tags.concat(tags).compact.uniq,
153
159
  request: request_information(env)
154
160
  }
155
161
 
@@ -187,7 +193,7 @@ module Raygun
187
193
  when Hash
188
194
  filter_params_with_array(v, filter_keys)
189
195
  else
190
- filter_keys.include?(k) ? "[FILTERED]" : v
196
+ filter_keys.any? { |fk| /#{fk}/i === k.to_s } ? "[FILTERED]" : v
191
197
  end
192
198
  result
193
199
  end
@@ -1,3 +1,3 @@
1
1
  module Raygun
2
- VERSION = "1.1.11"
2
+ VERSION = "1.1.12"
3
3
  end
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = []
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_runtime_dependency "httparty", "~> 0.13.7"
22
+ spec.add_runtime_dependency "httparty", "> 0.13.7"
23
23
  spec.add_runtime_dependency "json"
24
24
  spec.add_runtime_dependency "rack"
25
25
 
@@ -290,6 +290,33 @@ class ClientTest < Raygun::UnitTest
290
290
  Raygun.configuration.filter_parameters = nil
291
291
  end
292
292
 
293
+ def test_filter_parameters_using_array
294
+ filter_params_as_from_rails = [:password]
295
+ Raygun.configuration.filter_parameters = filter_params_as_from_rails
296
+
297
+ parameters = {
298
+ "something_normal" => "hello",
299
+ "password" => "wouldntyouliketoknow",
300
+ "password_confirmation" => "wouldntyouliketoknow",
301
+ "PasswORD_weird_case" => "anythingatall"
302
+ }
303
+
304
+ expected_form_hash = {
305
+ "something_normal" => "hello",
306
+ "password" => "[FILTERED]",
307
+ "password_confirmation" => "[FILTERED]",
308
+ "PasswORD_weird_case" => "[FILTERED]"
309
+ }
310
+
311
+ post_body_env_hash = sample_env_hash.merge(
312
+ "rack.input" => StringIO.new(URI.encode_www_form(parameters))
313
+ )
314
+
315
+ assert_equal expected_form_hash, @client.send(:request_information, post_body_env_hash)[:form]
316
+ ensure
317
+ Raygun.configuration.filter_parameters = nil
318
+ end
319
+
293
320
  def test_ip_address_from_action_dispatch
294
321
  sample_env_hash = {
295
322
  "HTTP_VERSION"=>"HTTP/1.1",
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.1.11
4
+ version: 1.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mindscape
@@ -9,20 +9,20 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-07-05 00:00:00.000000000 Z
12
+ date: 2017-02-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ">"
19
19
  - !ruby/object:Gem::Version
20
20
  version: 0.13.7
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - "~>"
25
+ - - ">"
26
26
  - !ruby/object:Gem::Version
27
27
  version: 0.13.7
28
28
  - !ruby/object:Gem::Dependency
@@ -240,7 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
240
240
  version: '0'
241
241
  requirements: []
242
242
  rubyforge_project:
243
- rubygems_version: 2.5.0
243
+ rubygems_version: 2.2.2
244
244
  signing_key:
245
245
  specification_version: 4
246
246
  summary: This gem provides support for Ruby and Ruby on Rails for the Raygun.io error
@@ -253,4 +253,3 @@ test_files:
253
253
  - test/unit/rails_insert_affected_user_test.rb
254
254
  - test/unit/resque_failure_test.rb
255
255
  - test/unit/sidekiq_failure_test.rb
256
- has_rdoc: