On Apr 15, 2006, at 10:19 AM, Sy Ali wrote:

> Ok, I played with it some more and it appears it won't do what I want.
>  I'll have to hunt some more, or code my own solution.
>
> require 'rubygems'
> require 'highline'
>
> h = HighLine.new
> a = []
> a << "a a a a"
> a << "b b b b b"
> a << "--Some more text-- --Some more text-- --Some more text-- --Some
> more text-- --Some more text--"

I don't really understand the goal, but perhaps this will give you  
ideas...

 >> first_line = a[0..-2].map { |str| str.tr(" ", "_") + "__" }.join
=> "a_a_a_a__b_b_b_b_b__"
 >> result = a.last.split(/\s+(?=-)/).map { |str| "_" *  
first_line.length + str }
=> ["____________________--Some more text--", "____________________-- 
Some more text--", "____________________--Some more text--",  
"____________________--Some more text--", "____________________--Some  
more text--"]
 >> result.first.sub!(/_+/, first_line)
=> "a_a_a_a__b_b_b_b_b__--Some more text--"
 >> puts result
a_a_a_a__b_b_b_b_b__--Some more text--
____________________--Some more text--
____________________--Some more text--
____________________--Some more text--
____________________--Some more text--
=> nil

James Edward Gray II