Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an Expect equivalent gem for Ruby?

Tags:

Is there an Expect equivalent gem for Ruby?

I tried searching on code.google and rubygems.org, but sadly it did not show up.

FYI: Expect is a Unix automation and testing tool, written by Don Libes as an extension to the Tcl scripting language, for interactive applications such as telnet, ftp, passwd, fsck, rlogin, tip, ssh, and others.

like image 776
Jokester Avatar asked Aug 22 '11 01:08

Jokester


People also ask

Which is the command used to list all the gems available in Ruby?

The Gem command is included with Ruby 1.9+ now, and is a standard addition to Ruby pre-1.9. Because local_gems relies on group_by , it returns a hash of the gems, where the key is the gem's name, and the value is an array of the gem specifications.

What is gem CLI?

Command Line Interface gem allows you to quickly specify command argument parser that will automatically generate usage, handle stdin, switches, options and arguments with default values and value casting.

How do I check RubyGems version?

You can check your Ruby version by running ruby --version , and you can check your RubyGems version by running gem --version . If you need to upgrade Ruby, use your ruby version manager's instructions. If you need to upgrade RubyGems, run gem update --system .

What does gem update -- system do?

gem update --system only updates RubyGems. gem update will update all installed gems to their latest versions, so it will update Rails to 3.0. 0. in your application folder.


1 Answers

Ruby comes with the PTY module for setting up pseudoterminals to drive interactive command line applications. With it comes an expect method that allows you to interact with an application kinda like Expect. For learning how to use expect, I found "What to expect from the Ruby expect library?" helpful.

As far as gems go, maybe checkout greenletters which is supposed to improve upon PTY + expect (although I haven't tried it myself).

like image 111
Simon Chiang Avatar answered Sep 28 '22 08:09

Simon Chiang