Have you ever noticed that if you run rake -T in rails the list of rake descriptions are truncated by the width of the terminal window. So there should be a way to get it in Rub
Ruby actually comes with a built-in class called "Curses", which lets you do all kinds of things with the terminal window.
For example, you can do this:
require 'curses'
Curses.init_screen()
puts Curses.lines # Gives you the height of terminal window
puts Curses.cols # Gives you the width of terminal window
For more info: http://ruby-doc.org/stdlib-1.9.3/libdoc/curses/rdoc/Curses/Window.html