H
Haris Bogdanovic
Hi !
Here is a little example:
file "Functions.rb":
#---------------------
def func(file)
if !file.eof then #do something.
end
#---------------
file "main.rb":
require 'Functions'
file_1=open('bla.txt','w')
func(file_1)
file_1.close
I get an error message that eof method is undefined.
I presume that this is because ruby does not know that the "file" variable
is going to become a File.object.
How do I solve this ?
Thanks.
Here is a little example:
file "Functions.rb":
#---------------------
def func(file)
if !file.eof then #do something.
end
#---------------
file "main.rb":
require 'Functions'
file_1=open('bla.txt','w')
func(file_1)
file_1.close
I get an error message that eof method is undefined.
I presume that this is because ruby does not know that the "file" variable
is going to become a File.object.
How do I solve this ?
Thanks.