Expect4r – Interact with Cisco IOS, IOS-XR, and Juniper JUNOS CLI.

Expect4r is a library that enables a ruby program to 'talk' to routers following a written ruby script. You talk to routers by connecting to them using ssh or telnet and send exec or config command and collect router output than can be parsed using ruby.