One recommendaton -- make it a habit to invoke your Ruby scripts with the »-w« option, like so:
ruby -w testscript.rb
This way you won't miss any suggestions or warning the Ruby interpreter might have for your script, e.g. ambivalent syntax (which happens in some situations where whitespace and/ or missing parens are involved).
Alternatively, you can prepend a so-called »shebang« as the first line in your Ruby scripts and add the »-w« switch there (i.e. #!/usr/bin/ruby -w).
One recommendaton -- make it a habit to invoke your Ruby scripts with the »-w« option, like so:
ruby -w testscript.rb
This way you won't miss any suggestions or warning the Ruby interpreter might have for your script, e.g. ambivalent syntax (which happens in some situations where whitespace and/ or missing parens are involved).
Alternatively, you can prepend a so-called »shebang« as the first line in your Ruby scripts and add the »-w« switch there (i.e. #!/usr/bin/ruby -w).
virumoz 1 year ago
@virumoz I'm not really into running with warnings personally, but thanks for sharing that as some people will find it useful/interesting.
bigbold2 1 year ago 2