plamoni/SiriProxy — Issue #205: Time of instantiation of regexes in plugin .rb files...
Author: rlmalisz
Created: 2011-12-21 00:31:46+00:00
State: open

This is probably painfully obvious to everyone else, but I am pretty new to Ruby, and am fighting my way through coding up my first plugin. I had stuff working fairly brute-force, but was trying to get to something more extensible. I am trying to build up regular expressions during initialization, and then use them in "listen_for" constructs. Which works not at all.

At first, I assumed I was up against variable scoping issues, but I'm don't think that's it. Are the regular expressions for "listen_for" getting precompiled or something? When things die, it's obvious that the expansion of the variables in the regular expressions is basically "nil".

Is this just life, or is there a way to have these recomputed, the expressions treated as volatile....?

--Richard