# File lib/ansi/code.rb, line 177 def ansi(*codes) #:yield: if block_given? string = yield.to_s else # first argument must be the string string = codes.shift.to_s end return string unless $ansi c = code(*codes) c + string.gsub(ENDCODE, ENDCODE + c) + ENDCODE end