Sha256: bf072de5fe86dc2e14fe3b95b55c92004853c1f1b02dc9f83172d96f021b8b6a

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

# Ric common stuff! :)
#
# Usage:
#      include Storazzo::Common  (def to def)
# or
#      extend Storazzo::Common   (def to def self.XX)
#
require_relative 'colors'
require 'pry'

module Storazzo::Common 

    include Storazzo::Colors 


    def deb(s)
        puts "[DEB🐞] #{yellow(s)}" if _debug_true # $DEBUG
    end
    # this has a yield
    def if_deb?()
        if _debug_true # $DEBUG
            deb "== yield START =="
            yield 
            deb "== yield END =="
        end
    end
    def warn(s)
        puts "[W⚠️RN] #{azure(s)}"
    end
    def err(str)
        puts "[ERR⛔] #{red(s)}"
    end
    def bug(s)
        puts "[🐛] #{gray s}"
    end
    def pverbose(is_verbose, str)
        puts "[V📚RB💀S📚] #{gray str}"
    end
    def ppp(complex_object_to_colorize)
        # TODO i need to learn to return without printing..
        Pry::ColorPrinter.pp(complex_object_to_colorize)
    end

private
    def _debug_true
        $DEBUG or ENV["DEBUG"] == 'true'
    end

#    puts "[DEBUG ENABLED!]" if _debug_true
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
storazzo-0.4.5 lib/storazzo/common.rb