Ruby off Rails

So, Ruby is well know for its hugely popular gem Rails which greatly simplifies building websites. But what are some other programs built in Ruby? Here are a few very popular examples.

RubyMotion – Develop native apps for iOS (both iPhone and iPad) and OS X in Ruby. It is based on MacRuby which was developed by Apple. The app compiles into native objective-c just like iPhone apps made traditionally.

Artoo – Gets Ruby up and running on Arduino, Leap Motion, Pebble, Rasberry Pi, Ardrone, Roomba and more. Built to let you program devices and the internet of things in Ruby. It also lets you connect multiple devices together through Artoo into an integrated robotic solution.

Rake – A task management tool that allows you to namespace tasks and run them with Ruby it is Ruby’s alternative to make. A simple gem that you can install with ‘gem install rake’. Built by Jim Weirich (who you need to know about), it enables you to run a command from the bash prompt and execute Ruby code inside your app or on the system at large. Wikipedia claims that “It is the most widely downloaded Ruby Gem, downloaded more than 40 million times[12] and has been included with Apple OS X since at least version 10.7.”

Chef – A system provisioning tool that speeds up the initial configuration of servers as well as their maintenance. It hooks into cloud services like AWS and Rackspace. It works on the basis of “recipes” that define how a given task is to be done for example how packages are to be installed and what programs should be running on a server.

Capistrano – It started as mainly a rails deployment tool, but can be used to deploy any language webapps now. It sells itself as a remote server automation tool that can deploy to an arbitrary number of web servers and to automate common development tasks.

Homebrew – A command line package manager for OSX that is a must have for any Ruby developer. Easily install databases like mysql and postgres or download python with ‘brew install python’ to try it out. It is powered by git and ruby so you can hack at it as you like. You can also create your own homebrew packages with ‘brew create’ and share them with the world.

Sinatra – “Put this in your pipe and smoke it.” Sinatra is a lightweight alternative to Rails. Use rvm to ‘gem install sinatra’ and then build out a small webapp.

Gosu – A 2d game creation gem that works on Mac, Windows and Linux.

Ocra – Creates Windows applications from Ruby code. Includes the Ruby code and interpreter in the application.

 

Processing…
Success! You're on the list.

Naming Ruby Gems

I created a gem called tiedye and I wanted to explain a bit of my reasoning behind why I named it that. So, lets talk about naming. Why call this gem tiedye? How do I decide to name Ruby gems in the first place?

First, there are a few community conventions on how to name your gem. I went with the convention of using underscores in the name of the gem (snake_case instead of camelCase). This applies to all gems that have more than two words as their name. So tiedye or rails are one word but will_paginate and delayed_job are two words written in snake_case. Also I suggest you try to find a fun name for your gem. Ruby has a xml parser named nokogiri, which is Japanese for chainsaw and I named my gem that works with colors tiedye because of the mix of colors those awesome hippies love to wear. There are a whole list of good suggestions that you can find here: http://guides.rubygems.org/name-your-gem/

Other rules (which you will find in the previous link) are:

  • Use dashes for extensions
  • Mix underscores and dashes appropriately
  • Don’t use UPPERCASE letters

If you don’t understand those then you should have read the article. Seriously. I don’t want to explain it. Go read the article.

The second thing I did is I went to rubygems.org and search for my desired gem name. With so many gems built to date there is a good chance that someone else already has used that name. You want your gem to have a unique name so that people can remember it and so that you can deploy it to Rubygems.org. Don’t worry, though there are plenty of names still available. Of course, all this only applies if you are trying to make a public gem. If you are making a private gem, then you will be requiring it from a private repo on github and you can name it what you like. Though you might still conflict with other named gems if you decide to name it something like “rails”.

Also for a good read check out: http://unethicalblogger.com/2011/11/13/ten-poorly-chosen-gem-names.html

Processing…
Success! You're on the list.