2010/5/11 Jes=FAs Gabriel y Gal=E1n <jgabrielygalan / gmail.com>:
> On Tue, May 11, 2010 at 4:27 PM, Jacob Davis <ismyhc / gmail.com> wrote:
>> Jes=FAs Gabriel y Gal=E1n wrote:
>>> On Tue, May 11, 2010 at 5:10 AM, Jacob Davis <ismyhc / gmail.com> wrote:

>> So, I should remove the .to_s so that it will populate the multiple
>> names into an array correct?
>
> Yes, if you do
>
> file_names =3D ARGV.dup
>
> you get an array of file names. Then you can iterate through that
> array doing the operation to each of them:

You do not even need to #dup because ARGV *is* an Array already.

$ ruby19 -e 'p ARGV.class'
Array

> # Have user input build number to be removed
> puts "Please enter the build number you wish to be removed from the
> file"
> build_number =3D STDIN.gets.chomp.to_s
>
> # Have user input version number to be appended to file name
> puts "Please enter the version number you wish to be appended"
> version_number =3D STDIN.gets.chomp.to_s

#to_s is not needed but checking the input is probably also a good
idea.  You could simply do

version_number =3D STDIN.gets.chomp
Integer(version_number) # will throw if not numeric

Kind regards

robert

--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/