Skip to content

Instantly share code, notes, and snippets.

@clockworkpc
Created May 2, 2017 06:07
Show Gist options
  • Save clockworkpc/61cd6e946cda9878300c24073545f065 to your computer and use it in GitHub Desktop.
Save clockworkpc/61cd6e946cda9878300c24073545f065 to your computer and use it in GitHub Desktop.
Cross Platform clean_screen method in pure Ruby
def clear_screen()
puts "Going to clear the screen"
if RUBY_PLATFORM =~ /win32|win64|\.NET|windows|cygwin|mingw32/i
system('cls')
else
system('clear')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment