otomodachi-kakumei
DESCRIPTION
at RubyKaigi of darkness @ nerima 2011 summer. Friendship Revolutions. "Sinatra&Padrino for people caught in darkside on Rails"TRANSCRIPT
Rails ダークサイドに落ちた人のための
Sinatra with Padrino
presentation by Uchio Kondo ( @udzura, おともだち革命)
発表者
近藤うちお (@udzura) http://udzura.jp ( 最近整理整頓した ) Ruby, ちょっと Groovy,TDD,aptitude が好き 富士山マガジンサービス (http://fujisan.co.jp) おともだち革命
よく考えたら人生において LT 初めてです!
This is the first LT for *Kaigi in my life!!!
Given:
Ruby 好き / 使いたい Web 好き ウェッブサ~ビスを何か作りたいな~
You want to use Ruby,You love web.So you want to create some webservices.
Ruby on Rails ?
Rails か~~
敢えて言おう、重い スピンアップとか Passenger のスピンアップとか
I dare say, it's too heavy!Especially on spin-up, spin-up with passenger,,,, etc.
Rails ~~~~
機能は多いけど、大掛かり…… たくさんの規約 たくさんの File 1 画面追加のために、 controller とroutes.rb をいじるぞ~~~
It is useful, but grandiose.Many constitusion, many files.You should modify controller & routes.rb just to add 1 page.
Darkside on Rails
じゃあ Rails 以外?
Camping → ドキュメントと実績が…… Ramaze → ドキュメントと実績が……
Camping, Ramaze, both are very good, but have few documents and few achievements
※ 前提として、両者とも素晴らしい フレームワークなんですよ?
Sinatra?
だんだん使われてきましたね ドキュメントも増えた方
Gihyo さん : http://gihyo.jp/dev/serial/01/ruby/0042 実績も増えた方
「電書部」 : http://gihyo.jp/dev/serial/01/ebook-distribution-server
その他個人ウェッブサ~ビスにちらほらと
Increasing users,Documents,Achievements.
なにより
Sinatra is a nice DSL
Sinatra か~~~
Sinatra DSLは、いわゆる MVCの Cのみ tilt ……はできたが、ヘルパーが無い
public 、 viewの置き場所とか規約を自分で考……えなきゃ
…… キャッシュとかどうすんだ Rack::Cacheはいいけど、フラグメントキャッシュしたいし、自作?
Sinatra DSL just owns controller, and no built-in helper although tilt is released.Constitutions must be DIY(view/public dir),and caching might be a little poor Rack::Cache, or DIY?
Padrino is the godfather of Sinatra
In README...
Padrino is the godfather of Sinatra
Jedi Master
Padrino family
padrino-core padrino-helpers padrino-mailer padrino-cache padrino-gen padrino-admin
Padrino-Core
Padrino の基本機能 以下が入っている感じがする
コマンドラインツール リローダ ロガー ルーティング拡張 (Padrino::Routing) render 拡張 (Padrino::Rendering)
Core functions.CLI tool,Reloader,Logger,Routing extensions,Renderer extensions
Padrino-Helpers
Rails 風ヘルパー + α 使い方 :
普通の Sinatra アプリに組み込めます
Rails-like helper.You can add this featureTo simple sinatra app.
大事なので二回言います
Padrino は、フルスタックフレームワークですが。
Padrino のコンポーネントは、 Sinatra アプリケーションに、 一部機能だけを register して使えます。
IT'S A IMPORTANT FEATURE!You can CHERRY-PICK a padrino component from basically full-stack padrinoAnd register it to your simple Sinatra application!
先ほどのルーティング拡張も
使えます。
Padrino-Mailer
Sinatra っぽく書けるメーラー
Sinatra-izedmailer
Padrino-Cache
ページキャッシュも、フラグメントも、あるんだよ There are a page caching, and a fragment caching
Padrino-Gen
ジェネレ~タ これは、フルスタックの時しか使えない…
Components generatorJust available inFull-stack padrino...
Padrino-Admin
管理画面自動生成機能 (Django 風 ) 認証 + アクセスコントロール Scaffold
Admin page generator,Like Django.Authentication, access controll, and scaffolding
Other features サブアプリケーション機能とか そもそも、いろんな ORM/ テンプレエンジン / テストフレームワーク
を選べるところとか Agnostic なので、アップグレードも比較的楽
Sub-applications like Django,Being agnostic in ORM / Template / Testing framework, anything!Upgrading is easy because padrino is agnostic
と言うか、軽量だし
It is lightweight,guys.
改めて Sinatra の良いところ
軽量(アプリ自体もコードも) 機能を削り、 Rack に準拠することで得た柔軟さ (use と register)
すっごい「スモールスタート」感 楽しい
Lightweight(performance, codebase)Flexibility by small functionalityand rack-based architecture
We feel it ”small-start” and have fun
Padrino は、
そういう Sinatra の良さとスモールスタート感を減じないように設計されています!
必要な機能だけ使える 必要ないと思った機能は使わなくてよい (!)
Padrino is designed over the Sinatra principle, and enhances its good parts!You can use functionalities that you think necessary,or you can AVOID the functionalities that you think unnecessary.
More info......
http://jp.padrinorb.com/
English: http://www.padrinorb.com/
More info......
http://jp.padrinorb.com/公式メンテナーです!共同翻訳者募集中
I'm a official maintainer of ”jp.padrinorb.com”, so i want volunteers for translations!
総括
Sinatra is nice Padrino は、 Sinatra での開発を全力でサポートします。極小規模から中規模、大規模開発に!
一部機能だけでも使えるので、お手軽に試せますね!
Sinatra is cool, and Padrino completely support you to enjoy Sinatra! In any case (a very simple app, middle-size apps, huge apps!)You can cherry-pick padrino features, so feel free to try!
EOF
Sinatra is nice! Rails is not an only product for Ruby! Let's try Sinatra & Padrino!
Thank you!!!
Special thanks: おともだち革命The Friendship Revolution, a sky-scape which is fish