add Ruby version
replace units.each with units.each_with_index
bug fixes
delete 'next' in 'each'
replace 'sort' with 'sort_by'
Ruby: don't strip too much; add executable perm