Sha256: 81472986949ffd1bbbd4f9645ac1635566f90bbec14db429b58ec0df8cd07df1

Contents?: true

Size: 418 Bytes

Versions: 3

Compression:

Stored size: 418 Bytes

Contents

class Arson
	class << self
		def colorful(color, string)
			return string unless $stdout.tty?
			colored = ""
			if color.is_a? String
				Colors[color].each do |effect|
					colored << "#{::ANSICode.send(effect)}"
				end
			elsif color.is_a? Symbol
				colored << "#{::ANSICode.send(color)}"
			else
				return colorful(color.to_s, string)
			end
			colored << (string || "") << "#{::ANSICode.clear}"
		end
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
evaryont-arson-2.0.0 lib/arson/colorful.rb
evaryont-arson-2.0.1 lib/arson/colorful.rb
evaryont-arson-2.0.2 lib/arson/colorful.rb