from nil to guru: intro to ruby on rails

76
Ruby on Rails from nil to :guru the epic journey that’s how we like to call NULL

Upload: netguru

Post on 15-Jul-2015

281 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: From nil to guru: intro to Ruby on Rails

Rubyon Rails

from nil to :guruthe epic journey

that’s how we like to call NULL

Page 2: From nil to guru: intro to Ruby on Rails
Page 3: From nil to guru: intro to Ruby on Rails

RUBY = LANGUAGERAILS = FRAMEWORK

or “Ruby on Rails” for web apps

Page 4: From nil to guru: intro to Ruby on Rails

tryruby.org

Page 5: From nil to guru: intro to Ruby on Rails

Our Evil Plan

1. Ruby, Rails2. Best Practices

3. Let’s make Twitter

Page 6: From nil to guru: intro to Ruby on Rails

RUBY(that language)

Page 7: From nil to guru: intro to Ruby on Rails

RUBY is a dynamic, scripting, object-oriented language…

Page 8: From nil to guru: intro to Ruby on Rails

RUBY is a dynamic, scripting, object-oriented language…

BLA BLA BLA

Page 9: From nil to guru: intro to Ruby on Rails
Page 10: From nil to guru: intro to Ruby on Rails

R ead E val P rint L oop

how Ruby

thinks?oh, gosh

Page 11: From nil to guru: intro to Ruby on Rails

METAprogramming

Page 12: From nil to guru: intro to Ruby on Rails

this is HELLO WORLD:

Page 13: From nil to guru: intro to Ruby on Rails

and this is HELLO WORLD too:

Page 14: From nil to guru: intro to Ruby on Rails

OMG, even this is HELLO WORLD:

Page 15: From nil to guru: intro to Ruby on Rails

DON’TMISSTHE POINT!

metaprogramming is awesome

Page 16: From nil to guru: intro to Ruby on Rails

PRIVATElike a

TRUE STAR

Ruby is

pros and cons

Page 17: From nil to guru: intro to Ruby on Rails
Page 18: From nil to guru: intro to Ruby on Rails

EVERYTHING’sanOBJECT

Page 19: From nil to guru: intro to Ruby on Rails

Q: how many objects you see?

Page 20: From nil to guru: intro to Ruby on Rails

WAYMORECOOL

STUFFTO LEARN

Page 21: From nil to guru: intro to Ruby on Rails

bloc.io/ruby-warrior

Page 22: From nil to guru: intro to Ruby on Rails

RUBY is BORING(and Rails too)

Page 23: From nil to guru: intro to Ruby on Rails

RUBY is BORINGSTABLE

(and Rails too)

Page 24: From nil to guru: intro to Ruby on Rails

rvm.io

Page 25: From nil to guru: intro to Ruby on Rails

RUBY is BORINGSECURE

(and Rails too)

Page 26: From nil to guru: intro to Ruby on Rails

RUBY is BORINGOPEN SOURCE

(and Rails too)

Page 27: From nil to guru: intro to Ruby on Rails

72%of Ruby devs

is on GitHub#java #39percent #sad#wow

Page 28: From nil to guru: intro to Ruby on Rails

RUBY is BORINGCOMMUNITY

(and Rails too) -DRIVEN

Page 29: From nil to guru: intro to Ruby on Rails

rubygems.org

Page 30: From nil to guru: intro to Ruby on Rails

GEMS for everything

Page 31: From nil to guru: intro to Ruby on Rails

GEMS for everything

Page 32: From nil to guru: intro to Ruby on Rails

GEMS for everything

Page 33: From nil to guru: intro to Ruby on Rails

ruby-toolbox.com

Page 34: From nil to guru: intro to Ruby on Rails

BTW KEEP YOUR GEMSIN THE GEMFILEINSTALL

UPDATE

> bundle installINSTALL WITH CMD:

Page 35: From nil to guru: intro to Ruby on Rails

bundler.io

Page 36: From nil to guru: intro to Ruby on Rails

Most Popular

Gem ? of all times

Page 37: From nil to guru: intro to Ruby on Rails

RAILSRuby on

(that web framework)

Page 38: From nil to guru: intro to Ruby on Rails

Model View Controller

app/models

app/views

app/controllers

Page 39: From nil to guru: intro to Ruby on Rails

railscasts.com

deprecation

notice!!!

Page 40: From nil to guru: intro to Ruby on Rails

Test-Driven Developmentor TDD

Page 41: From nil to guru: intro to Ruby on Rails

Test-Driven Developmentor TDD

1. write spec

Page 42: From nil to guru: intro to Ruby on Rails

Test-Driven Developmentor TDD

1. write spec run specs fail

there’s no code yet, douh

Page 43: From nil to guru: intro to Ruby on Rails

Test-Driven Developmentor TDD

1. write spec run specs fail2. write code

WRITE ONLY WHAT IS TESTED!

Page 44: From nil to guru: intro to Ruby on Rails

Test-Driven Developmentor TDD

1. write spec run specs fail2. write code run specs fail again?

BAD IMPLEMENTATION!!!11oneor bad specs

Page 45: From nil to guru: intro to Ruby on Rails

Test-Driven Developmentor TDD

1. write spec run specs fail2. write code run specs fail again?3. fix code run specs success!

so called RED/GREEN

Page 46: From nil to guru: intro to Ruby on Rails

betterspecs.org

Page 47: From nil to guru: intro to Ruby on Rails
Page 48: From nil to guru: intro to Ruby on Rails

and many more…

jQuery of course too!

Page 49: From nil to guru: intro to Ruby on Rails

BEST PRACTICES

or hints stolen from netguru’s wiki

Page 50: From nil to guru: intro to Ruby on Rails

!META TIPS

BUT FIRST

for editors

Page 51: From nil to guru: intro to Ruby on Rails

2 SPACES EVERYWHERE_ _

Page 52: From nil to guru: intro to Ruby on Rails

SOFT TABScode hard, use soft tabs, go pro_ _

Page 53: From nil to guru: intro to Ruby on Rails

OK REAL TIPS NOW

Page 54: From nil to guru: intro to Ruby on Rails

bbatsov/ruby-style-guide

Page 55: From nil to guru: intro to Ruby on Rails

bbatsov/rails-style-guide

Page 56: From nil to guru: intro to Ruby on Rails

EDITOR WARSA long time ago in a galaxy far, far away....

Page 57: From nil to guru: intro to Ruby on Rails

EDITOR WARSA long time ago in a galaxy far, far away....

beginners who

think they need an IDE

Page 58: From nil to guru: intro to Ruby on Rails

EDITOR WARSA long time ago in a galaxy far, far away....

beginners who

think they need an IDEseniors who

need an IDE for 2 hours

Page 59: From nil to guru: intro to Ruby on Rails

EDITOR WARSA long time ago in a galaxy far, far away....

beginners who

think they need an IDEseniors who

need an IDE for 2 hours

Page 60: From nil to guru: intro to Ruby on Rails

SMALLcommits

small like this

Page 61: From nil to guru: intro to Ruby on Rails

CODEREVIEWyou are NOT your code

accepted passed rejected

…and not checked/passed after 48hrs: auto—

deploy block!

Page 62: From nil to guru: intro to Ruby on Rails

Continuous

how to fail and raiseapprox. 1000 times a day

IntegrationST

AGIN

G

PROD

UCTIO

N

Page 63: From nil to guru: intro to Ruby on Rails

“Real CI is when, after tests, every commit immediately goes

to production.”our CTO 8) @madsheep

Page 64: From nil to guru: intro to Ruby on Rails

heroku.com

$0 dev

accounts

Page 65: From nil to guru: intro to Ruby on Rails

JUNIORStake the stage(codename “I have no idea for more slides”)

Page 66: From nil to guru: intro to Ruby on Rails

TWITTER WASN’T BUILT IN A DAY

Page 67: From nil to guru: intro to Ruby on Rails

IT WAS 2 DAYS(ok, this might be a lie)

Page 68: From nil to guru: intro to Ruby on Rails

railstutorial.org

Page 69: From nil to guru: intro to Ruby on Rails

rubyrogues.com

the podcast

Page 70: From nil to guru: intro to Ruby on Rails

trug.pl

3city Ruby Users Group+ board games after party <3

Page 71: From nil to guru: intro to Ruby on Rails

RoR WORKSHOPS

by netguru.co

18-19of October

2014

Page 72: From nil to guru: intro to Ruby on Rails

HINTS for youpsst, keep it secret

use *nix#1

Page 73: From nil to guru: intro to Ruby on Rails

HINTS for youno, seriously

ask & google#2

Page 74: From nil to guru: intro to Ruby on Rails

HINTS for youyes, we can

you can do it#3

really, ask jnr devs later if you don’t believe me

Page 75: From nil to guru: intro to Ruby on Rails

netguru.co

Page 76: From nil to guru: intro to Ruby on Rails

Show notes:[email protected] hi:

bit.ly/NetguruGdansk