honeybadger 3.0.0.beta3 → 3.0.0.beta4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef358343631ed41e76b4c190d9f9d4c2043b5b7f
4
- data.tar.gz: e51e3bf906a01a7285a7a57984384aa052c277c9
3
+ metadata.gz: bd4f9a7c10b39fcdadf65441f1ba5cbba9b5d3e6
4
+ data.tar.gz: 397e6c4ecc0456afe8b097b45eff87d512688277
5
5
  SHA512:
6
- metadata.gz: 6df0419507347e6adc9d5431f2f010ead324c0b5a751648833fbbf0a40063f76e1f8b3dde309973c820f6f3546ae0f90ec40e5d08e776507c1ac6191b7292249
7
- data.tar.gz: 99df9b3f9101ff54108b1b18f2333683949586009fee22c7c2ed08b12817d9d1672bca493505ee929778bbc7e798b990a0ab9a434c4ab358ec54c633bc9b903f
6
+ metadata.gz: fe2f9fb1c7806a528f9927e127ce33d1931c78bbe0285c80e5993cada0bb646f3bda858e6b178bd370bb98698ac86e238d96683ccc80105817b2f8daa0da3d58
7
+ data.tar.gz: 62ed1567abeb8b94002efdfd3b355851021635d34e7c2ef728c2a15bf7c984ab3e36f2bb853eb1a34f6c39c473ab48645ef406eba16c512076634428c660752a
data/README.md CHANGED
@@ -12,7 +12,7 @@ When an uncaught exception occurs, Honeybadger will POST the relevant data to th
12
12
  | Ruby Interpreter | Supported Version |
13
13
  | ---- | ---- |
14
14
  | MRI | >= 2.1.0 |
15
- | Rubinius | >= 2.0 |
15
+ | JRuby | >= 9.1 |
16
16
 
17
17
  ## Supported web frameworks
18
18
 
@@ -37,8 +37,11 @@ module Honeybadger
37
37
  end
38
38
 
39
39
  if filtered_line
40
- _, file, number, method = unparsed_line.match(INPUT_FORMAT).to_a
41
- _, *filtered_args = filtered_line.match(INPUT_FORMAT).to_a
40
+ match = unparsed_line.match(INPUT_FORMAT) || [].freeze
41
+ fmatch = filtered_line.match(INPUT_FORMAT) || [].freeze
42
+
43
+ file, number, method = match[1], match[2], match[3]
44
+ filtered_args = [fmatch[1], fmatch[2], fmatch[3]]
42
45
  new(file, number, method, *filtered_args, opts.fetch(:source_radius, 2))
43
46
  else
44
47
  nil
@@ -22,9 +22,8 @@ module Honeybadger
22
22
  local_username: options['user']
23
23
  }
24
24
 
25
- http = Util::HTTP.new(config)
26
- result = http.post('/v1/deploys', payload)
27
- if result.code == '201'
25
+ result = config.backend.notify(:deploys, payload)
26
+ if result.success?
28
27
  say("Deploy notification complete.", :green)
29
28
  else
30
29
  say("Invalid response from server: #{result.code}", :red)
@@ -52,6 +52,7 @@ MSG
52
52
  result = exec_cmd
53
53
  return if result.success
54
54
 
55
+ executable = args.first.to_s[/\S+/]
55
56
  payload = {
56
57
  api_key: config.get(:api_key),
57
58
  notifier: NOTIFIER,
@@ -60,10 +61,13 @@ MSG
60
61
  message: result.msg
61
62
  },
62
63
  request: {
64
+ component: executable,
63
65
  context: {
64
- executable: args.first,
66
+ command: args.join(' '),
65
67
  code: result.code,
66
- pid: result.pid
68
+ pid: result.pid,
69
+ pwd: Dir.pwd,
70
+ path: ENV['PATH']
67
71
  }
68
72
  },
69
73
  server: {
@@ -74,16 +78,14 @@ MSG
74
78
  }
75
79
  }
76
80
 
77
- http = Util::HTTP.new(config)
78
-
79
81
  begin
80
- response = http.post('/v1/notices', payload)
82
+ response = config.backend.notify(:notices, payload)
81
83
  rescue
82
84
  say(result.msg)
83
85
  raise
84
86
  end
85
87
 
86
- if response.code != '201'
88
+ if !response.success?
87
89
  say(result.msg)
88
90
  say("\nFailed to notify Honeybadger: #{response.code}", :red)
89
91
  exit(1)
@@ -110,9 +112,10 @@ MSG
110
112
  def exec_cmd
111
113
  stdout, stderr, status = Open3.capture3(args.join(' '))
112
114
 
115
+ success = status.success? && stderr =~ BLANK
113
116
  pid = status.pid
114
117
  code = status.to_i
115
- msg = ERB.new(FAILED_TEMPLATE).result(binding) unless status.success?
118
+ msg = ERB.new(FAILED_TEMPLATE).result(binding) unless success
116
119
 
117
120
  OpenStruct.new(
118
121
  msg: msg,
@@ -120,7 +123,7 @@ MSG
120
123
  code: code,
121
124
  stdout: stdout,
122
125
  stderr: stderr,
123
- success: status.success? && stderr =~ BLANK
126
+ success: success
124
127
  )
125
128
  rescue Errno::EACCES, Errno::ENOEXEC
126
129
  OpenStruct.new(
@@ -27,6 +27,24 @@ module Honeybadger
27
27
  option :environment, required: false, aliases: [:'-e', :'-env'], type: :string, desc: 'Environment this command is being executed in (i.e. "production", "staging")'
28
28
  end
29
29
 
30
+ def help(*args, &block)
31
+ if args.size == 0
32
+ say(<<-WELCOME)
33
+ ⚡ Honeybadger v#{VERSION}
34
+
35
+ Honeybadger is your favorite error tracker for Ruby. When your app raises an
36
+ exception we notify you with all the context you need to fix it.
37
+
38
+ The Honeybadger CLI provides tools for interacting with Honeybadger via the
39
+ command line.
40
+
41
+ If you need support, please drop us a line: support@honeybadger.io
42
+
43
+ WELCOME
44
+ end
45
+ super
46
+ end
47
+
30
48
  desc 'install API_KEY', 'Install Honeybadger into a new project'
31
49
  def install(api_key)
32
50
  Install.new(options, api_key).run
@@ -31,6 +31,8 @@ module Honeybadger
31
31
 
32
32
  NOT_BLANK = Regexp.new('\S').freeze
33
33
 
34
+ IVARS = [:@ruby, :@env, :@yaml, :@framework].freeze
35
+
34
36
  def initialize(opts = {})
35
37
  @ruby = opts.freeze
36
38
  @env = {}.freeze
@@ -78,7 +80,7 @@ module Honeybadger
78
80
  end
79
81
 
80
82
  def get(key)
81
- [:@ruby, :@env, :@yaml, :@framework].each do |var|
83
+ IVARS.each do |var|
82
84
  source = instance_variable_get(var)
83
85
  if source.has_key?(key)
84
86
  return source[key]
@@ -8,7 +8,7 @@ module Honeybadger
8
8
  extend Forwardable
9
9
  extend self
10
10
 
11
- def_delegators :'Agent.instance', :init!, :config, :configure,
11
+ def_delegators :'Honeybadger::Agent.instance', :init!, :config, :configure,
12
12
  :context, :get_context, :flush, :stop, :with_rack_env, :exception_filter,
13
13
  :exception_fingerprint, :backtrace_filter
14
14
 
@@ -151,12 +151,7 @@ module Honeybadger
151
151
 
152
152
  def valid_encoding(string)
153
153
  return string if valid_encoding?(string)
154
-
155
- if string.encoding == Encoding::UTF_8
156
- string.encode(Encoding::UTF_16, ENCODE_OPTS).encode!(Encoding::UTF_8)
157
- else
158
- string.encode(Encoding::UTF_8, ENCODE_OPTS)
159
- end
154
+ string.encode(Encoding::UTF_8, ENCODE_OPTS)
160
155
  end
161
156
 
162
157
  def enumerable?(data)
@@ -1,4 +1,4 @@
1
1
  module Honeybadger
2
2
  # Public: The current String Honeybadger version.
3
- VERSION = '3.0.0.beta3'.freeze
3
+ VERSION = '3.0.0.beta4'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeybadger
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.beta3
4
+ version: 3.0.0.beta4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Honeybadger Industries LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-09 00:00:00.000000000 Z
11
+ date: 2017-01-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Make managing application errors a more pleasant experience.
14
14
  email:
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  version: 1.3.1
141
141
  requirements: []
142
142
  rubyforge_project:
143
- rubygems_version: 2.5.2
143
+ rubygems_version: 2.6.8
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: Error reports you can be happy about.