I would like to know to how to do in Ruby what I can do with system(\"clear\") in C. I wrote a program like
system(\"clear\")
puts \"amit\" system(\"clear\")
This should cover windows and OSX/Linux terminals.
def method_name puts "amit" if RUBY_PLATFORM =~ /win32|win64|\.NET|windows|cygwin|mingw32/i system('cls') else system('clear') end end method_name