honeybadger 5.0.2 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +713 -701
  3. data/LICENSE +19 -19
  4. data/README.md +57 -57
  5. data/TROUBLESHOOTING.md +3 -3
  6. data/bin/honeybadger +5 -5
  7. data/lib/honeybadger/agent.rb +488 -488
  8. data/lib/honeybadger/backend/base.rb +116 -116
  9. data/lib/honeybadger/backend/debug.rb +22 -22
  10. data/lib/honeybadger/backend/null.rb +29 -29
  11. data/lib/honeybadger/backend/server.rb +62 -62
  12. data/lib/honeybadger/backend/test.rb +46 -46
  13. data/lib/honeybadger/backend.rb +27 -27
  14. data/lib/honeybadger/backtrace.rb +181 -181
  15. data/lib/honeybadger/breadcrumbs/active_support.rb +119 -119
  16. data/lib/honeybadger/breadcrumbs/breadcrumb.rb +53 -53
  17. data/lib/honeybadger/breadcrumbs/collector.rb +82 -82
  18. data/lib/honeybadger/breadcrumbs/logging.rb +51 -51
  19. data/lib/honeybadger/breadcrumbs/ring_buffer.rb +44 -44
  20. data/lib/honeybadger/breadcrumbs.rb +8 -8
  21. data/lib/honeybadger/cli/deploy.rb +43 -43
  22. data/lib/honeybadger/cli/exec.rb +143 -143
  23. data/lib/honeybadger/cli/helpers.rb +28 -28
  24. data/lib/honeybadger/cli/heroku.rb +129 -129
  25. data/lib/honeybadger/cli/install.rb +101 -101
  26. data/lib/honeybadger/cli/main.rb +237 -237
  27. data/lib/honeybadger/cli/notify.rb +67 -67
  28. data/lib/honeybadger/cli/test.rb +267 -267
  29. data/lib/honeybadger/cli.rb +14 -14
  30. data/lib/honeybadger/config/defaults.rb +336 -333
  31. data/lib/honeybadger/config/env.rb +42 -42
  32. data/lib/honeybadger/config/ruby.rb +146 -146
  33. data/lib/honeybadger/config/yaml.rb +76 -76
  34. data/lib/honeybadger/config.rb +413 -413
  35. data/lib/honeybadger/const.rb +20 -20
  36. data/lib/honeybadger/context_manager.rb +55 -55
  37. data/lib/honeybadger/conversions.rb +16 -16
  38. data/lib/honeybadger/init/rails.rb +38 -38
  39. data/lib/honeybadger/init/rake.rb +66 -66
  40. data/lib/honeybadger/init/ruby.rb +11 -11
  41. data/lib/honeybadger/init/sinatra.rb +51 -51
  42. data/lib/honeybadger/logging.rb +177 -177
  43. data/lib/honeybadger/notice.rb +579 -568
  44. data/lib/honeybadger/plugin.rb +210 -210
  45. data/lib/honeybadger/plugins/breadcrumbs.rb +111 -111
  46. data/lib/honeybadger/plugins/delayed_job/plugin.rb +56 -56
  47. data/lib/honeybadger/plugins/delayed_job.rb +22 -22
  48. data/lib/honeybadger/plugins/faktory.rb +52 -52
  49. data/lib/honeybadger/plugins/lambda.rb +71 -71
  50. data/lib/honeybadger/plugins/local_variables.rb +44 -44
  51. data/lib/honeybadger/plugins/passenger.rb +23 -23
  52. data/lib/honeybadger/plugins/rails.rb +72 -63
  53. data/lib/honeybadger/plugins/resque.rb +72 -72
  54. data/lib/honeybadger/plugins/shoryuken.rb +52 -52
  55. data/lib/honeybadger/plugins/sidekiq.rb +71 -62
  56. data/lib/honeybadger/plugins/sucker_punch.rb +18 -18
  57. data/lib/honeybadger/plugins/thor.rb +32 -32
  58. data/lib/honeybadger/plugins/warden.rb +19 -19
  59. data/lib/honeybadger/rack/error_notifier.rb +92 -92
  60. data/lib/honeybadger/rack/user_feedback.rb +88 -88
  61. data/lib/honeybadger/rack/user_informer.rb +45 -45
  62. data/lib/honeybadger/ruby.rb +2 -2
  63. data/lib/honeybadger/singleton.rb +103 -103
  64. data/lib/honeybadger/tasks.rb +22 -22
  65. data/lib/honeybadger/templates/feedback_form.erb +84 -84
  66. data/lib/honeybadger/util/http.rb +92 -92
  67. data/lib/honeybadger/util/lambda.rb +32 -32
  68. data/lib/honeybadger/util/request_hash.rb +73 -73
  69. data/lib/honeybadger/util/request_payload.rb +41 -41
  70. data/lib/honeybadger/util/revision.rb +39 -39
  71. data/lib/honeybadger/util/sanitizer.rb +214 -214
  72. data/lib/honeybadger/util/sql.rb +34 -34
  73. data/lib/honeybadger/util/stats.rb +50 -50
  74. data/lib/honeybadger/version.rb +4 -4
  75. data/lib/honeybadger/worker.rb +253 -253
  76. data/lib/honeybadger.rb +11 -11
  77. data/resources/ca-bundle.crt +3376 -3376
  78. data/vendor/capistrano-honeybadger/lib/capistrano/honeybadger.rb +5 -5
  79. data/vendor/capistrano-honeybadger/lib/capistrano/tasks/deploy.cap +89 -89
  80. data/vendor/capistrano-honeybadger/lib/honeybadger/capistrano/legacy.rb +47 -47
  81. data/vendor/capistrano-honeybadger/lib/honeybadger/capistrano.rb +2 -2
  82. data/vendor/cli/inifile.rb +628 -628
  83. data/vendor/cli/thor/actions/create_file.rb +103 -103
  84. data/vendor/cli/thor/actions/create_link.rb +59 -59
  85. data/vendor/cli/thor/actions/directory.rb +118 -118
  86. data/vendor/cli/thor/actions/empty_directory.rb +135 -135
  87. data/vendor/cli/thor/actions/file_manipulation.rb +316 -316
  88. data/vendor/cli/thor/actions/inject_into_file.rb +107 -107
  89. data/vendor/cli/thor/actions.rb +319 -319
  90. data/vendor/cli/thor/base.rb +656 -656
  91. data/vendor/cli/thor/command.rb +133 -133
  92. data/vendor/cli/thor/core_ext/hash_with_indifferent_access.rb +77 -77
  93. data/vendor/cli/thor/core_ext/io_binary_read.rb +10 -10
  94. data/vendor/cli/thor/core_ext/ordered_hash.rb +98 -98
  95. data/vendor/cli/thor/error.rb +32 -32
  96. data/vendor/cli/thor/group.rb +281 -281
  97. data/vendor/cli/thor/invocation.rb +178 -178
  98. data/vendor/cli/thor/line_editor/basic.rb +35 -35
  99. data/vendor/cli/thor/line_editor/readline.rb +88 -88
  100. data/vendor/cli/thor/line_editor.rb +17 -17
  101. data/vendor/cli/thor/parser/argument.rb +73 -73
  102. data/vendor/cli/thor/parser/arguments.rb +175 -175
  103. data/vendor/cli/thor/parser/option.rb +125 -125
  104. data/vendor/cli/thor/parser/options.rb +218 -218
  105. data/vendor/cli/thor/parser.rb +4 -4
  106. data/vendor/cli/thor/rake_compat.rb +71 -71
  107. data/vendor/cli/thor/runner.rb +322 -322
  108. data/vendor/cli/thor/shell/basic.rb +421 -421
  109. data/vendor/cli/thor/shell/color.rb +149 -149
  110. data/vendor/cli/thor/shell/html.rb +126 -126
  111. data/vendor/cli/thor/shell.rb +81 -81
  112. data/vendor/cli/thor/util.rb +267 -267
  113. data/vendor/cli/thor/version.rb +3 -3
  114. data/vendor/cli/thor.rb +484 -484
  115. metadata +10 -5
@@ -1,101 +1,101 @@
1
- require 'forwardable'
2
- require 'honeybadger/cli/main'
3
- require 'honeybadger/cli/test'
4
- require 'pathname'
5
-
6
- module Honeybadger
7
- module CLI
8
- class Install
9
- extend Forwardable
10
-
11
- def initialize(options, api_key)
12
- @options = options
13
- @api_key = api_key
14
- @shell = ::Thor::Base.shell.new
15
- end
16
-
17
- def run
18
- say("Installing Honeybadger #{VERSION}")
19
-
20
- begin
21
- require File.join(Dir.pwd, 'config', 'application.rb')
22
- raise LoadError unless defined?(::Rails.application)
23
- root = Rails.root
24
- config_root = root.join('config')
25
- rescue LoadError
26
- root = config_root = Pathname.new(Dir.pwd)
27
- end
28
-
29
- config_path = config_root.join('honeybadger.yml')
30
-
31
- if config_path.exist?
32
- say("You're already on Honeybadger, so you're all set.", :yellow)
33
- else
34
- say("Writing configuration to: #{config_path}", :yellow)
35
-
36
- path = config_path
37
-
38
- if path.exist?
39
- say("The configuration file #{config_path} already exists.", :red)
40
- exit(1)
41
- elsif !path.dirname.writable?
42
- say("The configuration path #{config_path.dirname} is not writable.", :red)
43
- exit(1)
44
- end
45
-
46
- default_env = defined?(::Rails.application) ? "Rails.env" : "ENV['RUBY_ENV'] || ENV['RACK_ENV']"
47
- default_root = defined?(::Rails.application) ? "Rails.root.to_s" : "Dir.pwd"
48
- File.open(path, 'w+') do |file|
49
- file.write(<<-CONFIG)
50
- ---
51
- # For more options, see https://docs.honeybadger.io/lib/ruby/gem-reference/configuration
52
-
53
- api_key: '#{api_key}'
54
-
55
- # The environment your app is running in.
56
- env: "<%= #{default_env} %>"
57
-
58
- # The absolute path to your project folder.
59
- root: "<%= #{default_root} %>"
60
-
61
- # Honeybadger won't report errors in these environments.
62
- development_environments:
63
- - test
64
- - development
65
- - cucumber
66
-
67
- # By default, Honeybadger won't report errors in the development_environments.
68
- # You can override this by explicitly setting report_data to true or false.
69
- # report_data: true
70
-
71
- # The current Git revision of your project. Defaults to the last commit hash.
72
- # revision: null
73
-
74
- # Enable verbose debug logging (useful for troubleshooting).
75
- debug: false
76
- CONFIG
77
- end
78
- end
79
-
80
- if (capfile = root.join('Capfile')).exist?
81
- if capfile.read.match(/honeybadger/)
82
- say("Detected Honeybadger in Capfile; skipping Capistrano installation.", :yellow)
83
- else
84
- say("Appending Capistrano tasks to: #{capfile}", :yellow)
85
- File.open(capfile, 'a') do |f|
86
- f.puts("\nrequire 'capistrano/honeybadger'")
87
- end
88
- end
89
- end
90
-
91
- Test.new({install: true}.freeze).run
92
- end
93
-
94
- private
95
-
96
- attr_reader :options, :api_key
97
-
98
- def_delegator :@shell, :say
99
- end
100
- end
101
- end
1
+ require 'forwardable'
2
+ require 'honeybadger/cli/main'
3
+ require 'honeybadger/cli/test'
4
+ require 'pathname'
5
+
6
+ module Honeybadger
7
+ module CLI
8
+ class Install
9
+ extend Forwardable
10
+
11
+ def initialize(options, api_key)
12
+ @options = options
13
+ @api_key = api_key
14
+ @shell = ::Thor::Base.shell.new
15
+ end
16
+
17
+ def run
18
+ say("Installing Honeybadger #{VERSION}")
19
+
20
+ begin
21
+ require File.join(Dir.pwd, 'config', 'application.rb')
22
+ raise LoadError unless defined?(::Rails.application)
23
+ root = Rails.root
24
+ config_root = root.join('config')
25
+ rescue LoadError
26
+ root = config_root = Pathname.new(Dir.pwd)
27
+ end
28
+
29
+ config_path = config_root.join('honeybadger.yml')
30
+
31
+ if config_path.exist?
32
+ say("You're already on Honeybadger, so you're all set.", :yellow)
33
+ else
34
+ say("Writing configuration to: #{config_path}", :yellow)
35
+
36
+ path = config_path
37
+
38
+ if path.exist?
39
+ say("The configuration file #{config_path} already exists.", :red)
40
+ exit(1)
41
+ elsif !path.dirname.writable?
42
+ say("The configuration path #{config_path.dirname} is not writable.", :red)
43
+ exit(1)
44
+ end
45
+
46
+ default_env = defined?(::Rails.application) ? "Rails.env" : "ENV['RUBY_ENV'] || ENV['RACK_ENV']"
47
+ default_root = defined?(::Rails.application) ? "Rails.root.to_s" : "Dir.pwd"
48
+ File.open(path, 'w+') do |file|
49
+ file.write(<<-CONFIG)
50
+ ---
51
+ # For more options, see https://docs.honeybadger.io/lib/ruby/gem-reference/configuration
52
+
53
+ api_key: '#{api_key}'
54
+
55
+ # The environment your app is running in.
56
+ env: "<%= #{default_env} %>"
57
+
58
+ # The absolute path to your project folder.
59
+ root: "<%= #{default_root} %>"
60
+
61
+ # Honeybadger won't report errors in these environments.
62
+ development_environments:
63
+ - test
64
+ - development
65
+ - cucumber
66
+
67
+ # By default, Honeybadger won't report errors in the development_environments.
68
+ # You can override this by explicitly setting report_data to true or false.
69
+ # report_data: true
70
+
71
+ # The current Git revision of your project. Defaults to the last commit hash.
72
+ # revision: null
73
+
74
+ # Enable verbose debug logging (useful for troubleshooting).
75
+ debug: false
76
+ CONFIG
77
+ end
78
+ end
79
+
80
+ if (capfile = root.join('Capfile')).exist?
81
+ if capfile.read.match(/honeybadger/)
82
+ say("Detected Honeybadger in Capfile; skipping Capistrano installation.", :yellow)
83
+ else
84
+ say("Appending Capistrano tasks to: #{capfile}", :yellow)
85
+ File.open(capfile, 'a') do |f|
86
+ f.puts("\nrequire 'capistrano/honeybadger'")
87
+ end
88
+ end
89
+ end
90
+
91
+ Test.new({install: true}.freeze).run
92
+ end
93
+
94
+ private
95
+
96
+ attr_reader :options, :api_key
97
+
98
+ def_delegator :@shell, :say
99
+ end
100
+ end
101
+ end