Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: patroclo7@gmail.com (Giorgio Lando)
Subject: [sup-talk] how to have an hook play a sound
Date: Sat, 05 Jan 2008 18:11:10 +0100	[thread overview]
Message-ID: <1199552937-sup-9378@clarabella.clarabella> (raw)

Hi again, I do not speak ruby and I am trying to write an after-poll.rb
which plays a sound when there are new messages.
I have tried several things, but probably I am misunderstanding
something radical. I would like that it executes the sound when the
variable @num (the number of polled messages) is >= 1.

My less absurd try is perhaps:

if @num>=1
system "/usr/bin/aplay -q <mysound>"
end

but I get the following error:

Error running hook: undefined method `>=' for nil:NilClass

With:

if @num!=0
system "/usr/bin/aplay -q <mysound>"
end

The sound is always player, also when there is no new message polled.

I have tried to define or declare a class or a method somewhere, but I am really
lost.
Any help?
Giorgio Lando


             reply	other threads:[~2008-01-05 17:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-05 17:11 Giorgio Lando [this message]
2008-01-05 18:43 ` William Morgan
2008-01-05 21:29   ` Giorgio Lando

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1199552937-sup-9378@clarabella.clarabella \
    --to=patroclo7@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox