I have a script that runs..somewhere in the middle I excute a function
which creates a file with global variables. It creates it fine.
I then require this file. No problems there, but when I try to use
any of the global variables that are defined in this new file I get an
error saying it is nil... Here's what I'm doing basically
def someFunction()
cls = someNewClass.new()
cls.createMyFile() # writes global variables to it
tempdir = Dir.pwd.match('.*Watir/CBT/').to_s # find the
directory I just wrote to
file = tempdir + "newlyCreatedFile.rb"
require file
puts $newlyDefinedGlobalVariable.to_s
end
error: C:/Watir/CBT/Tests/../../CBT/CBTCallLogObject.rb:91:in `+':
cannot convert nil into String
Also I note that it's changing my current directory by going up two
folders then going back down two..although I don't tell it to since
I'm using tempdir as in the code above...
any ideas?
Shao
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general