lib/mothership/pretty.rb in mothership-0.0.9 vs lib/mothership/pretty.rb in mothership-0.0.10
- old
+ new
@@ -69,14 +69,17 @@
color = $1.to_sym
end
return str unless color
- "\e[#{bright ? 9 : 3}#{COLOR_CODES[color]}m#{str}\e[0m"
+ code = "\e[#{bright ? 9 : 3}#{COLOR_CODES[color]}m"
+ "#{code}#{str.gsub("\e[0m", "\e[0m#{code}")}\e[0m"
end
# bold text
def b(str)
return str unless color?
- "\e[1m#{str}\e[0m"
+
+ code = "\e[1m"
+ "#{code}#{str.gsub("\e[0m", "\e[0m#{code}")}\e[0m"
end
end