Ruby

The Language

Ruby is a mix of Smalltalk and Algol, providing for a simple, beautiful language style and profuse amounts of power and flexibility.

Representative Libraries

Unusual but Noteworthy Libs

Resources

Library Development in Ruby

The Community

Ruby has been in development since the 90's, but has really only gathered a large following recently. This provides for a young but innovative and energetic development community.

A rather large part of the Ruby library development community chooses to license their work under one of many Open Source Licenses. This creates a good deal of code reuse and plenty of opportunities for beginners to learn from more experienced developers.

The Process

As in any development environment, nailing down a single process is futile, so we'll cover the more general points.

Revision Control and Repository Hosting

It's imperative that an RCS / SCM system be used to manage both changes to the code as well as contributions to the source. The Ruby community actively uses these well known SCMs: Git, SVN, and Mercurial.

Ruby developers also have numerous hosting options, including RubyForge, the primary source of RubyGems hosting and distribution. Gems are phenomenally popular and easy to use for distributing your libraries as well as most dependencies (which can be a nightmare for other platforms). RubyForge provides either Subversion or CVS hosting for all of its projects. There also exist numerous other Subversion repository hosting services.

For Git repository hosting, GitHub has fast become one of the most popular options among the Ruby development community, especially since their pricing plans include free hosting for open source projects. Gitorious also provides an attractive option, as does the long-time host repo.or.cz.

Starting Development

Standard Library Directory Layout

* lib_name/
 * lib/
  * lib_name.rb
  * lib_name/
   * support_files...
 * bin/
  * lib_executable
 * test/...
 * example/...
 * README
 * Rakefile

Several gems are available to aid in the initial and intermediate steps of development including setting up basic file structures, generating Specs (used to package up gems into the proper format, similar to the Debian .deb format), and updating RubyForge project pages with new releases. These gems include Hoe, NewGem, Mr Bones, MetaProject and Reap. If you'd like to use one of these gems, read up on the appropriate documentation before beginning.

To the right you'll notice a very simple directory layout structure for a simple library called lib_name. The README file will contain introductory information used to instruct newcomers on how to install and use your library.

Packaging and Distributing Your Library

As mentioned before, distribution via the RubyForge Gem format is the standard way to package and distribute your library. With that, you need to set up your development environment to be able to package your files as a Gem.

Read further:

Topics

Here are some topics you may find useful or interesting in the course of development.

page_revision: 10, last_edited: 1206040771|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution 3.0 License