running ala Perl's strict

D

David Garamond

With -w (verbose mode), Ruby can print compilation warnings, like
uninitialized instance variables.

$ ruby -we 'p @a'
-e:1: warning: instance variable @a not initialized

Is there a mode (ala Perl's strict or something similar) that makes Ruby
raises errors for compilation warnings?
 
P

Paul Brannan

With -w (verbose mode), Ruby can print compilation warnings, like
uninitialized instance variables.

$ ruby -we 'p @a'
-e:1: warning: instance variable @a not initialized

Is there a mode (ala Perl's strict or something similar) that makes Ruby
raises errors for compilation warnings?

No, though I wish there were. You can hack it with a thread that reads
from standard error and looks for warnings.

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top