D
David Weldon
I think ruby does something strange when it decides if certain constants
have been initialized or not. Take this simple case:
#test.rb
require 'const'
require '/home/dave/foo/const'
#const.rb
DAVE=1
When I run this I get:
/home/dave/foo/const.rb:1: warning: already initialized constant DAVE
...and yes, const.rb is the same one used for both test1.rb and
test2.rb. It seems like ruby hashes the paths to the source files and
complains when they are different - even if both paths reference the
same file in the filesystem. Is there a good way to avoid this? Thanks!
have been initialized or not. Take this simple case:
#test.rb
require 'const'
require '/home/dave/foo/const'
#const.rb
DAVE=1
When I run this I get:
/home/dave/foo/const.rb:1: warning: already initialized constant DAVE
...and yes, const.rb is the same one used for both test1.rb and
test2.rb. It seems like ruby hashes the paths to the source files and
complains when they are different - even if both paths reference the
same file in the filesystem. Is there a good way to avoid this? Thanks!