From: Robert Klemme Date: 2006-11-30T02:35:05+09:00 Subject: Re: Need a range, but not getting it. . . . On 29.11.2006 18:29, Robert Klemme wrote: > On 29.11.2006 18:02, Peter Bailey wrote: >> Hello, >> I'm going nuts with the simplest stuff here. I just want to take in >> array data and make it into a range. >> >> Here's my test script, called test1.rb: >> files = [ARGV] >> files.to_s.gsub!(/\-/, "..") >> puts files > > If you have multiple args, you can do > > ARGV[0]..ARGV[1] > > Otherwise you can do > a, b = ARGV[0].split('-', 2) > seq = a..b Even more onelinerish Range.new(*ARGV[0].split('-', 2)) :-) robert