Переходим на Ruby

ВСЕ ХИПСТЕРЫ УШЛИ НА:
Scala
Node.js
Clojure
Erlang!!!
Ну а почему я кайфую от Ruby?
- Деньги
- Слава
- Женщины
Простой и лаконичный синтаксис.
Ура! Можно писать без скобочек!
Долой Циклы, даешь итераторы и блоки!
КлассныЕ классы И объекты!

Лямбдочки
в PHP только недавно появилось
$x = function($season){ echo "$season is coming"; }
$x('winter');
Можно создавать и переоПредЕлять любые методы
RubyGEMS
53.000 библиотек
Почитать по языку
Флэнаган Д., Мацумото Ю.
"Язык программирования Ruby"
Ruby != RAILS

Как начать?
windows
linux
macos
Vagrant

+
RailsInstaller
http://railsinstaller.org/
Но это все МРАК!
Только *nix!
Только хардкор!
Что есть в Sinatra?
Routing
get '/hello/:name' do
"Hi, " + params[:name]
end
Cookies
set_cookie 'name', params[:name]
Sessions
enable :sessions
session[:name] = 'Khal'
enable :sessions
name = session[:name]
Views/Templates
get '/' do
erb :index
end
__END__
@@layout
<%= yield %>!!!
@@index
in the Woods
И все что душе угодно!
http://www.sinatrarb.com/intro.html
и отличная книга
Sinatra Up and Running от Алана Харриса и Константина Хаасе
Есть ЧЕ?
- CoC, DRY
- MVC (Slim Controller, Fat Model)
- Routing (Nested Routes, REST)
- ActiveRecord (has_many, :polymorfic)
- Migrations (env)
- Scaffolding (REST)
- I18n (YML)
- Tests (RSpec, Capybara)
- Rails console (pry)
- Generators
- Gems (Bundler, RVM Gemsets)
- Servers (Webrick, Mongrel, Thin, Unicorn, Puma)
ТЫ ПРНС?
http://guides.rubyonrails.org && http://rusrails.ru
Хартл - http://russian.railstutorial.org/chapters/beginning
http://railsforzombies.org
"Learning Rails 3"Edd Dumbill, Eric J Gruber, Simon St. Laurent
Agile Web Development with Rails (4th edition)Sam Ruby, Dave Thomas, David Heinemeier Hansson
http://programming-motherfucker.com
They Claim To Value
They Really Value
We Fucking Do
Individuals and interactions
Tons of billable hours
Programming, Motherfucker
Working software
Tons of pointless tests
Programming, Motherfucker
Customer collaboration
Bleeding clients dry
Programming, Motherfucker
Responding to change
Instability and plausible deniability
Programming, Motherfucker