Sha256: 57393386754def34aab0db0b9fbbc404d140e45fb7eb3e0eba88b59283d65f86

Contents?: true

Size: 1.87 KB

Versions: 8

Compression:

Stored size: 1.87 KB

Contents

# Use EXTEND vs INCLUDE and magically the Class will inherit instead of instance. Magical! :)
# http://www.railstips.org/blog/archives/2009/05/15/include-vs-extend-in-ruby/
# 
# include Storazzo::Colors 
# extend Storazzo::Colors 
# 

module Storazzo 
    # needs to be defined before
end 

module Storazzo::Colors

    PREPEND_ME = "[Storazzo::Colors] "


    def deb2(s);   puts "#DEB_OBSOLETE #{gray(s)} [include Storazzo::Common instead]" if $DEBUG; end # Use the Common instead

    # colors 16
    def yellow(s)  "\033[1;33m#{s}\033[0m" ; end
    def gray(s)    "\033[1;30m#{s}\033[0m" ; end
    def green(s)   "\033[1;32m#{s}\033[0m" ; end
    def red(s)     "\033[1;31m#{s}\033[0m" ; end
    def blue(s)  "\033[1;34m#{s}\033[0m" ; end
    def purple(s)  "\033[1;35m#{s}\033[0m" ; end
    def azure(s)   "\033[1;36m#{s}\033[0m" ; end
    def white(s)   "\033[1;37m#{s}\033[0m" ; end

    # colors 64k
    def orange(s)   "\033[38;5;208m#{s}\033[0m" ; end

    # i dont undertstand why i need self :/
    # SELF version because I'm just stupid or lazy or both.
    # def self.yellow(s)  "#{PREPEND_ME}\033[1;33m#{s}\033[0m" ; end
    # def self.green(s)   "#{PREPEND_ME}\033[1;32m#{s}\033[0m" ; end
    #     def self.gray(s)    "#{PREPEND_ME}\033[1;30m#{s}\033[0m" ; end
    #     def self.green(s)   "#{PREPEND_ME}\033[1;32m#{s}\033[0m" ; end
    #     def self.red(s)     "#{PREPEND_ME}\033[1;31m#{s}\033[0m" ; end
    #     def self.blue(s)  "#{PREPEND_ME}\033[1;34m#{s}\033[0m" ; end
    #     def self.purple(s)  "#{PREPEND_ME}\033[1;35m#{s}\033[0m" ; end
    #     def self.azure(s)   "#{PREPEND_ME}\033[1;36m#{s}\033[0m" ; end
    #     def self.white(s)   "#{PREPEND_ME}\033[1;37m#{s}\033[0m" ; end
    
    # p<COLOR> Carlessian functions..
    def pwhite(s) puts(white(s)); end
    def pgreen(s) puts(green(s)); end
    def pred(s) puts(red(s)); end
    def pyellow(s) puts(yellow(s)); end

end
#end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
storazzo-0.4.10 lib/storazzo/colors.rb
storazzo-0.4.9 lib/storazzo/colors.rb
storazzo-0.4.5 lib/storazzo/colors.rb
storazzo-0.4.2 lib/storazzo/colors.rb
storazzo-0.4.1 lib/storazzo/colors.rb
storazzo-0.3.8 lib/storazzo/colors.rb
storazzo-0.3.7 lib/storazzo/colors.rb
storazzo-0.3.5 lib/storazzo/colors.rb