This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
commit cc6b98ef2ce64d12048e0a76a60194735a130f0e
tree 9a80d10dd91f5012cb107a888c434070d9d3901c
parent 81d3eaf42f10d924f7b688af00cc7252112f82cb parent a89ad01723b7be09b27213a80dd6f691c9b8cc1b
tree 9a80d10dd91f5012cb107a888c434070d9d3901c
parent 81d3eaf42f10d924f7b688af00cc7252112f82cb parent a89ad01723b7be09b27213a80dd6f691c9b8cc1b
colorize /
| name | age | message | |
|---|---|---|---|
| |
Colorize.rb | ||
| |
README | ||
| |
colorize.gemspec | ||
| |
colorize.rb | ||
| |
lib/ | ||
| |
test/ |
README
Something should go here , but well .. I have nothing more to say that it is a freebe
under GPL 3.0 licence :)
Cheers
FreedomCoder
DOCS :
Colors:
:bold
:underline
:blink
:reverse
:concealed
:black
:red
:green
:yellow
:blue
:magenta
:cyan
:white
:on_black
:on_red
:on_green
:on_yellow
:on_blue
:on_magenta
:on_cyan
:on_white
===== test.rb ========
require "Colorize"
class Klass
include Colors
def initialize
system("echo #{red("hola")} This is a #{blue("test")}")
system("echo #{red on_white("Hola1")}")
puts "#{red on_blue("Hola2")}"
end
end
Klass.new
html = "<html>
<body>
<dl>
<dt>the first term</dt>
<dd>its definition</dd>
<dt>the second term</dt>
<dd>its definition</dd>
<dt>the third term</dt>
<dd>\"its definition\"</dd>
<img src=\"test.html\">
</dl>
</body>
</html>"
c = Colorize.new( :red => /<.*html>|<.*body>/,
:blue => /".*"/,
:cyan => /src/)
puts c.paint(html)
apachelog = "1.2.3.4 -- \"This is not\" - \"No way\".
4.3.2.1 -- \"This3 34 is not\" - \"No way 34343\".
4.3.2.1 -- \"This3 34 is not\" - \"No way 34343\"."
reg = /(.*) -- \"(.*)\" - \"(.*)\"\./
apachelog = Colorize.bpaint apachelog, reg do |m|
Colors.red(m[0]) + " -- \"" + Colors.blue(m[1]) + "\" - \"" + Colors.white(m[2]) + "\".\n"
end
puts apachelog







