Ruby colorize a section of text -


I am writing command line scripts in Ruby and I am trying to paint a color of lines. Currently, I am using the 'colorize' gem, but by documentation it only colors a line of text at a time

  puts "test". Colorize (: green) puts "test". Colors "(" green ") puts" test. "Colesize (green)   

But it seems something unnecessary to me and I would like to paint all the lines of text, but only Call once more and not color 3 times ('green').

How can this be done in Ruby?

or (" green ")

  puts [" test "," test "," test "].  < Pre>  puts ["test", "test", "test"]. Map {| s | S.colorize (: green)}    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -