Class: PrettyTrace::Handler

Inherits:
Object
  • Object
show all
Extended by:
Colors
Defined in:
lib/pretty_trace/handler.rb

Class Attribute Summary collapse

Class Method Summary collapse

Methods included from Colors

colors

Class Attribute Details

.optionsObject



33
34
35
# File 'lib/pretty_trace/handler.rb', line 33

def options
  @options ||= default_options
end

Class Method Details

.debug_tip?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/pretty_trace/handler.rb', line 29

def debug_tip?
  !!(options[:debug_tip] and ENV['PRETTY_TRACE'] != 'full')
end

.disableObject



21
22
23
# File 'lib/pretty_trace/handler.rb', line 21

def disable
  @enabled = false
end

.enableObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/pretty_trace/handler.rb', line 8

def enable
  @enabled = true
  # :nocov: - this is actually covered through an external process
  at_exit do
    if @enabled && $! && !ignored.include?($!.class)
      show_errors $!
      $stderr.reopen IO::NULL
      $stdout.reopen IO::NULL
    end
  end
  # :nocov:
end

.enabled?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/pretty_trace/handler.rb', line 25

def enabled?
  @enabled
end