failbot 0.9.2 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 46d2c2479a34d7d1efce69e7f1ef0b04712be821
4
+ data.tar.gz: 4c4b321e9204bb5a25300ec6645e734f6580e278
5
+ SHA512:
6
+ metadata.gz: 34ccaeb0ee821b8dcfe7cdd156da55c1548804854bb5cce8f7b78947b1a9ef5c92edaef3f280aa5a6f05a9508f3bffe0c4ca2a53158a167aec3020347ffb0d80
7
+ data.tar.gz: b3a9b8b687b79d5c845b610430c4efc0341ed2f800fa7ce3b8556ab77510640862dfac709d82563cc59f0528d3b9b8de466c8586af392b3f6fd579e1a0b96759
data/lib/failbot.rb CHANGED
@@ -179,7 +179,8 @@ module Failbot
179
179
  'message' => e.message,
180
180
  'backtrace' => backtrace.join("\n"),
181
181
  'ruby' => RUBY_DESCRIPTION,
182
- 'rollup' => Digest::MD5.hexdigest("#{e.class}#{backtrace[0]}")
182
+ 'rollup' => Digest::MD5.hexdigest("#{e.class}#{backtrace[0]}"),
183
+ 'created_at' => Time.now.utc.iso8601(6)
183
184
  }
184
185
 
185
186
  if original = (e.respond_to?(:original_exception) && e.original_exception)
@@ -27,7 +27,7 @@ module Failbot
27
27
  {
28
28
  :method => request.request_method,
29
29
  :user_agent => env['HTTP_USER_AGENT'],
30
- :params => request.params,
30
+ :params => filtered_parameters(env, request.params),
31
31
  :session => (request.session.to_hash rescue nil),
32
32
  :referrer => request.referrer,
33
33
  :remote_ip => request.ip,
@@ -38,5 +38,46 @@ module Failbot
38
38
  def self.report(exception, env, other = {})
39
39
  Failbot.report(exception, other.merge(context(env)))
40
40
  end
41
+
42
+ def self.filtered_parameters(env, params)
43
+ if env['filter_words']
44
+ filter_parameters(env['filter_words'], params)
45
+ else
46
+ params
47
+ end
48
+ end
49
+
50
+ # Borrowed from Rails.
51
+ def self.filter_parameters(filter_words, unfiltered_parameters)
52
+ parameter_filter = Regexp.new(filter_words.collect{ |s| s.to_s }.join('|'), true) if filter_words.length > 0
53
+
54
+ filtered_parameters = {}
55
+
56
+ unfiltered_parameters.each do |key, value|
57
+ if key =~ parameter_filter
58
+ filtered_parameters[key] = '[FILTERED]'
59
+ elsif value.is_a?(Hash)
60
+ filtered_parameters[key] = filter_parameters(value)
61
+ elsif value.is_a?(Array)
62
+ filtered_parameters[key] = value.collect do |item|
63
+ case item
64
+ when Hash, Array
65
+ filter_parameters(item)
66
+ else
67
+ item
68
+ end
69
+ end
70
+ elsif block_given?
71
+ key = key.dup
72
+ value = value.dup if value.duplicable?
73
+ yield key, value
74
+ filtered_parameters[key] = value
75
+ else
76
+ filtered_parameters[key] = value
77
+ end
78
+ end
79
+
80
+ filtered_parameters
81
+ end
41
82
  end
42
83
  end
@@ -5,9 +5,9 @@ module Resque
5
5
  class Failbot < Base
6
6
  def self.url
7
7
  if ENV['RAILS_ENV'] == 'staging'
8
- "http://haystack.stg.github.com/types/exception"
8
+ "http://haystack-staging.githubapp.com/types/exception"
9
9
  else
10
- "http://haystack.rs.github.com/types/exception"
10
+ "http://haystack.githubapp.com/types/exception"
11
11
  end
12
12
  end
13
13
 
@@ -1,3 +1,3 @@
1
1
  module Failbot
2
- VERSION = "0.9.2"
2
+ VERSION = "0.9.4"
3
3
  end
metadata CHANGED
@@ -1,22 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: failbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
5
- prerelease:
4
+ version: 0.9.4
6
5
  platform: ruby
7
6
  authors:
8
- - ! '@rtomayko'
9
- - ! '@atmos'
10
- - ! '@sr'
7
+ - '@rtomayko'
8
+ - '@atmos'
9
+ - '@sr'
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2013-08-21 00:00:00.000000000 Z
13
+ date: 2014-03-17 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: yajl-ruby
18
17
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
18
  requirements:
21
19
  - - ~>
22
20
  - !ruby/object:Gem::Version
@@ -24,7 +22,6 @@ dependencies:
24
22
  type: :runtime
25
23
  prerelease: false
26
24
  version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
25
  requirements:
29
26
  - - ~>
30
27
  - !ruby/object:Gem::Version
@@ -32,7 +29,6 @@ dependencies:
32
29
  - !ruby/object:Gem::Dependency
33
30
  name: bertrpc
34
31
  requirement: !ruby/object:Gem::Requirement
35
- none: false
36
32
  requirements:
37
33
  - - ~>
38
34
  - !ruby/object:Gem::Version
@@ -40,7 +36,6 @@ dependencies:
40
36
  type: :runtime
41
37
  prerelease: false
42
38
  version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
39
  requirements:
45
40
  - - ~>
46
41
  - !ruby/object:Gem::Version
@@ -48,7 +43,6 @@ dependencies:
48
43
  - !ruby/object:Gem::Dependency
49
44
  name: rake
50
45
  requirement: !ruby/object:Gem::Requirement
51
- none: false
52
46
  requirements:
53
47
  - - ~>
54
48
  - !ruby/object:Gem::Version
@@ -56,7 +50,6 @@ dependencies:
56
50
  type: :development
57
51
  prerelease: false
58
52
  version_requirements: !ruby/object:Gem::Requirement
59
- none: false
60
53
  requirements:
61
54
  - - ~>
62
55
  - !ruby/object:Gem::Version
@@ -64,7 +57,6 @@ dependencies:
64
57
  - !ruby/object:Gem::Dependency
65
58
  name: rack-test
66
59
  requirement: !ruby/object:Gem::Requirement
67
- none: false
68
60
  requirements:
69
61
  - - ~>
70
62
  - !ruby/object:Gem::Version
@@ -72,12 +64,11 @@ dependencies:
72
64
  type: :development
73
65
  prerelease: false
74
66
  version_requirements: !ruby/object:Gem::Requirement
75
- none: false
76
67
  requirements:
77
68
  - - ~>
78
69
  - !ruby/object:Gem::Version
79
70
  version: '0.6'
80
- description: ! '...'
71
+ description: '...'
81
72
  email:
82
73
  - github+failbot@lists.github.com
83
74
  executables:
@@ -103,26 +94,26 @@ files:
103
94
  - bin/failbot
104
95
  homepage: http://github.com/github/failbot#readme
105
96
  licenses: []
97
+ metadata: {}
106
98
  post_install_message:
107
99
  rdoc_options: []
108
100
  require_paths:
109
101
  - lib
110
102
  required_ruby_version: !ruby/object:Gem::Requirement
111
- none: false
112
103
  requirements:
113
- - - ! '>='
104
+ - - '>='
114
105
  - !ruby/object:Gem::Version
115
106
  version: '0'
116
107
  required_rubygems_version: !ruby/object:Gem::Requirement
117
- none: false
118
108
  requirements:
119
- - - ! '>='
109
+ - - '>='
120
110
  - !ruby/object:Gem::Version
121
111
  version: 1.3.6
122
112
  requirements: []
123
113
  rubyforge_project:
124
- rubygems_version: 1.8.23
114
+ rubygems_version: 2.0.3
125
115
  signing_key:
126
- specification_version: 3
116
+ specification_version: 4
127
117
  summary: Deliver exceptions to Haystack
128
118
  test_files: []
119
+ has_rdoc: