1. Technology
Send to a Friend via Email
You can opt-out at any time. Please refer to our privacy policy for contact information.

Using Sinatra to Provide a Web Interface for a Gem

By

So far, we've discussed how to use Sinatra in general, how to handle and route requests, and how to build views using Haml. Before we take the plunge into using data storage with Sinatra, let's put what we've discussed so far into practice. This article explains how to use Sinatra to provide a web interface for a gem.

The gems used in this article will be network-related gems, and will all be put together into a single application to provide an easy interface to all of them. The gem used will be whois as well as wrapping a command available on Linux such as traceroute. Though you don't have to have these installed, you will need them to run the code provided in this article without modification. You can also easily adapt any of this code to wrap any gems, methods or system commands you wish.

  1. About.com
  2. Technology
  3. Ruby
  4. Tutorials
  5. Sinatra
  6. Using Sinatra to Provide a Web Interface for a Gem

©2014 About.com. All rights reserved.