For some time I have been studying and practicing the Ruby language. Thus, to register my discoveries I’ll post them as Ruby tips in this blog.
The first tip is about writing to stderr and quitting your script when something goes wrong. It’s a common practice for UNIX hackers do this.
In Ruby there is a lot of ways for doing something and this is one of the few examples.
So, instead of doing this:
STDERR.puts "Something gone wrong" exit(1)
we can do this:
abort "Something gone wrong"
To know more about the abort method, click here.
That’s it.
