Slide 1

Slide 1 text

Ruby & You

Slide 2

Slide 2 text

Today is not Friday...

Slide 3

Slide 3 text

But I believe in hugs everyday

Slide 4

Slide 4 text

RubyConf India in Review

Slide 5

Slide 5 text

@aspleenic

Slide 6

Slide 6 text

Even profiler has bugs. Always measure. Verify Results.

Slide 7

Slide 7 text

reading code is the most common task

Slide 8

Slide 8 text

Functional Programming makes code understandable by minimizing moving parts

Slide 9

Slide 9 text

If it's working for facebook it should react for everyone else

Slide 10

Slide 10 text

LOW CO$T SELF HEALING IMMUTABLE INFRASTRUCTURE

Slide 11

Slide 11 text

whatever styling you define in your shadow dom is not affected by any outside styling. Goodbye iframes.

Slide 12

Slide 12 text

live coding is tough

Slide 13

Slide 13 text

live coding git branch shifting is tough

Slide 14

Slide 14 text

require 'bliss'

Slide 15

Slide 15 text

There is no silver bullet

Slide 16

Slide 16 text

It's not for production

Slide 17

Slide 17 text

Cryptography is hard

Slide 18

Slide 18 text

Don't Cross the Streams

Slide 19

Slide 19 text

Beach Party

Slide 20

Slide 20 text

#rubykaraoke

Slide 21

Slide 21 text

it simulates motion, like ruby motion

Slide 22

Slide 22 text

So many queries. So many things. So many aggregations.

Slide 23

Slide 23 text

It works in theory, but not in production

Slide 24

Slide 24 text

Do not put your code to sleep

Slide 25

Slide 25 text

Fewer objects makes a faster Ruby

Slide 26

Slide 26 text

Profiling is not the same as benchmarking. You want to know the split up.

Slide 27

Slide 27 text

Terence Lee @hone02

Slide 28

Slide 28 text

Austin, TX

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

Matz’s Ruby Team

Slide 31

Slide 31 text

← Matz

Slide 32

Slide 32 text

← ko1

Slide 33

Slide 33 text

← ko1 Performance Prince

Slide 34

Slide 34 text

nobu →

Slide 35

Slide 35 text

nobu → Patch Monster

Slide 36

Slide 36 text

Top 5 Committers $ git shortlog -s --since=2012 | sort -rn | \ head -6 2739 nobu <--- 867 akr 710 svn 635 ko1 596 naruse 448 zzak

Slide 37

Slide 37 text

Top 5 (Human) Committers $ git shortlog -s --since=2012 | sort -rn | \ head -6 2739 nobu 867 akr 710 svn <--- 635 ko1 596 naruse 448 zzak

Slide 38

Slide 38 text

Top 5 (Human) Committers $ git shortlog -s --since=2012 | sort -rn | \ head -6 2739 nobu 867 akr 710 svn 635 ko1 596 naruse 448 zzak <---

Slide 39

Slide 39 text

zzak (@_zzak) sensei (せんせい)

Slide 40

Slide 40 text

Agenda ● Story Time ● Working with Ruby ● A Potential Future

Slide 41

Slide 41 text

Story Time

Slide 42

Slide 42 text

CVE-2013-4164 22 November 2013

Slide 43

Slide 43 text

Exploit

Slide 44

Slide 44 text

untrusted_data.to_f Vulnerable Code

Slide 45

Slide 45 text

Venue of Attack JSON.parse untrusted_data

Slide 46

Slide 46 text

Metasploit def digit_pattern @digit_pattern ||= rand(10_000).to_s end def multiplier (500_000 * (1.0/digit_pattern.size)).to_i end def evil_float_string [digit_pattern, digit_pattern * multiplier].join('.') end JSON.parse("[#{evil_float_string}]")

Slide 47

Slide 47 text

$ ruby repro.rb [BUG] Segmentation fault ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux] -- C level backtrace information ---------------------- /../lib/libruby.so.2.0(+0x1ceaa8) [0x7f8787802aa8] /../rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x74e0a) /../lib/libruby.so.2.0(rb_bug+0xb3) [0x7f87876a9af3] /../lib/libruby.so.2.0(+0x14cf66) [0x7f8787780f66]

Slide 48

Slide 48 text

Affected Versions ● Ruby 1.8 after 1.8.6p230 ● Ruby 1.9 prior to 1.9.3p484 ● Ruby 2.0 prior to 2.0.0p353 ● Ruby 2.1 prior to 2.1.0 preview2 ● trunk prior to revision 43780

Slide 49

Slide 49 text

Solution... All users are recommended to upgrade to ● Ruby 1.9.3p484 ● Ruby 2.0.0p353 ● Ruby 2.1.0 preview2

Slide 50

Slide 50 text

What about Ruby 1.8.7? Please note that Ruby 1.8 series or any earlier releases are already obsoleted. There is no plan to release new FIXED versions for them.

Slide 51

Slide 51 text

Ruby 1.9.2?

Slide 52

Slide 52 text

Doubts 1. Don’t do anything 2. Patch just once 3. Maintain Ruby 1.8.7/1.9.2

Slide 53

Slide 53 text

A Patch in Time Heroku releases two unofficial rubies: 1. Ruby 1.9.2p321 2. Ruby 1.8.7p375 github.com/heroku/ruby

Slide 54

Slide 54 text

To: cvs-admin@ruby-lang.org, shugo@ruby-lang.org, matz@ruby-lang.org, shyouhei@ruby-lang.org, zzak@ruby-lang.org At Heroku, we’re still maintaining security fixes for customers on 1.8.7 and 1.9.2 while we figure out our end of life process. After discussion on the security list, I’d like to apply these patches to the proper branches upstream so things don’t get out of sync. Here are the commits I’d like to apply: https://github.com/ruby/ruby/pull/457 https://github.com/ruby/ruby/pull/458 -Terence

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

Getting on Core ● Send enough patches ● port Ruby to non-POSIX platforms ● write library brought into stdlib ● security backporting

Slide 58

Slide 58 text

Friendly Reminder UPGRADE Your Rubies!!!!!!!!!!!

Slide 59

Slide 59 text

PSA Ruby 1.8.7 / 1.9.2 Support Ended last August 2013

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

Ruby 1.9.3 support ended 23/2/2015

Slide 62

Slide 62 text

Ruby 2.0.0 support ends 24 Feb 2016

Slide 63

Slide 63 text

Working with Ruby

Slide 64

Slide 64 text

Why Should You Care?

Slide 65

Slide 65 text

Why Do I Care?

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

The people are the most important part.

Slide 69

Slide 69 text

Why Should You Care?

Slide 70

Slide 70 text

Getting the Source (SVN) Trunk: $ svn co http://svn.ruby-lang.org/repos/ruby/trunk ruby Branch: $ svn co \ http://svn.ruby-lang. org/repos/ruby/branches/ruby_2_0_0

Slide 71

Slide 71 text

Getting the Source (git-svn) $ git clone \ git://github.com/ruby/ruby. git $ cd ruby $ git svn init \ svn+ssh://svn@ci.ruby- lang.org/ruby/trunk $ mv .git/refs/remotes/origin/trunk \ . git/refs/remotes/git-svn $ git svn rebase

Slide 72

Slide 72 text

Protips

Slide 73

Slide 73 text

Did you know... the patchlevel no. is incremented by hand

Slide 74

Slide 74 text

all dates are in JST (UTC +9) github.com/zzak/dotvim/blob/master/.vimrc#L12-L20

Slide 75

Slide 75 text

Top 5 (Human) Committers $ git shortlog -s --since=2012 | sort -rn | \ head -6 2739 nobu 867 akr 710 svn <--- 635 ko1 596 naruse 448 zzak

Slide 76

Slide 76 text

No content

Slide 77

Slide 77 text

Running Tests $ mkdir build $ autoconf $ cd build $ ./configure --prefix=~/tmp/xxx --enable-shared \ --with-openssl-dir=/path/to/openssl \ --with-readline-dir=/path/to/readline \ --with-zlib-dir=/path/to/zlib $ make test-all TESTS=-v

Slide 78

Slide 78 text

Running Individual Test Files $ make test-all TESTS=drb/test_drb.rb

Slide 79

Slide 79 text

Creating a Patch $ diff -pu original/ changed/ \ > ruby-changes.patch $ svn diff > ruby-changes.patch $ git diff > ruby-changes.patch

Slide 80

Slide 80 text

Communication

Slide 81

Slide 81 text

Mailing Lists (ruby-lang.org) →

Slide 82

Slide 82 text

● Ruby-Talk ● Ruby-Core ● Ruby-Doc ● Ruby-CVS

Slide 83

Slide 83 text

Twitter is not a bug tracker

Slide 84

Slide 84 text

Issue Tracker (bugs.ruby-lang.org)

Slide 85

Slide 85 text

Filing Issues ● Bugs are fixed on trunk first ● Can request backport once committed to trunk ● bugs.ruby-lang.org/projects/ruby-trunk/issues/new

Slide 86

Slide 86 text

Create an Account / Login →

Slide 87

Slide 87 text

Search for Existing Issues →

Slide 88

Slide 88 text

Slide 89

Slide 89 text

Issue List

Slide 90

Slide 90 text

Slide 91

Slide 91 text

No content

Slide 92

Slide 92 text

github.com/ruby/ruby/blob/trunk/doc/maintainers.rdoc Maintainer’s List

Slide 93

Slide 93 text

No content

Slide 94

Slide 94 text

No content

Slide 95

Slide 95 text

Security ● Email security@ruby-lang.org ● Responsible Disclosure ● Vulnerability/Use cases ● Affected Rubies

Slide 96

Slide 96 text

Story: Insecure SSL Defaults ● Ruby get it’s default from OpenSSL ● Who’s responsibility is it?

Slide 97

Slide 97 text

No content

Slide 98

Slide 98 text

Ruby Core Developer Meetings ● Draft an agenda ● Pick a date (estimate) ● Ask Matz ● Ask ruby-core

Slide 99

Slide 99 text

No content

Slide 100

Slide 100 text

No content

Slide 101

Slide 101 text

More Protips...

Slide 102

Slide 102 text

English is not everyone’s primary language

Slide 103

Slide 103 text

Nor is Japanese

Slide 104

Slide 104 text

People on Ruby Core speak Ruby

Slide 105

Slide 105 text

Issues are often consumed over e-mail

Slide 106

Slide 106 text

A Potential Future

Slide 107

Slide 107 text

Goals ● Trust ● Transparency ● Onboarding

Slide 108

Slide 108 text

No content

Slide 109

Slide 109 text

Moving to Git ● Backport Tools ● Redmine ● Version Log ● Others? ● Convince Core ● Profit…?

Slide 110

Slide 110 text

Supporting Legacy Rubies

Slide 111

Slide 111 text

Improve Onboarding Materials

Slide 112

Slide 112 text

Testing Ruby 2.1.x https://bugs.ruby-lang.org/issues/9607

Slide 113

Slide 113 text

No content

Slide 114

Slide 114 text

No content

Slide 115

Slide 115 text

Wrapup

Slide 116

Slide 116 text

Anybody can contribute to Ruby

Slide 117

Slide 117 text

There’s more to contribution than C code

Slide 118

Slide 118 text

Documentation?

Slide 119

Slide 119 text

Discussion?

Slide 120

Slide 120 text

Data?

Slide 121

Slide 121 text

May the Ruby be with you

Slide 122

Slide 122 text

Thank You ありがとがざいます @hone02 terence@heroku.com

Slide 123

Slide 123 text

Bonus Round

Slide 124

Slide 124 text

Ruby 3.0 http://brewhouse.io/blog/2014/09/19/ruby-kaigi-2014-day-2

Slide 125

Slide 125 text

Concurrency?

Slide 126

Slide 126 text

No content

Slide 127

Slide 127 text

JIT Compiler?

Slide 128

Slide 128 text

RuJIT https://github.com/imasahiro/rujit

Slide 129

Slide 129 text

Static Typing?

Slide 130

Slide 130 text

No content

Slide 131

Slide 131 text

Static Annotations def connect(r -> Stream, c -> Client) -> Fiber … end

Slide 132

Slide 132 text

Why Static Typing?

Slide 133

Slide 133 text

Why Static Typing? ● Performance

Slide 134

Slide 134 text

Why Static Typing? ● Performance ● Compile Time Check

Slide 135

Slide 135 text

Why Static Typing? ● Performance ● Compile Time Check ● Documentation

Slide 136

Slide 136 text

Why Not?

Slide 137

Slide 137 text

Why Not Static Typing? ● It works™ without it

Slide 138

Slide 138 text

Why Not Static Typing? ● It works™ without it ● It is against duck typing

Slide 139

Slide 139 text

Why Not Static Typing? ● It works™ without it ● It is against duck typing ● It will be optional

Slide 140

Slide 140 text

Why Not Static Typing? ● It works™ without it ● It is against duck typing ● It will be optional ● DRY