Skip to content

Instantly share code, notes, and snippets.

@sferik
Created August 8, 2011 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sferik/1131496 to your computer and use it in GitHub Desktop.
Save sferik/1131496 to your computer and use it in GitHub Desktop.
Is it Rubinius? Ask Travis!

Is it Rubinius? Ask Travis!

This project was built on Friday, August 5, 2011 as part of the celebration of Rubinius Day!

It utilizes Travis:

  1. ability test gems against Rubinius
  2. API

This simple web app borrows graphics and stylesheets from http://isitrubinius.com to create a site with similar functionality, but instead of being crowdsourced, it's powered by Travis: http://isitrbx.herokuapp.com

The app allows you to enter the name of any gem and will tell you whether the latest Rubinius build is passing on Travis.

It could be easily modified to test gems for compatibility with JRuby, MRI 1.9.3, or any other Ruby version/implementation supported by RVM and Travis.

Screenshot

Screenshot

Examples

Credits

This project uses the following open-source libraries:

require 'bundler'
Bundler.require
require './isitrbx'
run Sinatra::Application
source 'http://rubygems.org'
gem 'sinatra'
gem 'nokogiri'
gem 'multi_xml'
gem 'slim'
require 'open-uri'
RVM = "rbx"
get '/' do
slim ''
end
get '/search' do
begin
@rubygems_url = "http://rubygems.org/gems/#{params[:gem]}"
rubygems = Nokogiri::HTML(open(@rubygems_url))
@authors = rubygems.css('.who .authors p').first.content
@description = rubygems.css('#markup p').first.content
@github_url = rubygems.css('.meta .links a').map{|link| link['href']}.find{|href| href =~ /github\.com/i}
github_array = @github_url.split('/')
# ["https:", "", "github.com", "user", "project"]
@user, @project = github_array[3], github_array[4]
@travis_url = "http://travis-ci.org/#{@user}/#{@project}.xml?rvm=#{RVM}"
@status = MultiXml.parse(open(@travis_url))['repository']['last_build_status']
slim :show
rescue OpenURI::HTTPError
raise Sinatra::NotFound
end
end
doctype html
html
head
title Is it Rubinius?
link href="/css/application.css" media="screen" rel="stylesheet" type="text/css"
body
div id="head"
a href="/" id="branding"
span id="tagline" Travis-powered gem compatibility for Rubinius
form action="/search" method="get"
input type="text" name="gem" value=params[:gem]
input type="submit" value="Search"
div id="main"
== yield
h1 id="gem-name" = @project
dl
dt Author(s)
dd = @authors
dt Summary
dd = @description
div id="status"
- case @status
- when "0"
span class="passing" passing
- when "1"
span class="failing" failing
- when nil
span class="unknown" unknown
div Latest Rubinius build status on Travis for #{@project}.
@jeffkreeftmeijer
Copy link

Awesome entry! The design looks amazing too. :)

@joshk
Copy link

joshk commented Aug 8, 2011

This is insanely cool and impressive, this should be added to the rubini.us homepage, its just so great!

@michaelklishin
Copy link

IsItRubinius is great, we certainly would love to see more uses of the data we accumulate. Of course, we need to improve our API to make that possible.

@rymai
Copy link

rymai commented Aug 8, 2011

Nice and concise work! :)

@rkh
Copy link

rkh commented Aug 15, 2011

Only entry that adds real value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment