module Hoe::RakeHelpers

def colorize( *args )

## line-endings, color reset, etc.
## Colorize the given +string+ with the specified +attributes+ and return it, handling
def colorize( *args )
	string = ''
	if block_given?
		string = yield
	else
		string = args.shift
	end
	ending = string[/(\s)$/] || ''
	string = string.rstrip
	return ansi_code( args.flatten ) + string + ansi_code( 'reset' ) + ending
end