max-length

One liner to limit Array of Words to less than N number of characters in Ruby?

What's the simplest way to limit an array of words such that the resulting array, when the words are joined, is less than 40 characters? Something that acts like this: words = ["ruby", "rails", "jquery", "javascript", "html"] words.join.length #=> 29 words.join(", ").length #=> 37 words = ["ruby", "rails", "jquery", "javascript", "html...