pretty_trace 0.2.3 → 0.2.4

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
  SHA256:
3
- metadata.gz: f98056959f80ff0c230362e740ef66abcb94559de3307ce38a921057823bc13e
4
- data.tar.gz: 1e88718ebbb557c228c290b7ef5ab92e44d2b05dd9bd26c8dafc9427e45843ea
3
+ metadata.gz: 998231e5021510cf4ddf8970561786c2084624d077a6fc0b7d654d9c2360316b
4
+ data.tar.gz: 9989169dedbbf6e29396e5e47288b592a9dc39f07226e02e7fb58898c20c2052
5
5
  SHA512:
6
- metadata.gz: 28a3bbd855e010202ae65fd9aa148c4bc8057bbf7b7eaad35684b058559c9b3fa110383b2d54b24d73302ce467f5d03d8154c7358766c08136a3339c5012f907
7
- data.tar.gz: 5275e4e0107589968d4e90fb9209e5f25bd8003d78df2852192a55892785177317f9f1a9defed665008e5dd6b3c71850dddcf18461337dfe1a581b880920a1fa
6
+ metadata.gz: 8386fc1d2cfe96262be420d6d9eba16153f343a7077e288fb65d2997c386a8264ecac1b8f89d6e7666880645dd6b5af88ed3a8e79321db1b32e07ee0f7767fd1
7
+ data.tar.gz: 3122c609e0fff5c96a477523ad740a5c33bab434b32f6639bcbb07c3d9f371085e0fd7b7242156818748bc742e0e4ffb362815d360a446b662eb8bea2003b186
data/lib/pretty_trace.rb CHANGED
@@ -4,3 +4,5 @@ require 'pretty_trace/backtrace_item'
4
4
  require 'pretty_trace/handler'
5
5
  require 'pretty_trace/structured_backtrace'
6
6
  require 'pretty_trace/module_methods'
7
+
8
+ require 'byebug' if ENV['BYEBUG']
@@ -45,7 +45,9 @@ module PrettyTrace
45
45
  def show_errors(exception)
46
46
  # :nocov:
47
47
  backtrace = StructuredBacktrace.new exception.backtrace, options
48
- puts "\n#{backtrace}"
48
+
49
+ puts "\n#{backtrace}" unless backtrace.empty?
50
+
49
51
  message = exception.message
50
52
  if message.empty?
51
53
  puts "\n%{blue}#{exception.class}%{reset}\n" % colors
@@ -24,7 +24,9 @@ module PrettyTrace
24
24
  result.reverse!
25
25
  result.uniq!(&:path) if should_trim? result
26
26
 
27
- result.push first_line unless first_line.original_line == result[-1].original_line
27
+ if first_line and first_line.original_line != result[-1].original_line
28
+ result.push first_line
29
+ end
28
30
 
29
31
  result
30
32
  end
@@ -37,6 +39,10 @@ module PrettyTrace
37
39
  formatted_backtrace.join "\n"
38
40
  end
39
41
 
42
+ def empty?
43
+ formatted_backtrace.empty?
44
+ end
45
+
40
46
  private
41
47
 
42
48
  def should_trim?(backtrace)
@@ -1,3 +1,3 @@
1
1
  module PrettyTrace
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pretty_trace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-25 00:00:00.000000000 Z
11
+ date: 2019-12-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Display clean and colorful error messages and backtrace
14
14
  email: db@dannyben.com