messagemapper: fix regexp creation for double-optional templates
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sat, 7 Mar 2009 13:02:55 +0000 (14:02 +0100)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sat, 7 Mar 2009 13:02:55 +0000 (14:02 +0100)
commit87a905b01dab90acd2e62975ac180e14b41f3eb8
tree082bb6881a2d7a2aa14b2547de896afbe0fc5344
parent9be9f4450983156f4fee31d41c47a613c4376944
messagemapper: fix regexp creation for double-optional templates

When a mapping template had a double optional key such as
  'something [[double] optional]'
the resuting regexp moved the spacing between the (converted)
double brackets, requiring extra spacing before the 'optional'
keyword.

Fix by moving spacing inside all consecutive brackets before converting
brackets into their regexp form.
lib/rbot/messagemapper.rb