Ruby
Article
By Ardian Haxha

Five Trending Open Source Projects That Use Ruby

By Ardian Haxha
Help us help you! You'll get a... FREE 6-Month Subscription to SitePoint Premium Plus you'll go in the draw to WIN a new Macbook SitePoint 2017 Survey Yes, let's Do this It only takes 5 min

Open Source Week

It’s Open Source Week at SitePoint! All week we’re publishing articles focused on everything Open Source, Free Software and Community, so keep checking the OSW tag for the latest updates.

Ruby, by its nature, is open source. As such, it fits this week’s vibe about open source topics. For the most part, when you hear about Ruby, you will immediately think about Ruby on Rails, but today we will look at some other open source projects that are powered with Ruby. I will do some reviews of Ruby applications that play a key part in organizations, professions, and day to day tools, also showcasing some interesting projects that can be used in your work.

This also is the pioneering post of Sourcehunt Ruby Edition, which had its inception last year in the PHP Channel with the mission to bring open source projects and potential contributors together, creating a win-win situation for both parties.

Note: The listing is not in any particular order.

Homebrew/brew [4,725 ★]

How you can contribute

You can find homebrews mailing list on Google Groups.

homebrew-logo

If you use a Mac and don’t have Homebrew installed, consider taking a look at it. You are probably missing something that can really improve your workflow and save lots of time.

You might have worked with a Linux machine in the past and fell in love with the easy process it has for installing software, This is just what Homebrew tries to do: make it easier to install and search for apps on MacOS. Homebrew is also known by the slogan “The missing package manager for MacOS“.

Installing Homebrew

Open your terminal and paste this line in:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Before it proceeds with installing, it will show you exactly what it does and then continue. Since Homebrew is open source, you can also check the code of the installer before putting it on your machine.

homebrew-install

Now installing many applications is just a matter of a single command:

$ brew install tmux
==> Summary
🍺  /usr/local/Cellar/openssl/1.0.2j: 1,695 files, 12M
==> Installing tmux dependency: libevent
==> Downloading https://homebrew.bintray.com/bottles/libevent-2.0.22.sierra.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring libevent-2.0.22.sierra.bottle.1.tar.gz
🍺  /usr/local/Cellar/libevent/2.0.22: 734 files, 2.0M
==> Installing tmux dependency: utf8proc
==> Downloading https://homebrew.bintray.com/bottles/utf8proc-2.0.2.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring utf8proc-2.0.2.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/utf8proc/2.0.2: 8 files, 617.6K
==> Installing tmux
==> Downloading https://homebrew.bintray.com/bottles/tmux-2.3_1.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring tmux-2.3_1.sierra.bottle.tar.gz
==> Caveats
Example configuration has been installed to:
  /usr/local/opt/tmux/share/tmux

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/tmux/2.3_1: 10 files, 652.4K

Homebrew also shares the idea of other package managers where it pulls packages from a remote repository. Braumeister is a Rails application where you can lookup for packages. Alternative you can search from the command line:

brew search tmux

discourse/discourse [19,805 ★]

How you can contribute

For more questions you can always create a topic at the official discussion site for Discourse.

discourse-logo

Discourse is a platform for communication, it tries to work as a mailing list and forum. It was started by one of the co-founders of Stack Overflow and Stack Exchange. This is where he got the inspiration to develop Discourse as a more discussion type forum since Stack Overflow tries to be more focused on question and answers and doesn’t give much room for general discussion. It’s used by many companies in the commercial world and also by open source communities such as Mozilla. By the way, the SitePoint Forums are based on Discourse.

Giving the advantage that it is open source, you don’t have to give your data to third-party providers. It has a really fast interface and while you are reading a topic or are replying to any comments, it updates in real time so you get new replies automatically. It’s really customizable and can be a fit for various different company/project purposes. Creating topics, polls, categories is very simple and you’re able to do complex searches. Considering the option to extend its functionality with plug-ins, Discourse makes a really great alternative to older type forums. Discourse also has a mobile app for notifications and browsing.

Developing on Discourse

Discourse is built on the powerful Ruby on Rails framework. If you want to put more development into it, the easiest way is to download the vagrant file which contains a full development environment. For more details on development you can check the documentation on GitHub.

--ADVERTISEMENT--

rapid7/metasploit-framework [7,097 ★]

How you can contribute

You can find the issue tracker here, and there is also a community portal available as well as an IRC channel: #metasploit @ irc.freenode.net.

metasploit-logo

Metasploit is a framework for penetration testers, security auditors, and cyber security enthusiasts. Initially, it was built with the Perl programming language, but since 2007 it’s completely rewritten in Ruby. It’s a standard now among tools for doing security analyses and computer forensics. It does come pre-installed on different GNU/Linux machines that have a focus in pen-testing, such as Kali Linux. It runs on Windows, MacOS, and GNU/Linux.

Metasploit provides a framework to test servers, networks, operating systems, web servers, FTP servers, client-side attacks, mobile phones, etc.

Accessing the Metasploit framework can be done via different interface/modes. We have msfconsole which is a console-like interface where you pretty much have just a text mode and you enter commands. There’s Armitage which is a graphical interface. Using Armitage has it’s advantage because it’s easier if you have multiple targets to analyze. Also, exploring payloads (scripts) is much easier in Armitage since you have a file explorer attached in the main window. Armitage also has the msfconsole attached in the bottom of the window.

msfconsole

msfconsole

Armitage

armitage

Creating your own scripts in Metasploit is very easy. Most of Metasploit modules are written in Ruby and you can find example code on their repository here. If you want a simple tutorial on how to write your first exploit with Metasploit, check out this tutorial.

stympy/faker [4,537 ★]

How you can contribute

If you would like to add more data to faker, you can submit a pull request, but before submitting you should check their quick guide. There is also a google group where you can communicate.

faker

Another project that hits our list is Faker. If you’re in a position where you need fake data to present something to your client or boss, Faker is your jam. Sure, your first thought might be, “Let’s go and get some Lorem Ipsum somewhere”, but that doesn’t always get the job done. You might want to present phone numbers, addresses, credit cards, etc. For that purpose, Faker can be a really handy tool to have in your project.

Faker is library for generating fake data, it contains a large variety of data from names, addresses, food, color etc.

Installation and Usage

gem install faker

Import it in your project:

require 'faker'

Input:

Faker::Name.name

Output:

**=> Luther Keebler**

Input:

Faker::PhoneNumber.cell_phone

Output:

**=> 196-251-1860**

Input:

Faker::Vehicle.manufactur

Output:

**=> "FIAT DIESEL BRASIL S/A"**

There is a bigger list of examaples here. You will no longer have to use boring screenshots of your projects.

jordansissel/fpm [7,143 ★]

How you can contribute

If you have an idea or want to improve something on the project, file a ticket on GitHub or you can join the mailing list. More details on how to contribute with coding can be found in the official README.

p

Packaging software is never really easy, so many operating systems, so many different versions? Different Linux package managers for different distros? Oh man!

Luckily there is something that can help you. There is an active project on GitHub that is making this process sane. No matter if your project is just a Gemfile or a simple directory with configuration files, FPM has you covered.

What FPM covers at the moment:

Extension Target
deb Debian-based distribution
rpm RedHat-based distribution
solaris Oracle Solaris
freebsd freebsd
pkg MacOS
pacman ArchLinux

Example

Let’s try and make a package out of the Faker gem discussed above.

Input:

fpm -s gem -t rpm faker

With -s, we tell what source we want (directory, gem, python package, etc.) -t adds the package type, in this case we are using rpm (deb if you want Debian) and the name of the gem. When packaging a gem, it doesn’t have to be installed on our system, as it will pull it directly from Rubygems.

Output:

rubygem-faker-1.6.6-1.noarch.rpm

This is the simplest way to make a package, but FPM can also be used to install configuration files, binaries, shortcuts, etc. By adding more parameters you can also specify a version, information about the package, author, and other pieces of information.

fpm -s dir -t deb -C ~/project --name project_name --version 1.2.0 --iteration 1 --depends  redhat_dependency1 --description "A SitePoint Package".

FPM might not always be the right tool for the job, so make sure to read the documentation and see if it fits with your project.

Conclusion

These were just some of the most starred projects of this month for Ruby on GitHub. Some of these projects might be new to you, or maybe you didn’t know that they were built with Ruby. This puts Ruby on very solid ground as still relevant and used in really interesting projects. Wrapping up this article about the week of open source, we should try not only be consumers of open source but also contributors. Maybe your Ruby project will make this list in the months to come. :)

Login or Create Account to Comment
Login Create Account
Recommended
Sponsors
Get the most important and interesting stories in tech. Straight to your inbox, daily.Is it good?