Slide 1

Slide 1 text

Ruby & You

Slide 2

Slide 2 text

RubyConf Portugal in Review

Slide 3

Slide 3 text

#rubykaraoke

Slide 4

Slide 4 text

#rubykaraoke

Slide 5

Slide 5 text

Case statements === Ranges

Slide 6

Slide 6 text

Program in Confidence

Slide 7

Slide 7 text

Rails is so 2005 @myabc

Slide 8

Slide 8 text

URLs are very important

Slide 9

Slide 9 text

URL DRIVEN DEVELOPMENT ?

Slide 10

Slide 10 text

Macros Turtles all the way down

Slide 11

Slide 11 text

Ruby is an Emergency Instructions Language

Slide 12

Slide 12 text

Fewer objects makes a faster Ruby

Slide 13

Slide 13 text

Ruby isn't going to last forever...

Slide 14

Slide 14 text

Bieber increases programmer productivity

Slide 15

Slide 15 text

Innovation happens through reinventing the wheel

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

Today is not Friday...

Slide 18

Slide 18 text

But Caleb believes in hugs everyday

Slide 19

Slide 19 text

Terence Lee @hone02

Slide 20

Slide 20 text

Austin, TX

Slide 21

Slide 21 text

@calebthompson

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

Jacuzzi for your Hands

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

Ruby Task Force

Slide 28

Slide 28 text

Ruby Task Force Member

Slide 29

Slide 29 text

Matz’s Ruby Team

Slide 30

Slide 30 text

← Matz

Slide 31

Slide 31 text

← ko1

Slide 32

Slide 32 text

← ko1 Performance Prince

Slide 33

Slide 33 text

nobu →

Slide 34

Slide 34 text

nobu → Patch Monster

Slide 35

Slide 35 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 36

Slide 36 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 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

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

Slide 39

Slide 39 text

zzak (@_zzak) for Ruby Hero

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 November 22, 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: [email protected], [email protected], [email protected], [email protected], [email protected] 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 in August

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

Ruby 1.9.3 support ends 2/23/2015

Slide 62

Slide 62 text

Working with Ruby

Slide 63

Slide 63 text

Why Should You Care?

Slide 64

Slide 64 text

Why Do I Care?

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

The people are the most important part.

Slide 68

Slide 68 text

Why Should You Care?

Slide 69

Slide 69 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 70

Slide 70 text

Getting the Source (git-svn) $ git clone [email protected]:ruby/ruby.git $ cd ruby $ git svn init \ svn+ssh://[email protected] lang.org/ruby/trunk $ mv .git/refs/remotes/origin/trunk \ . git/refs/remotes/git-svn $ git svn rebase

Slide 71

Slide 71 text

Protips

Slide 72

Slide 72 text

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

Slide 73

Slide 73 text

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

Slide 74

Slide 74 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 75

Slide 75 text

No content

Slide 76

Slide 76 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 77

Slide 77 text

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

Slide 78

Slide 78 text

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

Slide 79

Slide 79 text

Communication

Slide 80

Slide 80 text

Mailing Lists (ruby-lang.org) →

Slide 81

Slide 81 text

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

Slide 82

Slide 82 text

Twitter is not a bug tracker

Slide 83

Slide 83 text

Issue Tracker (bugs.ruby-lang.org)

Slide 84

Slide 84 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 85

Slide 85 text

Create an Account / Login →

Slide 86

Slide 86 text

Search for Existing Issues →

Slide 87

Slide 87 text

Slide 88

Slide 88 text

Issue List

Slide 89

Slide 89 text

Slide 90

Slide 90 text

No content

Slide 91

Slide 91 text

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

Slide 92

Slide 92 text

No content

Slide 93

Slide 93 text

No content

Slide 94

Slide 94 text

Security ● Email [email protected] ● Responsible Disclosure ● Vulnerability/Use cases ● Affected Rubies

Slide 95

Slide 95 text

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

Slide 96

Slide 96 text

No content

Slide 97

Slide 97 text

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

Slide 98

Slide 98 text

No content

Slide 99

Slide 99 text

No content

Slide 100

Slide 100 text

More Protips...

Slide 101

Slide 101 text

English is not everyone’s primary language

Slide 102

Slide 102 text

Nor is Japanese

Slide 103

Slide 103 text

People on Ruby Core speak Ruby

Slide 104

Slide 104 text

Issues are often consumed over e-mail

Slide 105

Slide 105 text

A Potential Future

Slide 106

Slide 106 text

Goals ● Trust ● Transparency ● Onboarding

Slide 107

Slide 107 text

No content

Slide 108

Slide 108 text

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

Slide 109

Slide 109 text

Supporting Legacy Rubies

Slide 110

Slide 110 text

Improve Onboarding Materials

Slide 111

Slide 111 text

For Katrina, Chris, and Phil

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

Ruby 2.2

Slide 116

Slide 116 text

Symbol GC

Slide 117

Slide 117 text

Incremental GC https://bugs.ruby-lang.org/issues/10137

Slide 118

Slide 118 text

vfork()

Slide 119

Slide 119 text

Dedupe String Keys in Hashes https://bugs.ruby-lang.org/issues/9382

Slide 120

Slide 120 text

BEGIN { ObjectSpace.count_objects } def count_string before = ObjectSpace.count_objects[:T_STRING] yield after = ObjectSpace.count_objects[:T_STRING] puts "Increasing String object is: #{after - before}" end count_string{'a' + 'b'} #=> 3

Slide 121

Slide 121 text

in Ruby 2.1.3 hash = { "jeremy" => "julius caesar" } count_string { 1000.times { hash["jeremy"] } #=> 1000 }

Slide 122

Slide 122 text

in Ruby 2.2 hash = { "jeremy" => "julius caesar" } count_string { 1000.times { hash["jeremy"] } #=> 0 }

Slide 123

Slide 123 text

Frozen Ruby: "Ruby"f https://bugs.ruby-lang.org/issues/8923

Slide 124

Slide 124 text

Frozen Ruby: "Ruby"f https://bugs.ruby-lang.org/issues/8923 Soggy

Slide 125

Slide 125 text

No content

Slide 126

Slide 126 text

Schedule ● Sep 13: Ruby 2.2.0.preview1 ● Sep 30: Large Feature Freeze ● Oct 29: Preview 2 Meeting ● Nov: Feature Freeze, Ruby 2.2.0.preview2 ● Dec: Release Candidate ● Dec 25: 2.2.0 Release!

Slide 127

Slide 127 text

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

Slide 128

Slide 128 text

Concurrency?

Slide 129

Slide 129 text

No content

Slide 130

Slide 130 text

JIT Compiler?

Slide 131

Slide 131 text

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

Slide 132

Slide 132 text

Static Typing?

Slide 133

Slide 133 text

No content

Slide 134

Slide 134 text

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

Slide 135

Slide 135 text

Why Static Typing?

Slide 136

Slide 136 text

Why Static Typing? ● Performance

Slide 137

Slide 137 text

Why Static Typing? ● Performance ● Compile Time Check

Slide 138

Slide 138 text

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

Slide 139

Slide 139 text

Why Not?

Slide 140

Slide 140 text

Why Not Static Typing? ● It works™ without it

Slide 141

Slide 141 text

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

Slide 142

Slide 142 text

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

Slide 143

Slide 143 text

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

Slide 144

Slide 144 text

Wrapup

Slide 145

Slide 145 text

Anybody can contribute to Ruby

Slide 146

Slide 146 text

There’s more to contribution than C code

Slide 147

Slide 147 text

Documentation?

Slide 148

Slide 148 text

Discussion?

Slide 149

Slide 149 text

Data?

Slide 150

Slide 150 text

May the Ruby be with you

Slide 151

Slide 151 text

Thank You ありがとがざいます @hone02 [email protected]