Save 37% off PRO during our Black Friday Sale! »

Ruby at GitHub

Ruby at GitHub

20bfe76b3d6105641f879fe45cfc9272?s=128

Brandon Keepers
PRO

April 05, 2013
Tweet

Transcript

  1.  RUBY at frequently asked questions about Brandon Keepers •

    @bkeepers
  2. Hello, I am @bkeepers.

  3. Contrary to popular belief, I do not keep bees.

  4. Speaker Deck

  5. ♡

  6. Frequently Asked Questions:  Which languages are used at GitHub?

     Where is Ruby not used?  Why Ruby?  Which libraries do you use?  How do you handle updates?
  7.  Which languages are used at GitHub?

  8.  602 github.com/github  228 inactive  42 forks 

    7 ignored  342 * 602 - 228 - 42 - 7 = 325 some repos met multiple conditions
  9. Excluding: github.com/libgit2 github.com/boxen github.com/play github.com/[staff]

  10. 58% Ruby JavaScript 11% Objective-C 8% Shell 5% CoffeeScript 5%

    Other 6% C 4% C# 3% Internal GitHub Projects by primary language 342 repositories
  11. 33% Ruby JavaScript 15% Objective-C 13% Puppet 3% CoffeeScript 7%

    Other 6% 15% C C# 6% Java 2% 342 repositories Internal GitHub Projects by total bytes
  12. – @rtomayko “GitHub isn’t a Rails shop, it’s not even

    a Ruby shop. It’s a Unix shop.”
  13.  Where is Ruby not used?

  14.    

  15. written in Objective-C

  16. written in C#

  17. written in Java

  18.  Numerous iOS apps written in Objective-C

  19. HUBOT written in CoffeeScript

  20.  unix utilities written mostly in C

  21. …but what about Phone Gap? SL4A? Py4A? py2app?

  22. In France, you can speak English, but it will be

    obvious that you are not French.
  23. …but what about Ruby Motion?

  24. The hardest part of learning iOS Development 3.53% Objective-C syntax

    iOS APIs 96.47%* *These precise numbers may not be accurate.
  25.  Why Ruby?

  26.  “no parents”

  27. Why do you drive a Toyota?

  28. taste

  29. practicality

  30. Ruby is not a

  31. Ruby is not a

  32. Ruby is not a

  33. Ruby is a

  34. Ruby is a

  35.  What libraries do you use?

  36. 153  Gemfile

  37. None
  38. None
  39. None
  40. None
  41. None
  42. Sinatra or Rails?

  43. Sinatra 51 projects Rails 30 projects 9 projects both

  44. 8 MB both Rails 12.1 MB Sinatra 10.75MB

  45. test/unit, rspec or minitest?

  46. Internal GitHub Projects test frameworks 45% test/unit rspec 43% minitest

    13%
  47.  How do you handle updates?

  48.  feature flags

  49. None
  50. module FeatureFlags def preview_features? staff? end def time_travel_enabled? preview_features? end

    end app/concerns/feature_flags.rb
  51. class User < ActiveRecord::Base include FeatureFlags end app/models/user.rb module FeatureFlags

    def preview_features? staff? end def time_travel_enabled? preview_features? end end app/concerns/feature_flags.rb
  52. class User < ActiveRecord::Base include FeatureFlags end app/models/user.rb module FeatureFlags

    def preview_features? staff? end def time_travel_enabled? preview_features? end end app/concerns/feature_flags.rb class ApplicationController flags = FeatureFlags.public_instance_methods delegate *flags, :to => :current_user, :allow_nil => true helper_method *flags end app/controllers/application_controller.rb
  53. None
  54. <%- if time_travel_enabled? -%> <%= link_to 'Time Travel', time_travel_path %>

    <%- end -%> app/views/home/index.html.erb
  55. <%- if time_travel_enabled? -%> <%= link_to 'Time Travel', time_travel_path %>

    <%- end -%> app/views/home/index.html.erb class TimeTravelController < ApplicationController before_filter :ensure_time_travel_enabled def ensure_time_travel_enabled not_found unless time_travel_enabled? end end app/controllers/time_travel_controller.rb
  56. module FeatureFlags def preview_features? staff? end def time_travel_enabled? preview_features? true

    end end app/concerns/feature_flags.rb Launch Day
  57.  github.com/jnunemaker/flipper  github.com/jamesgolick/rollout

  58.  Ruby 1.9 2.0

  59. The path to 1.9

  60. 1. Run CI against 1.8 & 1.9 The path to

    1.9
  61. 1. Run CI against 1.8 & 1.9 2.? 3.Profit The

    path to 1.9
  62. The path to 1.9 1. Run CI against 1.8 &

    1.9 2.@tmm1 3.Profit
  63. 1. Run CI against 1.8, 1.9 & 2.0 2.@tmm1 3.Profit

    The path to 2.0
  64. – @tmm1 “Compared to REE, average cpu response time for

    browser requests last week was reduced by over 25ms. The 99th percentile cpu response time for browser requests was reduced by over 125ms!”
  65. None
  66.  Rails 3

  67.  github.com/github/rails

  68.  backport in progress

  69.  Other Questions? @bkeepers https://speakerdeck.com/bkeepers/ruby-at-github