Sha256: c3465b6922c7c63bcbeb5b65c628fff81713b65ba3026259acc491b2e9d6bc86

Contents?: true

Size: 468 Bytes

Versions: 10

Compression:

Stored size: 468 Bytes

Contents

# frozen_string_literal: true

def pdb(thing = nil, backtrace_offset: 0, **keywords)
  backtrace_line = caller[backtrace_offset].split(':')[0..1].join(':')
  thing = keywords if thing.eql?(nil) && keywords.any?
  thing = thing.inspect unless thing.is_a?(String)

  puts(
    (
      'PDB' + ': ' + thing
    ).colorize(color: :black, background: :light_white) +
      " @ #{backtrace_line}".colorize(color: :blue, background: :light_white)
  )
  puts "\n"
  thing
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ledger_sync-1.3.2 lib/ledger_sync/util/debug.rb
ledger_sync-1.3.1 lib/ledger_sync/util/debug.rb
ledger_sync-1.1.3 lib/ledger_sync/util/debug.rb
ledger_sync-1.1.2 lib/ledger_sync/util/debug.rb
ledger_sync-1.1.1 lib/ledger_sync/util/debug.rb
ledger_sync-1.0.10 lib/ledger_sync/util/debug.rb
ledger_sync-1.0.9 lib/ledger_sync/util/debug.rb
ledger_sync-1.0.3 lib/ledger_sync/util/debug.rb
ledger_sync-1.0.2 lib/ledger_sync/util/debug.rb
ledger_sync-1.0.0 lib/ledger_sync/util/debug.rb