the next step in gem hosting

nick quaranto

gemcutter: REVENGE OF THE GEM SOURCES

the gemcutter saga: new moon

Now, this is a story all about how

My gem host got flipped-turned upside down

5th year SE & CS major at RIT

bills fan

rubyist at heroku


@qrush

litanyagainstfear.com

> demo

history

motivation

tech

other features

on deck

demo

> history

motivation

tech

other features

on deck

january: jekyll


may: railsconf


august: launch?


october: transition

gemcutter.org ==

gems.rubyforge.org ==

rubygems.org

demo

history

> motivation

tech

other features

on deck

the default host

project approval

php

the new hotness

forked gems

hasmygembuiltyet.org

accessible info

publisher api

open source

demo

history

motivation

> tech

other features

on deck



AWS::S3

class VaultObject < AWS::S3::S3Object
  set_current_bucket_to "gemcutter_production"
end

VaultObject.store("gems/awesome-1.0.0.gem", data, options)



sinatra

# app/metal/hostess.rb

class Hostess < Sinatra::Default
  get "/specs.4.8.gz" do
    content_type('application/x-gzip')
    serve(current_path)
  end
end
require File.join('vendor', 'bundler_gems', 'environment')
require File.join('config', 'environment')

use Rack::Static,
  :urls => ["/index.html",
            "/favicon.ico",
            "/images",
            "/stylesheets"],
  :root => "public/maintenance"
use Hostess
use Rack::Maintenance,
  :file => File.join('public', 'maintenance', 'index.html')
run Sinatra::Application



gem plugins

# lib/rubygems_plugin.rb
Gem::CommandManager.instance.register_command :push

# lib/commands/push_command.rb
class Gem::Commands::PushCommand < Gem::Command
  def execute
    send_gem
  end
end



Delayed::Job

class Gemcutter
  def save
    write_gem
    Delayed::Job.enqueue self
    notify("Successfully registered gem.", 200)
  end

  def perform
    update_index
  end
end



testing

shoulda

factory_girl

rr

cucumber

Feature: Push Gems
  In order to share code with the world
  A rubygem developer
  Should be able to push gems up to Gemcutter

    Scenario: User pushes new gem
      Given I am signed up and confirmed as "email@person.com/password"
      And I have a gem "RGem" with version "1.2.3"
      And I have an api key for "email@person.com/password"
      When I push the gem "RGem-1.2.3.gem" with my api key
      And I visit the gem page for "RGem"
      Then I should see "RGem"
      And I should see "1.2.3"

demo

history

motivation

tech

> other features

on deck

prerelease versions



Gem::Specification.new do |s|
  s.name = "jekyll"
  s.version = "0.6.0-pre"
end

development dependencies



Gem::Specification.new do |s|
  s.name = "jekyll"
  s.add_development_dependency("shoulda", "2.10.2")
end

linking to outside resources



Gem::Specification.new do |s|
  s.name = "jekyll"
  s.links[:code] = "http://github.com/qrush/jekyll"
  s.links[:docs] = "http://rdoc.info/projects/qrush/jekyll"
end

demo

history

motivation

tech

other features

> on deck



rdoc.info + YARD



caliper



READMEs/search



gem forking: you.gemcutter.org

this is our gem host now

let's make it awesome!

thanks

  • you!
  • thoughtbot
  • github
  • heroku
  • ruby central

gemcutter.org



github.com/qrush/gemcutter



irc.freenode.net #gemcutter

photos

  • http://www.flickr.com/photos/sheepbackcabin/3185963273/
  • http://www.flickr.com/photos/x-ray_delta_one/3885680981/
  • http://www.flickr.com/photos/chough/50555124/
  • http://www.flickr.com/photos/babblingdweeb/23816128/
  • http://www.flickr.com/photos/stephangeyer/2438944054/
  • http://www.flickr.com/photos/caveman_92223/3192397069/