Skip to content

Instantly share code, notes, and snippets.

@Sutto
Created January 5, 2009 17:20
Show Gist options
  • Save Sutto/43464 to your computer and use it in GitHub Desktop.
Save Sutto/43464 to your computer and use it in GitHub Desktop.
# Let IRB notify you of a long running task,
# using blocks.
def say(text)
system "say", text.to_s
end
def growl(msg, title = "hallo thar!", sticky = false)
args = ["growlnotify", "-n", "irb", "-m", msg, title]
args << "-s" if sticky
system(*args)
end
def notify
if block_given?
yield
growl "I'm done", "notify via irb", true
say "Done!"
else
say "Give me a block, dumb ass."
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment