On Dec 31, 7:12=A0pm, Luis Lavena <luislav... / gmail.com> wrote:
> On Dec 31, 9:01=A0pm, "Roger B. Atkins" <roger-b-atk... / cox.net> wrote:
>
> > Thanks Darryl.
>
> > The error message:
> > =A0>ruby Test2.rb
> > =A0>The system cannot find the file specified.
>
> are you invoking ruby in the directory where "Test2.rb" exist?
>
> Also, is the file named "Test2.rb" and not "test2.rb", things are case
> sensitive sometimes.
>
> --
> Luis Lavena

Hello again Roger,

Sorry if I threw too much at you....
(__FILE__) is a ruby keyword that holds the dir & file of the
program that it's used in.

Copy the below snippet into a file and run it for a better feel.



$:.unshift File.dirname(__FILE__) unless
$:.include? File.dirname(__FILE__)

puts "reveal Filename and Dirname attributes \n\n"
a =3D File.dirname(__FILE__)
b =3D File.basename(__FILE__)
c =3D (__FILE__)
d =3D File.dirname $0
e =3D $0
f =3D $PROGRAM_NAME

puts " a - the current directory =3D> #{a}"
puts " b - the current filename =3D> #{b}"
puts " c - the current directory and filename =3D> #{c}"
puts " d - same output as 'a' only using $0 =3D> #{d}"
puts " e - same as 'c' only using  $0 =3D> #{e}"
puts " f - same as 'c' only using $PROGRAM_NAME =3D> #{f}"



Regards,
Darryl