Top Level Namespace
Defined Under Namespace
Classes: ColorConfig, TodoRb
Constant Summary
collapse
- COLORS =
ColorConfig.new
- COLORIZER =
File.join(File.dirname(__FILE__), 'colorizer.rb')
- HTML =
File.join(File.dirname(__FILE__), 'html.rb')
Instance Method Summary
collapse
Instance Method Details
#color_span(s, color) ⇒ Object
5
6
7
|
# File 'lib/html.rb', line 5
def color_span s, color
"<span style='color:#{color}'>#{s}</span>"
end
|
#mark_priority(s) ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/html.rb', line 27
def mark_priority s
return s if $no_color
return s unless s =~ /!/
s.chomp!
span = Regexp.new "<span.*span>"
s.split(span).map {|a|
[a, color_span(a, COLORS.html('priority'))]
}.each {|(old, new)|
s.sub!(old, new)
}
s
end
|