Adhearsion Dialplan Writing

0 views
Skip to first unread message

yasi

unread,
May 2, 2008, 1:18:59 PM5/2/08
to Adhearsion
Hi,

I'm trying to write a dialplan in ruby and I like my changes in the
ruby file be visible accross the framework as soon as I update the
file, without restarting adhearsion. I don't want to keep all my
dialplans in extensions.rb, so I included my ruby file "require
myapp.rb" in the extensions.rb, and tried to call myapp from
extensions.rb. However, it seems that the changes in "myapp.rb" are
not visible until I restart adhearsion. Anybody has any idea what I'm
doing wrong?

Thanks a lot!

Justin Grammens

unread,
May 2, 2008, 3:29:28 PM5/2/08
to adhea...@googlegroups.com
Hi,
Have you tried call load for the file you wish to use instead of require? I think the issue is that in Ruby 'require' only loads the files once, while 'load' will continue to evaluate the file each time it's read.
Justin

yasi

unread,
May 2, 2008, 4:31:54 PM5/2/08
to Adhearsion
I changed "require" to "load" and it's working fine now!
Thanks a lot for your help!
Yasi

On May 2, 3:29 pm, "Justin Grammens" <jus...@localtone.com> wrote:
> Hi,
> Have you tried call load for the file you wish to use instead of require? I
> think the issue is that in Ruby 'require' only loads the files once, while
> 'load' will continue to evaluate the file each time it's read.
> Justin
>
Reply all
Reply to author
Forward
0 new messages