Answer the question
In order to leave comments, you need to log in
How to customize gets.chomp input string in ruby?
There is a task on the course on Ruby. When the user enters a line through, show him the symbol ">" at the beginning of the input line. And you need to implement it through the method. Is it possible to make this symbol "blink" or "flicker" I don't know how to put it correctly. :) This is already a gag.
Answer the question
In order to leave comments, you need to log in
Use print
, this as puts
soon as without a line break.
puts 'wtf?'
print '>'
gets.chomp
print "\033[33;5m>\033[0m"
, but it does not work everywhere. Maybe something from https://github.com/fazibear/colorize will do, although it's not worth dragging an extra library for this.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question