Thursday, November 20, 2008

Ruby load path

There are three ways to refer to the variable that stores the load paths that Ruby checks for libraries when you use 'require' or 'load.'


$:
$-I
$LOAD_PATH

Tuesday, October 21, 2008

rsync: Be mindful of the trailing slash!

Pop Quiz: What's the difference between these two commands?

#1: rsync -a --delete /some/path/a/ /some/otherpath/
#2: rsync -a --delete /some/path/a /some/otherpath/


Answer: the first will make /some/otherpath mirror the contents of /some/path/a, while the latter will create a directory in /some/otherpath/a whose contents will mirror /some/path/a.

Be warned! If you're not careful and you use #1 when you intend to use #2, you can lose files in /some/otherpath.

Edit: Found this resource online: Rsync explanations and recommendations