Running an RSF job using the Humble-RPi-plugin-RSF gem

The following code demonstrates running a Ruby Scripting Format (RSF) job from within the Humble-RPi-plugin-RSF gem:

require 'humble_rpi-plugin-rsf'

s =<<EOF
<?dynarex schema="keywords[title]/keyword(msg, job)"?>
title: SPS Keywords
--+

m: ^(goodbye .*)
j:  //job:speak http://a0.jamesrobertson.eu/qbx/r/espeak.rsf $1

m: ^(hello .*)
j:  //job:speak http://a0.jamesrobertson.eu/qbx/r/espeak.rsf $1
EOF

dx = Dynarex.new
dx.import s

r = HumbleRPiPluginRsf.new settings: {lookup: dx}
r.on_do_message 'hello James'

Resources