rollbar 2.19.3 → 2.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +5 -0
  3. data/.travis.yml +42 -16
  4. data/Gemfile +31 -14
  5. data/data/rollbar.snippet.js +1 -1
  6. data/docs/configuration.md +9 -0
  7. data/gemfiles/rails30.gemfile +8 -10
  8. data/gemfiles/rails31.gemfile +8 -9
  9. data/gemfiles/rails32.gemfile +8 -9
  10. data/gemfiles/rails40.gemfile +8 -9
  11. data/gemfiles/rails41.gemfile +8 -9
  12. data/gemfiles/rails42.gemfile +8 -11
  13. data/gemfiles/rails50.gemfile +13 -12
  14. data/gemfiles/rails51.gemfile +13 -12
  15. data/gemfiles/rails52.gemfile +13 -12
  16. data/gemfiles/rails60.gemfile +67 -0
  17. data/lib/rails/rollbar_runner.rb +1 -1
  18. data/lib/rollbar/configuration.rb +11 -1
  19. data/lib/rollbar/item.rb +15 -6
  20. data/lib/rollbar/json.rb +2 -51
  21. data/lib/rollbar/language_support.rb +3 -19
  22. data/lib/rollbar/logger_proxy.rb +5 -1
  23. data/lib/rollbar/notifier.rb +23 -10
  24. data/lib/rollbar/plugins/basic_socket.rb +1 -1
  25. data/lib/rollbar/rake_tasks.rb +3 -147
  26. data/lib/rollbar/request_data_extractor.rb +3 -2
  27. data/lib/rollbar/rollbar_test.rb +147 -0
  28. data/lib/rollbar/scrubbers/params.rb +2 -2
  29. data/lib/rollbar/scrubbers/url.rb +0 -1
  30. data/lib/rollbar/truncation.rb +9 -2
  31. data/lib/rollbar/truncation/min_body_strategy.rb +2 -3
  32. data/lib/rollbar/truncation/remove_any_key_strategy.rb +123 -0
  33. data/lib/rollbar/truncation/remove_extra_strategy.rb +35 -0
  34. data/lib/rollbar/truncation/remove_request_strategy.rb +21 -0
  35. data/lib/rollbar/truncation/strings_strategy.rb +2 -3
  36. data/lib/rollbar/util.rb +2 -2
  37. data/lib/rollbar/util/hash.rb +15 -0
  38. data/lib/rollbar/version.rb +1 -1
  39. data/rollbar.gemspec +0 -2
  40. metadata +10 -21
  41. data/gemfiles/ruby_1_8_and_1_9_2.gemfile +0 -51
  42. data/lib/rollbar/json/default.rb +0 -11
  43. data/lib/rollbar/json/oj.rb +0 -16
@@ -0,0 +1,35 @@
1
+ require 'rollbar/util'
2
+
3
+ module Rollbar
4
+ module Truncation
5
+ class RemoveExtraStrategy
6
+ include ::Rollbar::Truncation::Mixin
7
+
8
+ def self.call(payload)
9
+ new.call(payload)
10
+ end
11
+
12
+ def call(payload)
13
+ body = payload['data']['body']
14
+
15
+ delete_message_extra(body)
16
+ delete_trace_chain_extra(body)
17
+ delete_trace_extra(body)
18
+
19
+ dump(payload)
20
+ end
21
+
22
+ def delete_message_extra(body)
23
+ body['message'].delete('extra') if body['message'] && body['message']['extra']
24
+ end
25
+
26
+ def delete_trace_chain_extra(body)
27
+ body['trace_chain'][0].delete('extra') if body['trace_chain'] && body['trace_chain'][0]['extra']
28
+ end
29
+
30
+ def delete_trace_extra(body)
31
+ body['trace'].delete('extra') if body['trace'] && body['trace']['extra']
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,21 @@
1
+ require 'rollbar/util'
2
+
3
+ module Rollbar
4
+ module Truncation
5
+ class RemoveRequestStrategy
6
+ include ::Rollbar::Truncation::Mixin
7
+
8
+ def self.call(payload)
9
+ new.call(payload)
10
+ end
11
+
12
+ def call(payload)
13
+ data = payload['data']
14
+
15
+ data.delete('request') if data['request']
16
+
17
+ dump(payload)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -14,13 +14,12 @@ module Rollbar
14
14
 
15
15
  def call(payload)
16
16
  result = nil
17
- new_payload = Rollbar::Util.deep_copy(payload)
18
17
 
19
18
  STRING_THRESHOLDS.each do |threshold|
20
19
  truncate_proc = truncate_strings_proc(threshold)
21
20
 
22
- ::Rollbar::Util.iterate_and_update(new_payload, truncate_proc)
23
- result = dump(new_payload)
21
+ ::Rollbar::Util.iterate_and_update(payload, truncate_proc)
22
+ result = dump(payload)
24
23
 
25
24
  break unless truncate?(result)
26
25
  end
data/lib/rollbar/util.rb CHANGED
@@ -63,9 +63,9 @@ module Rollbar
63
63
 
64
64
  def self.clone_obj(obj)
65
65
  if obj.is_a?(::Hash)
66
- obj.clone
66
+ obj.dup
67
67
  elsif obj.is_a?(Array)
68
- obj.clone.clear
68
+ obj.dup.clear
69
69
  else
70
70
  obj
71
71
  end
@@ -5,6 +5,7 @@ module Rollbar
5
5
  return if seen[hash.object_id]
6
6
 
7
7
  seen[hash.object_id] = true
8
+ replace_seen_children(hash, seen)
8
9
 
9
10
  hash.reduce({}) do |h, (key, value)|
10
11
  h[key.to_s] = map_value(value, :deep_stringify_keys, seen)
@@ -22,12 +23,26 @@ module Rollbar
22
23
  thing
23
24
  else
24
25
  seen[thing.object_id] = true
26
+ replace_seen_children(thing, seen)
25
27
  thing.map { |v| map_value(v, meth, seen) }
26
28
  end
27
29
  else
28
30
  thing
29
31
  end
30
32
  end
33
+
34
+ def self.replace_seen_children(thing, seen)
35
+ case thing
36
+ when ::Hash
37
+ thing.keys.each do |key|
38
+ thing[key] = "removed circular reference: #{thing[key]}" if seen[thing[key].object_id]
39
+ end
40
+ when Array
41
+ thing.each_with_index do |_, i|
42
+ thing[i] = "removed circular reference: #{thing[i]}" if seen[thing[i].object_id]
43
+ end
44
+ end
45
+ end
31
46
  end
32
47
  end
33
48
  end
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = '2.19.3'.freeze
2
+ VERSION = '2.21.0'.freeze
3
3
  end
data/rollbar.gemspec CHANGED
@@ -18,8 +18,6 @@ Gem::Specification.new do |gem|
18
18
  gem.required_ruby_version = '>= 1.9.3'
19
19
  gem.version = Rollbar::VERSION
20
20
 
21
- gem.add_runtime_dependency 'multi_json'
22
-
23
21
  if gem.respond_to?(:metadata)
24
22
  gem.metadata['changelog_uri'] = 'https://github.com/rollbar/rollbar-gem/releases'
25
23
  gem.metadata['source_code_uri'] = 'https://github.com/rollbar/rollbar-gem'
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rollbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.19.3
4
+ version: 2.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rollbar, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-20 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: multi_json
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
11
+ date: 2019-07-12 00:00:00.000000000 Z
12
+ dependencies: []
27
13
  description: Easy and powerful exception tracking for Ruby
28
14
  email:
29
15
  - support@rollbar.com
@@ -59,7 +45,7 @@ files:
59
45
  - gemfiles/rails50.gemfile
60
46
  - gemfiles/rails51.gemfile
61
47
  - gemfiles/rails52.gemfile
62
- - gemfiles/ruby_1_8_and_1_9_2.gemfile
48
+ - gemfiles/rails60.gemfile
63
49
  - lib/generators/rollbar/rollbar_generator.rb
64
50
  - lib/generators/rollbar/templates/initializer.rb
65
51
  - lib/rails/rollbar_runner.rb
@@ -88,8 +74,6 @@ files:
88
74
  - lib/rollbar/item/locals.rb
89
75
  - lib/rollbar/js.rb
90
76
  - lib/rollbar/json.rb
91
- - lib/rollbar/json/default.rb
92
- - lib/rollbar/json/oj.rb
93
77
  - lib/rollbar/language_support.rb
94
78
  - lib/rollbar/lazy_store.rb
95
79
  - lib/rollbar/logger.rb
@@ -128,6 +112,7 @@ files:
128
112
  - lib/rollbar/rails.rb
129
113
  - lib/rollbar/rake_tasks.rb
130
114
  - lib/rollbar/request_data_extractor.rb
115
+ - lib/rollbar/rollbar_test.rb
131
116
  - lib/rollbar/scrubbers.rb
132
117
  - lib/rollbar/scrubbers/params.rb
133
118
  - lib/rollbar/scrubbers/url.rb
@@ -136,6 +121,9 @@ files:
136
121
  - lib/rollbar/truncation/min_body_strategy.rb
137
122
  - lib/rollbar/truncation/mixin.rb
138
123
  - lib/rollbar/truncation/raw_strategy.rb
124
+ - lib/rollbar/truncation/remove_any_key_strategy.rb
125
+ - lib/rollbar/truncation/remove_extra_strategy.rb
126
+ - lib/rollbar/truncation/remove_request_strategy.rb
139
127
  - lib/rollbar/truncation/strings_strategy.rb
140
128
  - lib/rollbar/util.rb
141
129
  - lib/rollbar/util/hash.rb
@@ -169,7 +157,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
157
  - !ruby/object:Gem::Version
170
158
  version: '0'
171
159
  requirements: []
172
- rubygems_version: 3.0.1
160
+ rubyforge_project:
161
+ rubygems_version: 2.7.7
173
162
  signing_key:
174
163
  specification_version: 4
175
164
  summary: Reports exceptions to Rollbar
@@ -1,51 +0,0 @@
1
- require 'rubygems/version'
2
-
3
- source 'https://rubygems.org'
4
-
5
- is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
6
-
7
- gem 'appraisal', '= 1.0.2'
8
- gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
9
- gem 'hitimes', '< 1.2.2'
10
- gem 'jruby-openssl', :platform => :jruby
11
- gem 'rails', '3.0.20'
12
- gem 'rake', '< 11'
13
- gem 'rspec-rails', '>= 2.14.0'
14
- gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
15
-
16
- gem 'oj', '~> 2.12.14' unless is_jruby
17
- if RUBY_VERSION > '1.8.7' && RUBY_VERSION < '2.2.2'
18
- gem 'sidekiq', '>= 2.13.0', '< 5.0'
19
- end
20
-
21
- platforms :rbx do
22
- gem 'minitest'
23
- gem 'racc'
24
- gem 'rubinius-developer_tools'
25
- gem 'rubysl', '~> 2.0' unless RUBY_VERSION.start_with?('1')
26
- end
27
-
28
- if RUBY_VERSION.start_with?('1.9')
29
- gem 'celluloid', '< 0.17.0'
30
- gem 'sucker_punch', '~> 1.0'
31
- elsif RUBY_VERSION.start_with?('2')
32
- gem 'sucker_punch', '~> 2.0'
33
- end
34
-
35
- gem 'database_cleaner', '~> 1.0.0'
36
- gem 'delayed_job', '4.1.3', :require => false
37
- gem 'genspec', '= 0.2.8'
38
- gem 'girl_friday', '>= 0.11.1'
39
- gem 'redis', '< 3.3.5'
40
- gem 'resque', '< 2.0.0'
41
- gem 'sinatra'
42
-
43
- ruby_version = RUBY_VERSION.dup
44
-
45
- if Gem::Version.new(ruby_version) < Gem::Version.new('2.0')
46
- gem 'mime-types', '< 3.0'
47
- end
48
-
49
- gem 'capistrano', '<= 3.4.1', :require => false
50
-
51
- gemspec :path => '../'
@@ -1,11 +0,0 @@
1
- module Rollbar
2
- module JSON
3
- module Default
4
- module_function
5
-
6
- def options
7
- {}
8
- end
9
- end
10
- end
11
- end
@@ -1,16 +0,0 @@
1
- module Rollbar
2
- module JSON
3
- module Oj
4
- module_function
5
-
6
- def options
7
- {
8
- :mode => :compat,
9
- :use_to_json => false,
10
- :symbol_keys => false,
11
- :circular => false
12
- }
13
- end
14
- end
15
- end
16
- end