Skip to content

Instantly share code, notes, and snippets.

@carlhuda
Created November 25, 2009 16:47
Show Gist options
  • Save carlhuda/242865 to your computer and use it in GitHub Desktop.
Save carlhuda/242865 to your computer and use it in GitHub Desktop.
catch(:EXISTS) do
@jobs.each_index do |i|
if @jobs[i] and (@jobs[i][0] == key ||
@jobs[i][1] == key ||
@jobs[i][1].context.main.equal?(key))
@jobs[i] = nil
throw :EXISTS
end
end
IRB.fail NoSuchJob, key
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment