Compact Ruby code

It is often written, that Ruby programs are small. Not in sense of making small things, but than they are compact. I’ve heard that many times. But this time I’ve rewrote my backup script.

What it does? It backups set of directories with tar and dumps mysql databases into some directory. After that I can rsync it to backup host.

Old script was written in shell (bash to be exact) and new one in Ruby. Results are as follow:


# wc -l BACKUP.sh
156 BACKUP.sh
# wc -l rbckp.rb
30 rbckp.rb

Is there some difference, can You spot it? :-)) To be honest script does a bit more, and I suppose that exact Ruby copy would have something about 60 lines… Tomorrow I will finish it and see whether my estimate is right.


Comments

2 responses to “Compact Ruby code”

  1. […] NetManiac C and C++, Perl, Networking and more « Compact Ruby code […]

  2. […] NetManiac C and C++, Perl, Networking and more « Compact Ruby code D-Link and PHK have settled » […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.