$30 off During Our Annual Pro Sale. View Details »

Gemcutter: The next step in gem hosting

Gemcutter: The next step in gem hosting

Not satisfied by RubyGem hosts? Say hello to Gemcutter and prepare for awesome gem hosting. Learn about this open source effort to improve gem hosting and watch a live demo of the site.

Given at RubyConf 2010.
http://confreaks.net/videos/179-rubyconf2009-gemcutter-the-next-step-in-gem-hosting

Nick Quaranto

January 12, 2012
Tweet

More Decks by Nick Quaranto

Other Decks in Programming

Transcript

  1. the next step in gem hosting
    nick quaranto

    View Slide

  2. gemcutter: REVENGE OF THE GEM
    SOURCES

    View Slide

  3. the gemcutter saga: new moon

    View Slide

  4. Now, this is a story all about how
    My gem host got flipped-turned upside down

    View Slide

  5. 5th year SE & CS major at RIT
    bills fan
    rubyist at heroku
    @qrush
    litanyagainstfear.com

    View Slide

  6. http://next.heroku.com

    View Slide

  7. > demo
    history
    motivation
    tech
    other features
    on deck

    View Slide

  8. demo
    > history
    motivation
    tech
    other features
    on deck

    View Slide

  9. january: jekyll
    may: railsconf
    august: launch?
    october: transition

    View Slide

  10. gemcutter.org ==
    gems.rubyforge.org ==
    rubygems.org

    View Slide

  11. demo
    history
    > motivation
    tech
    other features
    on deck

    View Slide

  12. View Slide

  13. the default host
    project approval
    php

    View Slide

  14. View Slide

  15. the new hotness
    forked gems
    hasmygembuiltyet.org

    View Slide

  16. accessible info
    publisher api
    open source

    View Slide

  17. demo
    history
    motivation
    > tech
    other features
    on deck

    View Slide

  18. View Slide

  19. class VaultObject < AWS::S3::S3Object
    set_current_bucket_to "gemcutter_production"
    end
    VaultObject.store("gems/awesome-1.0.0.gem", data, options)

    View Slide

  20. View Slide

  21. # app/metal/hostess.rb
    class Hostess < Sinatra::Default
    get "/specs.4.8.gz" do
    content_type('application/x-gzip')
    serve(current_path)
    end
    end

    View Slide

  22. 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

    View Slide

  23. View Slide

  24. # 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

    View Slide

  25. View Slide

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

    View Slide

  27. testing

    View Slide

  28. shoulda
    factory_girl
    rr
    cucumber

    View Slide

  29. 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 protected]/password"
    And I have a gem "RGem" with version "1.2.3"
    And I have an api key for "[email protected]/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"

    View Slide

  30. demo
    history
    motivation
    tech
    > other features
    on deck

    View Slide

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

    View Slide

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

    View Slide

  33. 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

    View Slide

  34. demo
    history
    motivation
    tech
    other features
    > on deck

    View Slide

  35. rdoc.info + YARD

    View Slide

  36. View Slide

  37. READMEs/search

    View Slide

  38. gem forking: you.gemcutter.org

    View Slide

  39. this is our gem host now
    let's make it awesome!

    View Slide

  40. thanks
    you!
    thoughtbot
    github
    heroku
    ruby central

    View Slide

  41. gemcutter.org
    github.com/qrush/gemcutter
    irc.freenode.net
    #gemcutter

    View Slide