warning: toplevel constant File referenced by IO::File
by Željko Filipin
I want to delete a file from Application::Mail.download
. The problem is that inside Application
module, File.delete
calls Application::File.delete
.
Run this code and you will get error message:
I could rename Application::File
to something else, but I created Application
module because I wanted to name my classes as I wish without conflicts with Ruby classes.
One solution is to specify that I want to call IO::File.delete
.
But then I get this warning:
How to ignore warning thread at ruby-forum.com provided the solution to removing warning. Add this at the beginning of the file:
But, I want to see other warnings. I know I can change the value of $VERBOSE
to nil
just before I call IO::File.delete
and then change it back. That just feels wrong. Why am I getting that warning after all? Why do I get the warning after calling IO::File.delete
? Am I doing something wrong?