Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Padrino
Search
Stoyan Zhekov
June 25, 2013
Programming
0
120
Padrino
Padrino is a ruby framework built upon the Sinatra web library.
Stoyan Zhekov
June 25, 2013
Tweet
Share
More Decks by Stoyan Zhekov
See All by Stoyan Zhekov
ZeroMQ
zh
5
360
Foreman
zh
0
100
Other Decks in Programming
See All in Programming
rails_girls_is_my_gate_to_join_the_ruby_commuinty
maimux2x
0
200
Kotlin 2.0が与えるAndroid開発の進化
masayukisuda
1
390
connect-go で面倒くささと戦う / 2024-08-27 #newmo_layerx_go
izumin5210
2
640
KSPの導入・移行を前向きに検討しよう!
shxun6934
PRO
0
240
マルチモジュールにおけるテスト最適化
fxwx23
0
210
Scala アプリケーションのビルドを改善してデプロイ時間を 1/4 にした話 | How I improved the build of my Scala application and reduced deployment time by 4x
nomadblacky
1
180
Hono・Prisma・AWSでGeoなAPI開発
nokonoko1203
5
680
Amebaチョイス立ち上げの裏側 ~依存システムとの闘い~
daichi_igarashi
0
230
RAGの回答精度評価用のQAデータセットを生成AIに作らせた話
kurahara
0
250
Modular Monolith Go Server with GraphQL Federation + gRPC
110y
1
580
状態管理ライブラリZustandの導入から運用まで
k1tikurisu
3
470
仮想ファイルシステムを導入して開発環境のストレージ課題を解消する
segadevtech
2
550
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
36
1.7k
Designing with Data
zakiwarfel
98
5k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
28
1.6k
Speed Design
sergeychernyshev
22
430
Faster Mobile Websites
deanohume
304
30k
Agile that works and the tools we love
rasmusluckow
327
20k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
5
480
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
23
1.7k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.4k
The Illustrated Children's Guide to Kubernetes
chrisshort
47
48k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
103
48k
The Brand Is Dead. Long Live the Brand.
mthomps
53
38k
Transcript
Padrino the Godfather of Sinatra
Padrino the Godfather of Sinatra ?
None
None
None
Why? ͳͥͰ͔͢ʁ
Quiz ΫΠζ
SASS ?
SASS Syntactically Awesome Stylesheets
SASS
CoffeeScript ?
CoffeeScript
sprockets ?
sprockets Rack-based asset packaging
Too complicated
Simple is GOOD γϯϓϧ͕ྑ͍Ͱ͢ɻ
Data services (mobile , API) + DB backend
process by RUBY HTTP request HTTP response Data flow
Rack
def ca# ( env ) env {} [ status ,
{ headers } , [body] ] Rack = HTTP model
Rack application
RACK app Webservers Frameworks Rack
Rack tools
Rack tools
Rack tools
config.ru
Rack is GOOD !
• Renee • Presto • Hebo • RESTrack
TOO CROWDED
YARF
YARF Yet Another Rack Framework
https://github.com/zh/yarf
Sinatra
None
Sinatra
Sinatra is REAL ! ຊͰ͢ɻ http://www.sinatrarb.com/wild.html
But... ͚ͩͲɻɻɻ
None
my own link_to :confirm
Missing pieces • Generators - Gemfile, config.ru etc. • Helpers
- link_to(), image_tag() • Mailer • Admin interface - a.l.a Django ͚͍ܽͯΔ෦
Too simple is BAD ͋·Γʹγϯϓϧѱ͍Ͱ͢
Padrino gem install padrino
YARF Yet Another Rack Framework
Padrino = Sinatra++
None
Container (ίϯςφ)
Modular (Ϟδϡʔϧ)
$ padrino ...
Generators
$ padrino g project myproj
$ padrino g project myproj -s jquery -c sass -e
erb
$ padrino g project myproj -s jquery -c sass -e
erb -d activerecord -a sqlite
$ padrino g project myproj -s jquery -c sass -e
erb -d activerecord -a sqlite -t rspec -m mocha
Component Default Alias Options ORM none -d activerecord , mongoid
Renderer haml -e erb,slim Script none -s jquery, prototype Style none -c sass , less , compass Test none -t rspec, bacon Agnostic (ෆՄऀ)
Many generators • Project generator • Controller generator • Model
generator • Migration generator •Admin generator
padrino g admin
Multiple Apps by design
Interesting files • Gemfile - bundle install • config/apps.rb -
Padrino.mount( ... ).to( ... ) • config/boot.rb - logger , locale • app/app.rb - core application install
Helpers • Tags: input_tag :text, :class => ‘demo’ • Assets:
stylesheet_link_tag ‘layout’ • Format: escape_html( ) , truncate( ) • Links: link_to ... , :confirm => ‘Are you sure?’
Mailer • Configure: app/app.rb • Generate: $ pd g mailer
Sample register • [views]/mailers/sample/register.plain.erb • Deliver: deliver(:sample, :register, “foo@bar”) • Tests: set :delivery_method, :test
Simple mailer (؆୯)
Multipart Attachments
Dev Friendly • Reloader - disable :reload to stop it
• Auto load paths - lib/* • $ padrino gen | start | stop | console | rake
ຊਓ Friendly • ຊޠαΠτ - http://jp.padrino.com/ • @udzura ( Uchio
Kondo )
Padrino inside Sinatra
Helpers Routing
Mailer in Sinatra
I18n
Padrino is GOOD !
Questions? ճ