ruby instead of shell, improved tests