Safely parse strings into ruby procs