Module: Blab::Config

Extended by:
Config
Included in:
Config
Defined in:
lib/blab/config.rb

Constant Summary collapse

DATETIME_FORMAT =
"%H:%M:%S.%L"
DEFAULT_OUTPUT =
[
  { type: :time, order: 1, width: 12 },
  { type: :event, order: 2, width: 6 },
  { type: :file_lines, order: 3, width: 50 },
  #{ type: :class_name, order: 4, width: 10 },
  #{ type: :method_name, order: 5, width: 12 },
  { type: :code_lines, order: 5, width: 120 }
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#datetime_formatObject



48
49
50
# File 'lib/blab/config.rb', line 48

def datetime_format
  @datetime_format ||= DATETIME_FORMAT
end

#log_outputObject



36
37
38
# File 'lib/blab/config.rb', line 36

def log_output
  @log_output ||= STDOUT
end

#loggerObject



28
29
30
31
32
33
34
# File 'lib/blab/config.rb', line 28

def logger
  @logger ||= begin
    logger = Logger.new(log_output)
    logger.formatter = proc { |severity, datetime, progname, msg| "#{msg}\n" }
    logger
  end
end

#original_scope_only=(value) ⇒ Object (writeonly)

Sets the attribute original_scope_only

Parameters:

  • value

    the value to set the attribute original_scope_only to.



20
21
22
# File 'lib/blab/config.rb', line 20

def original_scope_only=(value)
  @original_scope_only = value
end

#output_configObject



44
45
46
# File 'lib/blab/config.rb', line 44

def output_config
  @output_config ||= output_order.sort_by { |h| h[:order] }.map! { |h| [h[:type], h[:width]] }
end

#output_orderObject



40
41
42
# File 'lib/blab/config.rb', line 40

def output_order
  @output_order ||= DEFAULT_OUTPUT
end

#trace_c_calls=(value) ⇒ Object (writeonly)

Sets the attribute trace_c_calls

Parameters:

  • value

    the value to set the attribute trace_c_calls to.



20
21
22
# File 'lib/blab/config.rb', line 20

def trace_c_calls=(value)
  @trace_c_calls = value
end

Instance Method Details

#original_scope_only?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/blab/config.rb', line 56

def original_scope_only?
  @original_scope_only ||= false
end

#trace_c_calls?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/blab/config.rb', line 52

def trace_c_calls?
  @trace_c_calls ||= false
end