Created
January 5, 2009 17:20
-
-
Save Sutto/43464 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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