switch from php to ruby