otomodachi-kakumei

31
Rails ダークサイドに落ちた人のための Sinatra with Padrino presentation by Uchio Kondo ( @udzura, おともだち革命)

Upload: uchio-kondo

Post on 12-Nov-2014

3.282 views

Category:

Spiritual


1 download

DESCRIPTION

at RubyKaigi of darkness @ nerima 2011 summer. Friendship Revolutions. "Sinatra&Padrino for people caught in darkside on Rails"

TRANSCRIPT

Page 1: otomodachi-kakumei

Rails ダークサイドに落ちた人のための

Sinatra with Padrino

presentation by Uchio Kondo ( @udzura, おともだち革命)

Page 2: otomodachi-kakumei

発表者

近藤うちお (@udzura) http://udzura.jp ( 最近整理整頓した ) Ruby, ちょっと Groovy,TDD,aptitude が好き 富士山マガジンサービス (http://fujisan.co.jp) おともだち革命

よく考えたら人生において LT 初めてです!

This is the first LT for *Kaigi in my life!!!

Page 3: otomodachi-kakumei

Given:

Ruby 好き / 使いたい Web 好き ウェッブサ~ビスを何か作りたいな~

You want to use Ruby,You love web.So you want to create some webservices.

Page 4: otomodachi-kakumei

Ruby on Rails ?

Page 5: otomodachi-kakumei

Rails か~~

敢えて言おう、重い スピンアップとか Passenger のスピンアップとか

I dare say, it's too heavy!Especially on spin-up, spin-up with passenger,,,, etc.

Page 6: otomodachi-kakumei

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.

Page 7: otomodachi-kakumei

Darkside on Rails

Page 8: otomodachi-kakumei

じゃあ Rails 以外?

Camping → ドキュメントと実績が…… Ramaze → ドキュメントと実績が……

Camping, Ramaze, both are very good, but have few documents and few achievements

※ 前提として、両者とも素晴らしい  フレームワークなんですよ?

Page 9: otomodachi-kakumei

Sinatra?

だんだん使われてきましたね ドキュメントも増えた方

Gihyo さん : http://gihyo.jp/dev/serial/01/ruby/0042 実績も増えた方

「電書部」 : http://gihyo.jp/dev/serial/01/ebook-distribution-server

その他個人ウェッブサ~ビスにちらほらと

Increasing users,Documents,Achievements.

Page 10: otomodachi-kakumei

なにより

Sinatra is a nice DSL

Page 11: otomodachi-kakumei

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?

Page 12: otomodachi-kakumei
Page 13: otomodachi-kakumei

Padrino is the godfather of Sinatra

In README...

Page 14: otomodachi-kakumei

Padrino is the godfather of Sinatra

Jedi Master

Page 15: otomodachi-kakumei

Padrino family

padrino-core padrino-helpers padrino-mailer padrino-cache padrino-gen padrino-admin

Page 16: otomodachi-kakumei

Padrino-Core

Padrino の基本機能 以下が入っている感じがする

コマンドラインツール リローダ ロガー ルーティング拡張 (Padrino::Routing) render 拡張 (Padrino::Rendering)

Core functions.CLI tool,Reloader,Logger,Routing extensions,Renderer extensions

Page 17: otomodachi-kakumei

Padrino-Helpers

Rails 風ヘルパー + α 使い方 :

普通の Sinatra アプリに組み込めます

Rails-like helper.You can add this featureTo simple sinatra app.

Page 18: otomodachi-kakumei

大事なので二回言います

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!

Page 19: otomodachi-kakumei

先ほどのルーティング拡張も

使えます。

Page 20: otomodachi-kakumei

Padrino-Mailer

Sinatra っぽく書けるメーラー

Sinatra-izedmailer

Page 21: otomodachi-kakumei

Padrino-Cache

ページキャッシュも、フラグメントも、あるんだよ There are a page caching, and a fragment caching

Page 22: otomodachi-kakumei

Padrino-Gen

ジェネレ~タ これは、フルスタックの時しか使えない…

Components generatorJust available inFull-stack padrino...

Page 23: otomodachi-kakumei

Padrino-Admin

管理画面自動生成機能 (Django 風 ) 認証 + アクセスコントロール Scaffold

Admin page generator,Like Django.Authentication, access controll, and scaffolding

Page 24: otomodachi-kakumei

Other features サブアプリケーション機能とか そもそも、いろんな  ORM/ テンプレエンジン / テストフレームワーク

を選べるところとか Agnostic なので、アップグレードも比較的楽

Sub-applications like Django,Being agnostic in ORM / Template / Testing framework, anything!Upgrading is easy because padrino is agnostic

Page 25: otomodachi-kakumei

と言うか、軽量だし

It is lightweight,guys.

Page 26: otomodachi-kakumei

改めて Sinatra の良いところ

軽量(アプリ自体もコードも) 機能を削り、 Rack に準拠することで得た柔軟さ (use と register)

すっごい「スモールスタート」感 楽しい

Lightweight(performance, codebase)Flexibility by small functionalityand rack-based architecture

We feel it ”small-start” and have fun

Page 27: otomodachi-kakumei

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.

Page 28: otomodachi-kakumei

More info......

http://jp.padrinorb.com/

English: http://www.padrinorb.com/

Page 29: otomodachi-kakumei

More info......

http://jp.padrinorb.com/公式メンテナーです!共同翻訳者募集中

I'm a official maintainer of ”jp.padrinorb.com”, so i want volunteers for translations!

Page 30: otomodachi-kakumei

総括

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!

Page 31: otomodachi-kakumei

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