riclib 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +57 -0
- data/README +8 -0
- data/Rakefile +15 -0
- data/TODO +2 -0
- data/bin/ric +5 -0
- data/docs/journal.txt +5 -0
- data/images/desktop/LodossWar.jpg +0 -0
- data/images/desktop/linux-lightbulb.png +0 -0
- data/images/icons/chicche/joystick boobs.jpg +0 -0
- data/images/icons/database/db-commit.png +0 -0
- data/images/icons/development/grave.png +0 -0
- data/images/icons/development/iFuck.png +0 -0
- data/images/icons/development/ontology.png +0 -0
- data/images/icons/development/pointers.png +0 -0
- data/images/icons/development/svn.png +0 -0
- data/images/icons/development/tools.png +0 -0
- data/images/icons/disks/Ric 120GB.ico +0 -0
- data/images/icons/linux/got root.jpg +0 -0
- data/images/icons/linux/ldap.png +0 -0
- data/images/icons/privacy.png +0 -0
- data/images/icons/social/facebook painted.jpg +0 -0
- data/images/icons/social/facebook_64.png +0 -0
- data/images/icons/social/linkedin_64.png +0 -0
- data/images/icons/social/rss_64.png +0 -0
- data/images/icons/social/twitter_64.png +0 -0
- data/images/icons/tux/tux scientific.png +0 -0
- data/images/photos/Ireland/Dublin TCD tower.jpg +0 -0
- data/images/photos/Ireland/Giants causeways.jpg +0 -0
- data/images/photos/Ireland/I love Dublin.jpg +0 -0
- data/images/photos/Piano Yellow Rose.jpg +0 -0
- data/images/photos/Riccardo/Riccardo 1.jpg +0 -0
- data/images/photos/Riccardo/Riccardo Bridge Dublin.jpg +0 -0
- data/images/photos/Riccardo/Riccardo Cambridge.jpg +0 -0
- data/images/photos/Riccardo/Riccardo Celtic Cross.jpg +0 -0
- data/images/photos/Riccardo/Riccardo Developer in Dublin.jpg +0 -0
- data/images/photos/Riccardo/Riccardo Fabio GuinnessDay.jpg +0 -0
- data/images/photos/Riccardo/Riccardo GuinessDay.jpg +0 -0
- data/images/photos/Riccardo/Riccardo Highlander.jpg +0 -0
- data/images/photos/Riccardo/Riccardo Irish Breakfast.jpg +0 -0
- data/images/photos/Riccardo/Riccardo OK pizza.jpg +0 -0
- data/images/photos/Riccardo/Riccardo OnBedWithPenguin.jpg +0 -0
- data/images/photos/Riccardo/Riccardo U2 CrokePark.jpg +0 -0
- data/images/photos/Riccardo/Riccardo closeup by Karaoke.jpg +0 -0
- data/images/photos/Riccardo/Riccardo elegant at LABS.jpg +0 -0
- data/images/photos/Riccardo/Riccardo elegant smiling.jpg +0 -0
- data/images/photos/Riccardo/Riccardo enjoying new iMac.jpg +0 -0
- data/images/photos/Riccardo/Riccardo makes pizza.jpg +0 -0
- data/images/photos/Riccardo/Riccardo purple1.jpg +0 -0
- data/images/photos/Riccardo/Riccardo purple2.jpg +0 -0
- data/images/photos/Riccardo/Riccardo sunglasses IFSC.jpg +0 -0
- data/images/photos/Riccardo/Riccardo with Delgado.jpg +0 -0
- data/images/photos/Riccardo/Riccardo yellow with Mac.jpg +0 -0
- data/images/photos/ricarrabbiato.jpg +0 -0
- data/lib/ric_colors.rb +302 -0
- data/lib/ric_html.rb +5 -0
- data/lib/riclib.rb +24 -0
- data/riclib.gemspec +31 -0
- data/var/www/index.html +5 -0
- metadata +135 -0
data/Manifest
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
Manifest
|
2
|
+
README
|
3
|
+
Rakefile
|
4
|
+
TODO
|
5
|
+
bin/ric
|
6
|
+
docs/journal.txt
|
7
|
+
images/desktop/LodossWar.jpg
|
8
|
+
images/desktop/linux-lightbulb.png
|
9
|
+
images/icons/chicche/joystick boobs.jpg
|
10
|
+
images/icons/database/db-commit.png
|
11
|
+
images/icons/development/grave.png
|
12
|
+
images/icons/development/iFuck.png
|
13
|
+
images/icons/development/ontology.png
|
14
|
+
images/icons/development/pointers.png
|
15
|
+
images/icons/development/svn.png
|
16
|
+
images/icons/development/tools.png
|
17
|
+
images/icons/disks/Ric 120GB.ico
|
18
|
+
images/icons/linux/got root.jpg
|
19
|
+
images/icons/linux/ldap.png
|
20
|
+
images/icons/privacy.png
|
21
|
+
images/icons/social/facebook painted.jpg
|
22
|
+
images/icons/social/facebook_64.png
|
23
|
+
images/icons/social/linkedin_64.png
|
24
|
+
images/icons/social/rss_64.png
|
25
|
+
images/icons/social/twitter_64.png
|
26
|
+
images/icons/tux/tux scientific.png
|
27
|
+
images/photos/Ireland/Dublin TCD tower.jpg
|
28
|
+
images/photos/Ireland/Giants causeways.jpg
|
29
|
+
images/photos/Ireland/I love Dublin.jpg
|
30
|
+
images/photos/Piano Yellow Rose.jpg
|
31
|
+
images/photos/Riccardo/Riccardo 1.jpg
|
32
|
+
images/photos/Riccardo/Riccardo Bridge Dublin.jpg
|
33
|
+
images/photos/Riccardo/Riccardo Cambridge.jpg
|
34
|
+
images/photos/Riccardo/Riccardo Celtic Cross.jpg
|
35
|
+
images/photos/Riccardo/Riccardo Developer in Dublin.jpg
|
36
|
+
images/photos/Riccardo/Riccardo Fabio GuinnessDay.jpg
|
37
|
+
images/photos/Riccardo/Riccardo GuinessDay.jpg
|
38
|
+
images/photos/Riccardo/Riccardo Highlander.jpg
|
39
|
+
images/photos/Riccardo/Riccardo Irish Breakfast.jpg
|
40
|
+
images/photos/Riccardo/Riccardo OK pizza.jpg
|
41
|
+
images/photos/Riccardo/Riccardo OnBedWithPenguin.jpg
|
42
|
+
images/photos/Riccardo/Riccardo U2 CrokePark.jpg
|
43
|
+
images/photos/Riccardo/Riccardo closeup by Karaoke.jpg
|
44
|
+
images/photos/Riccardo/Riccardo elegant at LABS.jpg
|
45
|
+
images/photos/Riccardo/Riccardo elegant smiling.jpg
|
46
|
+
images/photos/Riccardo/Riccardo enjoying new iMac.jpg
|
47
|
+
images/photos/Riccardo/Riccardo makes pizza.jpg
|
48
|
+
images/photos/Riccardo/Riccardo purple1.jpg
|
49
|
+
images/photos/Riccardo/Riccardo purple2.jpg
|
50
|
+
images/photos/Riccardo/Riccardo sunglasses IFSC.jpg
|
51
|
+
images/photos/Riccardo/Riccardo with Delgado.jpg
|
52
|
+
images/photos/Riccardo/Riccardo yellow with Mac.jpg
|
53
|
+
images/photos/ricarrabbiato.jpg
|
54
|
+
lib/ric_colors.rb
|
55
|
+
lib/ric_html.rb
|
56
|
+
lib/riclib.rb
|
57
|
+
var/www/index.html
|
data/README
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
require 'rubygems'
|
3
|
+
require 'rake'
|
4
|
+
require 'echoe'
|
5
|
+
|
6
|
+
# from here: http://buzaz.com/index.php/2010/01/03/how-to-build-a-ruby-gem/
|
7
|
+
|
8
|
+
Echoe.new('riclib', '0.0.5') do |p|
|
9
|
+
p.description = "My first Riccardo gem manifested via echoe"
|
10
|
+
p.url = "http://github.com/palladius/riclib"
|
11
|
+
p.author = "Riccardo Carlesso"
|
12
|
+
p.email = "['p','ll','diusbonton].join('a') @ gmail.com"
|
13
|
+
p.ignore_pattern = ["tmp/*", "script/*", "images/*", "*.jpg" , "private/*"]
|
14
|
+
p.development_dependencies = []
|
15
|
+
end
|
data/bin/ric
ADDED
data/docs/journal.txt
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/ric_colors.rb
ADDED
@@ -0,0 +1,302 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# $Id: ric_colors.rb 5438 2010-12-16 15:06:29Z rcarlesso $
|
4
|
+
|
5
|
+
module RicColors
|
6
|
+
|
7
|
+
$colors_active = true # DEFAULT: active
|
8
|
+
$color_db = [
|
9
|
+
%w{ normal black dkblack red green brown blue purple cyan lgray gray lred lgreen yellow lblue violet azure white orange orangey magenta lyellow pink gold } , # english word
|
10
|
+
%w{ normale nero nerone rosso verde marrone blu porpora ciano grigino grigione rossino verdino giallo lblu viola azzurro bianco arancio arancino magenta giallino rosa oro } , # italian word
|
11
|
+
%w{ 0;37 0;30 38;5;236 0;31 1;32 38;5;94 0;34 1;35 0;36 0;37 1;30 1;31 1;32 1;33 1;34 1;35 1;36 1;37 38;5;208 38;5;222 0;35 38;5;229 38;5;203 38;5;214 } ,
|
12
|
+
%w{ 000 000 222 f00 0f0 00f ff0 0ff aaa 888 f00 afa ff0 eebb00 } # HEX RGB
|
13
|
+
]
|
14
|
+
# rifallo, e' piu' manutenibile...
|
15
|
+
$color_db2 = [
|
16
|
+
# [ ARR_COLORS , ]
|
17
|
+
%w{ black nero 0;30 000 },
|
18
|
+
%w{ dkblack nerone 38;5;236 222 },
|
19
|
+
]
|
20
|
+
|
21
|
+
# alias viola = fuxia
|
22
|
+
|
23
|
+
def colors_on
|
24
|
+
set_color :on #(true)
|
25
|
+
end
|
26
|
+
def colors_off
|
27
|
+
set_color :off #(false)
|
28
|
+
end
|
29
|
+
|
30
|
+
# TODO support a block (solo dentro l blocco fai il nocolor)
|
31
|
+
def set_color(bool)
|
32
|
+
b = bool ? true : false
|
33
|
+
deb "Setting color mode to: #{yellow bool} --> #{white b.to_s}"
|
34
|
+
b = false if bool.to_s.match( /(off|false)/ )
|
35
|
+
deb "Setting color mode to: #{yellow bool} --> #{white b.to_s}"
|
36
|
+
$colors_active = bool
|
37
|
+
end
|
38
|
+
alias :set_colors :set_color
|
39
|
+
|
40
|
+
def bash_color(n, str )
|
41
|
+
"\033[#{n}m#{str}\033[0m"
|
42
|
+
end
|
43
|
+
|
44
|
+
def pcolor(color_name='red',str='COLOR: please define a string')
|
45
|
+
if $colors_active
|
46
|
+
puts colora(color_name,str)
|
47
|
+
else
|
48
|
+
puts str
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def visible_color(s)
|
53
|
+
!( s.match(/nero|black/) )
|
54
|
+
end
|
55
|
+
|
56
|
+
def colora(color_name='greenpurpureo',str='colora_test_str2', opts={})
|
57
|
+
color_name = color_name.to_s
|
58
|
+
return str unless $colors_active
|
59
|
+
return str if opts[:nocolor]
|
60
|
+
if ix = $color_db[0].index(color_name)
|
61
|
+
bash_color($color_db[2][ix],str)
|
62
|
+
elsif ix = $color_db[1].index(color_name)
|
63
|
+
bash_color($color_db[2][ix],str)
|
64
|
+
else
|
65
|
+
debug "Sorry, unknown color '#{color_name}'. Available ones are: #{$color_db[0].join(',') }"
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
alias :p :puts
|
70
|
+
|
71
|
+
def color_test(with_italian = false)
|
72
|
+
i=0
|
73
|
+
palette = $color_db[0].map { |c|
|
74
|
+
inglese = c
|
75
|
+
italiano = $color_db[1][i]
|
76
|
+
i = i+1
|
77
|
+
colora( c, with_italian ? [c,italiano].join(','): c )
|
78
|
+
}
|
79
|
+
puts( (1..257).map{|c| bash_color( "38;5;#{c}", c) }.join(', ') )
|
80
|
+
puts( palette.sort.join(' '))
|
81
|
+
_flag_nations.each{|nation|
|
82
|
+
puts "- Flag sample: " + flag("ThisIsAFlaggedPhraseBasedOnNation:#{nation}",nation)
|
83
|
+
}
|
84
|
+
end
|
85
|
+
alias :colortest :color_test
|
86
|
+
|
87
|
+
# carattere per carattere...
|
88
|
+
def rainbow(str)
|
89
|
+
i=0
|
90
|
+
ret = ''
|
91
|
+
str=str.to_s
|
92
|
+
while(i < str.length)
|
93
|
+
ch = str[i]
|
94
|
+
palette = $color_db[0][i % $color_db[0].length ]
|
95
|
+
ret << (colora(palette,str[i,1]))
|
96
|
+
i += 1
|
97
|
+
end
|
98
|
+
ret
|
99
|
+
end
|
100
|
+
alias :arcobaleno :rainbow
|
101
|
+
|
102
|
+
#assert(color_db[0].length == color_db[1].length,"English and italian colors must be the same cardinality!!!")
|
103
|
+
# TODO ripeti con , $color_db[1]
|
104
|
+
( $color_db[0] + $color_db[1] ).each { |colorname|
|
105
|
+
dyn_func = "
|
106
|
+
|
107
|
+
def get_#{colorname} (str='colors.rb: get_COLOR dynamically generated ENGLISH COLOR ')
|
108
|
+
return colora('#{colorname}',str)
|
109
|
+
end
|
110
|
+
|
111
|
+
def #{colorname} (str='colors.rb: COLOR dynamically generated ENGLISH COLOR TO BE COPIED TO GET')
|
112
|
+
return colora('#{colorname}',str) rescue
|
113
|
+
\"Errore #{colorname} con stringa '#"+"{str}' e classe #"+"{str.class} \"
|
114
|
+
end
|
115
|
+
|
116
|
+
def p#{colorname} (str='colors.rb: pCOLOR dynamically generated ENGLISH COLOR TO BE DESTROYED')
|
117
|
+
puts colora('#{colorname}',str)
|
118
|
+
end
|
119
|
+
|
120
|
+
"
|
121
|
+
#debug dyn_func
|
122
|
+
eval dyn_func unless method_defined?( "get_#{colorname}".to_sym )
|
123
|
+
#remove_method
|
124
|
+
}
|
125
|
+
|
126
|
+
def okno(bool,str=nil)
|
127
|
+
str ||= bool
|
128
|
+
bool = (bool == 0 ) if (bool.class == Fixnum) # so 0 is green, others are red :)
|
129
|
+
return bool ? green(str) : red(str)
|
130
|
+
end
|
131
|
+
|
132
|
+
def colors_flag(nation = 'it')
|
133
|
+
%w{ red white green }
|
134
|
+
end
|
135
|
+
|
136
|
+
# "\e[0;31m42\e[0m" --> "42"
|
137
|
+
# \e[38;5;28mXXXX -> "XXX"
|
138
|
+
def scolora(str)
|
139
|
+
str.to_s.
|
140
|
+
gsub(/\e\[1;33m/,''). # colori 16
|
141
|
+
gsub(/\e\[0m/,''). # colori 64k
|
142
|
+
gsub(/\e\[38;\d+;\d+m/,'') # end color
|
143
|
+
end
|
144
|
+
alias :uncolor :scolora
|
145
|
+
|
146
|
+
# italia: green white red
|
147
|
+
# ireland: green white orange
|
148
|
+
# france: green white orange
|
149
|
+
# UK: blue white red white blue
|
150
|
+
# google:
|
151
|
+
def _flag_nations
|
152
|
+
%w{cc it de ie fr es en goo br pt}
|
153
|
+
end
|
154
|
+
def flag(str, flag = '')
|
155
|
+
case flag.to_s
|
156
|
+
when 'br','pt'
|
157
|
+
return flag3(str, 'green', 'gold', 'green')
|
158
|
+
when 'cc'
|
159
|
+
return flag3(str, 'red', 'white', 'red') # switzerland
|
160
|
+
when 'de'
|
161
|
+
return flag3(str, 'dkblack', 'red', 'gold')
|
162
|
+
when 'ie','gd','ga'
|
163
|
+
return flag3(str, 'green', 'white', 'orange')# non so la differenza, sembrano entrambi gaelici!
|
164
|
+
when 'en'
|
165
|
+
return flag3(str, 'red', 'blue', 'red') # red white blue white red white blue white ... and again
|
166
|
+
when 'es'
|
167
|
+
return flag3(str, 'yellow', 'red', 'yellow')
|
168
|
+
when 'fr'
|
169
|
+
return flag3(str, 'blue', 'white', 'red')
|
170
|
+
when 'goo','google'
|
171
|
+
return flag_n(str, %w{ blue red yellow blue green red } )
|
172
|
+
when 'it'
|
173
|
+
return flag3(str, 'green', 'white', 'red')
|
174
|
+
when ''
|
175
|
+
return flag3(str + " (missing flag1, try 'it')")
|
176
|
+
end
|
177
|
+
return flag3(str + " (missing flag2, try 'it')")
|
178
|
+
end
|
179
|
+
|
180
|
+
# for simmetry padding
|
181
|
+
# m = length / 3
|
182
|
+
# 6: 2 2 2 m m m REST 0
|
183
|
+
# 5: 2 1 2 m+1 m m+1 2
|
184
|
+
# 4: 1 2 1 m m+1 m 1
|
185
|
+
def flag3(str,left_color='brown',middle_color='pink',right_color='red')
|
186
|
+
m = str.length / 3
|
187
|
+
remainder = str.length % 3
|
188
|
+
central_length = remainder == 1 ? m+1 : m
|
189
|
+
lateral_length = remainder == 2 ? m+1 : m
|
190
|
+
colora( left_color, str[ 0 .. lateral_length-1] ) +
|
191
|
+
colora( middle_color, str[ lateral_length .. lateral_length+central_length-1] ) +
|
192
|
+
colora( right_color, str[ lateral_length+central_length .. str.length ] )
|
193
|
+
end
|
194
|
+
|
195
|
+
def flag_n(str,colors)
|
196
|
+
size = colors.size
|
197
|
+
#debug_on :flag6
|
198
|
+
ret = ""
|
199
|
+
m = str.length / size # chunk size
|
200
|
+
deb m
|
201
|
+
(0 .. size-1).each{|i|
|
202
|
+
#deb "Passo #{i}"
|
203
|
+
chunk = str[m*(i),m*(i+1)]
|
204
|
+
#deb chunk
|
205
|
+
ret += colora(colors[i], chunk )
|
206
|
+
}
|
207
|
+
#deb str.split(/....../)
|
208
|
+
#remainder = str.length % 6
|
209
|
+
return ret + " (bacatino)"
|
210
|
+
# central_length = remainder == 1 ? m+1 : m
|
211
|
+
# lateral_length = remainder == 2 ? m+1 : m
|
212
|
+
# colora( left_color, str[ 0 .. lateral_length-1] ) +
|
213
|
+
# colora( middle_color, str[ lateral_length .. lateral_length+central_length-1] ) +
|
214
|
+
# colora( right_color, str[ lateral_length+central_length .. str.length ] )
|
215
|
+
# return ret
|
216
|
+
end
|
217
|
+
|
218
|
+
|
219
|
+
###################################################################################################################
|
220
|
+
# COLORS LIBRARY
|
221
|
+
=begin
|
222
|
+
nero) shift; echo -en "\033[0;30m$*\033[0m\n" ;;
|
223
|
+
rossone) shift; echo -en "\033[0;31m$*\033[0m\n" ;;
|
224
|
+
verdone) shift; echo -en "\033[0;32m$*\033[0m\n" ;;
|
225
|
+
marrone) shift; echo -en "\033[0;33m$*\033[0m\n" ;;
|
226
|
+
bluino) shift; echo -en "\033[0;34m$*\033[0m\n" ;;
|
227
|
+
porpora) shift; echo -en "\033[0;35m$*\033[0m\n" ;;
|
228
|
+
ciano) shift; echo -en "\033[0;36m$*\033[0m\n" ;;
|
229
|
+
grigino) shift; echo -en "\033[0;37m$*\033[0m\n" ;;
|
230
|
+
|
231
|
+
grigione) shift; echo -en "\033[1;30m$*\033[0m\n" ;;
|
232
|
+
rosso) shift; echo -en "\033[1;31m$*\033[0m\n" ;;
|
233
|
+
verde) shift; echo -en "\033[1;32m$*\033[0m\n" ;;
|
234
|
+
giallo) shift; echo -en "\033[1;33m$*\033[0m\n" ;;
|
235
|
+
blu) shift; echo -en "\033[1;34m$*\033[0m\n" ;;
|
236
|
+
viola) shift; echo -en "\033[1;35m$*\033[0m\n" ;;
|
237
|
+
azzurro) shift; echo -en "\033[1;36m$*\033[0m\n" ;;
|
238
|
+
bianco) shift; echo -en "\033[1;37m$*\033[0m\n" ;;
|
239
|
+
|
240
|
+
arancio) shift; echo -en "\033[5;31m$*\033[0m\n" ;;
|
241
|
+
|
242
|
+
colour_codes = {
|
243
|
+
'black': '\033[0;30m',
|
244
|
+
'red': '\033[0;31m',
|
245
|
+
'green': '\033[0;32m',
|
246
|
+
'yellow': '\033[0;33m',
|
247
|
+
'blue': '\033[0;34m',
|
248
|
+
'magenta': '\033[0;35m',
|
249
|
+
'cyan': '\033[0;36m',
|
250
|
+
'white': '\033[0;37m',
|
251
|
+
'darkgray': '\033[1;30m',
|
252
|
+
'br-red': '\033[1;31m',
|
253
|
+
'br-green': '\033[1;32m',
|
254
|
+
'br-yellow': '\033[1;33m',
|
255
|
+
'br-blue': '\033[1;34m',
|
256
|
+
'br-magenta': '\033[1;35m',
|
257
|
+
'br-cyan': '\033[1;36m',
|
258
|
+
'br-white': '\033[1;37m',
|
259
|
+
'ul-black': '\033[4;30m',
|
260
|
+
'ul-red': '\033[4;31m',
|
261
|
+
'ul-green': '\033[4;32m',
|
262
|
+
'ul-yellow': '\033[4;33m',
|
263
|
+
'ul-blue': '\033[4;34m',
|
264
|
+
'ul-magenta': '\033[4;35m',
|
265
|
+
'ul-cyan': '\033[4;36m',
|
266
|
+
'ul-white': '\033[4;37m',
|
267
|
+
'default': '\033[0m'
|
268
|
+
}
|
269
|
+
=end
|
270
|
+
|
271
|
+
class RicColor < String
|
272
|
+
attr :color
|
273
|
+
|
274
|
+
def initialize(mycol)
|
275
|
+
super
|
276
|
+
@color = mycol
|
277
|
+
end
|
278
|
+
|
279
|
+
def to_s
|
280
|
+
'RicColor: ' + self.send(@color)
|
281
|
+
end
|
282
|
+
|
283
|
+
def to_html
|
284
|
+
"<font color=\"#{@color}\" >#{self}</font>"
|
285
|
+
end
|
286
|
+
end #/Class RicColor
|
287
|
+
|
288
|
+
def terminal
|
289
|
+
ENV['TERM_PROGRAM'] || 'suppongo_ssh'
|
290
|
+
end
|
291
|
+
|
292
|
+
def daltonic_terminal?()
|
293
|
+
deb( "Terminal is: " + terminal )
|
294
|
+
return !! terminal.to_s.match( /Apple_Terminal/ )
|
295
|
+
end
|
296
|
+
|
297
|
+
|
298
|
+
end # /module
|
299
|
+
|
300
|
+
include RicColors
|
301
|
+
|
302
|
+
$colors_active = ! RicColor.daltonic_terminal? # DEFAULT: active
|
data/lib/riclib.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
|
2
|
+
# RICLIB!
|
3
|
+
|
4
|
+
module Riclib
|
5
|
+
|
6
|
+
def self.say_hello
|
7
|
+
puts 'hello world'
|
8
|
+
end
|
9
|
+
|
10
|
+
def amaranto(str)
|
11
|
+
"Riclib::Amaranto: '#{str}'"
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.help
|
15
|
+
puts "This is RicLib Riccardo library (my firdst gem!)"
|
16
|
+
end
|
17
|
+
|
18
|
+
def version
|
19
|
+
"SHould be 0.0.5 (but this is NOT dry! ;) )"
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
|
data/riclib.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{riclib}
|
5
|
+
s.version = "0.0.5"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Riccardo Carlesso"]
|
9
|
+
s.date = %q{2011-01-16}
|
10
|
+
s.default_executable = %q{ric}
|
11
|
+
s.description = %q{My first Riccardo gem manifested via echoe}
|
12
|
+
s.email = %q{['p','ll','diusbonton].join('a') @ gmail.com}
|
13
|
+
s.executables = ["ric"]
|
14
|
+
s.extra_rdoc_files = ["README", "TODO", "bin/ric", "lib/ric_colors.rb", "lib/ric_html.rb", "lib/riclib.rb"]
|
15
|
+
s.files = ["Manifest", "README", "Rakefile", "TODO", "bin/ric", "docs/journal.txt", "images/desktop/LodossWar.jpg", "images/desktop/linux-lightbulb.png", "images/icons/chicche/joystick boobs.jpg", "images/icons/database/db-commit.png", "images/icons/development/grave.png", "images/icons/development/iFuck.png", "images/icons/development/ontology.png", "images/icons/development/pointers.png", "images/icons/development/svn.png", "images/icons/development/tools.png", "images/icons/disks/Ric 120GB.ico", "images/icons/linux/got root.jpg", "images/icons/linux/ldap.png", "images/icons/privacy.png", "images/icons/social/facebook painted.jpg", "images/icons/social/facebook_64.png", "images/icons/social/linkedin_64.png", "images/icons/social/rss_64.png", "images/icons/social/twitter_64.png", "images/icons/tux/tux scientific.png", "images/photos/Ireland/Dublin TCD tower.jpg", "images/photos/Ireland/Giants causeways.jpg", "images/photos/Ireland/I love Dublin.jpg", "images/photos/Piano Yellow Rose.jpg", "images/photos/Riccardo/Riccardo 1.jpg", "images/photos/Riccardo/Riccardo Bridge Dublin.jpg", "images/photos/Riccardo/Riccardo Cambridge.jpg", "images/photos/Riccardo/Riccardo Celtic Cross.jpg", "images/photos/Riccardo/Riccardo Developer in Dublin.jpg", "images/photos/Riccardo/Riccardo Fabio GuinnessDay.jpg", "images/photos/Riccardo/Riccardo GuinessDay.jpg", "images/photos/Riccardo/Riccardo Highlander.jpg", "images/photos/Riccardo/Riccardo Irish Breakfast.jpg", "images/photos/Riccardo/Riccardo OK pizza.jpg", "images/photos/Riccardo/Riccardo OnBedWithPenguin.jpg", "images/photos/Riccardo/Riccardo U2 CrokePark.jpg", "images/photos/Riccardo/Riccardo closeup by Karaoke.jpg", "images/photos/Riccardo/Riccardo elegant at LABS.jpg", "images/photos/Riccardo/Riccardo elegant smiling.jpg", "images/photos/Riccardo/Riccardo enjoying new iMac.jpg", "images/photos/Riccardo/Riccardo makes pizza.jpg", "images/photos/Riccardo/Riccardo purple1.jpg", "images/photos/Riccardo/Riccardo purple2.jpg", "images/photos/Riccardo/Riccardo sunglasses IFSC.jpg", "images/photos/Riccardo/Riccardo with Delgado.jpg", "images/photos/Riccardo/Riccardo yellow with Mac.jpg", "images/photos/ricarrabbiato.jpg", "lib/ric_colors.rb", "lib/ric_html.rb", "lib/riclib.rb", "var/www/index.html", "riclib.gemspec"]
|
16
|
+
s.homepage = %q{http://github.com/palladius/riclib}
|
17
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Riclib", "--main", "README"]
|
18
|
+
s.require_paths = ["lib"]
|
19
|
+
s.rubyforge_project = %q{riclib}
|
20
|
+
s.rubygems_version = %q{1.4.2}
|
21
|
+
s.summary = %q{My first Riccardo gem manifested via echoe}
|
22
|
+
|
23
|
+
if s.respond_to? :specification_version then
|
24
|
+
s.specification_version = 3
|
25
|
+
|
26
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
27
|
+
else
|
28
|
+
end
|
29
|
+
else
|
30
|
+
end
|
31
|
+
end
|
data/var/www/index.html
ADDED
metadata
ADDED
@@ -0,0 +1,135 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: riclib
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 21
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Riccardo Carlesso
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-01-16 00:00:00 +00:00
|
19
|
+
default_executable:
|
20
|
+
dependencies: []
|
21
|
+
|
22
|
+
description: My first Riccardo gem manifested via echoe
|
23
|
+
email: "['p','ll','diusbonton].join('a') @ gmail.com"
|
24
|
+
executables:
|
25
|
+
- ric
|
26
|
+
extensions: []
|
27
|
+
|
28
|
+
extra_rdoc_files:
|
29
|
+
- README
|
30
|
+
- TODO
|
31
|
+
- bin/ric
|
32
|
+
- lib/ric_colors.rb
|
33
|
+
- lib/ric_html.rb
|
34
|
+
- lib/riclib.rb
|
35
|
+
files:
|
36
|
+
- Manifest
|
37
|
+
- README
|
38
|
+
- Rakefile
|
39
|
+
- TODO
|
40
|
+
- bin/ric
|
41
|
+
- docs/journal.txt
|
42
|
+
- images/desktop/LodossWar.jpg
|
43
|
+
- images/desktop/linux-lightbulb.png
|
44
|
+
- images/icons/chicche/joystick boobs.jpg
|
45
|
+
- images/icons/database/db-commit.png
|
46
|
+
- images/icons/development/grave.png
|
47
|
+
- images/icons/development/iFuck.png
|
48
|
+
- images/icons/development/ontology.png
|
49
|
+
- images/icons/development/pointers.png
|
50
|
+
- images/icons/development/svn.png
|
51
|
+
- images/icons/development/tools.png
|
52
|
+
- images/icons/disks/Ric 120GB.ico
|
53
|
+
- images/icons/linux/got root.jpg
|
54
|
+
- images/icons/linux/ldap.png
|
55
|
+
- images/icons/privacy.png
|
56
|
+
- images/icons/social/facebook painted.jpg
|
57
|
+
- images/icons/social/facebook_64.png
|
58
|
+
- images/icons/social/linkedin_64.png
|
59
|
+
- images/icons/social/rss_64.png
|
60
|
+
- images/icons/social/twitter_64.png
|
61
|
+
- images/icons/tux/tux scientific.png
|
62
|
+
- images/photos/Ireland/Dublin TCD tower.jpg
|
63
|
+
- images/photos/Ireland/Giants causeways.jpg
|
64
|
+
- images/photos/Ireland/I love Dublin.jpg
|
65
|
+
- images/photos/Piano Yellow Rose.jpg
|
66
|
+
- images/photos/Riccardo/Riccardo 1.jpg
|
67
|
+
- images/photos/Riccardo/Riccardo Bridge Dublin.jpg
|
68
|
+
- images/photos/Riccardo/Riccardo Cambridge.jpg
|
69
|
+
- images/photos/Riccardo/Riccardo Celtic Cross.jpg
|
70
|
+
- images/photos/Riccardo/Riccardo Developer in Dublin.jpg
|
71
|
+
- images/photos/Riccardo/Riccardo Fabio GuinnessDay.jpg
|
72
|
+
- images/photos/Riccardo/Riccardo GuinessDay.jpg
|
73
|
+
- images/photos/Riccardo/Riccardo Highlander.jpg
|
74
|
+
- images/photos/Riccardo/Riccardo Irish Breakfast.jpg
|
75
|
+
- images/photos/Riccardo/Riccardo OK pizza.jpg
|
76
|
+
- images/photos/Riccardo/Riccardo OnBedWithPenguin.jpg
|
77
|
+
- images/photos/Riccardo/Riccardo U2 CrokePark.jpg
|
78
|
+
- images/photos/Riccardo/Riccardo closeup by Karaoke.jpg
|
79
|
+
- images/photos/Riccardo/Riccardo elegant at LABS.jpg
|
80
|
+
- images/photos/Riccardo/Riccardo elegant smiling.jpg
|
81
|
+
- images/photos/Riccardo/Riccardo enjoying new iMac.jpg
|
82
|
+
- images/photos/Riccardo/Riccardo makes pizza.jpg
|
83
|
+
- images/photos/Riccardo/Riccardo purple1.jpg
|
84
|
+
- images/photos/Riccardo/Riccardo purple2.jpg
|
85
|
+
- images/photos/Riccardo/Riccardo sunglasses IFSC.jpg
|
86
|
+
- images/photos/Riccardo/Riccardo with Delgado.jpg
|
87
|
+
- images/photos/Riccardo/Riccardo yellow with Mac.jpg
|
88
|
+
- images/photos/ricarrabbiato.jpg
|
89
|
+
- lib/ric_colors.rb
|
90
|
+
- lib/ric_html.rb
|
91
|
+
- lib/riclib.rb
|
92
|
+
- var/www/index.html
|
93
|
+
- riclib.gemspec
|
94
|
+
has_rdoc: true
|
95
|
+
homepage: http://github.com/palladius/riclib
|
96
|
+
licenses: []
|
97
|
+
|
98
|
+
post_install_message:
|
99
|
+
rdoc_options:
|
100
|
+
- --line-numbers
|
101
|
+
- --inline-source
|
102
|
+
- --title
|
103
|
+
- Riclib
|
104
|
+
- --main
|
105
|
+
- README
|
106
|
+
require_paths:
|
107
|
+
- lib
|
108
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
hash: 3
|
114
|
+
segments:
|
115
|
+
- 0
|
116
|
+
version: "0"
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
hash: 11
|
123
|
+
segments:
|
124
|
+
- 1
|
125
|
+
- 2
|
126
|
+
version: "1.2"
|
127
|
+
requirements: []
|
128
|
+
|
129
|
+
rubyforge_project: riclib
|
130
|
+
rubygems_version: 1.4.2
|
131
|
+
signing_key:
|
132
|
+
specification_version: 3
|
133
|
+
summary: My first Riccardo gem manifested via echoe
|
134
|
+
test_files: []
|
135
|
+
|