Possible Duplicate:
How can I clear the terminal in Ruby?
How to clear the terminal screen in ruby?
puts "hello, what's your name?"
input = gets.chomp
<<clearscreen>>
puts "nice to meet you, #{input}"
Clearing the Console You can also use Ctrl + L to clear the screen, which works on both Mac and Linux. If you're on Windows, the only way we're aware of to clear the console is by typing system('cls') . The Windows cls command clears the screen, and the Ruby system method runs that command in a subshell.
Not sure what you're asking exactly, but there are different ways to clear irb / terminal in this post: How Do You Clear The IRB Console?
One that is intersting is
In order to clear the screen just do a
puts "\e[H\e[2J"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With