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
4
400
Foreman
zh
0
110
Other Decks in Programming
See All in Programming
SODA - FACT BOOK(JP)
sodainc
1
9.1k
Blazing Fast UI Development with Compose Hot Reload (Bangladesh KUG, October 2025)
zsmb
2
440
CSC509 Lecture 08
javiergs
PRO
0
270
三者三様 宣言的UI
kkagurazaka
0
330
Vueのバリデーション、結局どれを選べばいい? ― 自作バリデーションの限界と、脱却までの道のり ― / Which Vue Validation Library Should We Really Use? The Limits of Self-Made Validation and How I Finally Moved On
neginasu
3
1.8k
ALL CODE BASE ARE BELONG TO STUDY
uzulla
29
6.9k
Go言語はstack overflowの夢を見るか?
logica0419
1
680
Module Proxyのマニアックな話 / Niche Topics in Module Proxy
kuro_kurorrr
0
1.1k
エンジニアインターン「Treasure」とHonoの2年、そして未来へ / Our Journey with Hono Two Years at Treasure and Beyond
carta_engineering
0
480
AI時代に必須!状況言語化スキル / ai-context-verbalization
minodriven
2
290
CSC509 Lecture 09
javiergs
PRO
0
280
Amazon ECS Managed Instances が リリースされた!キャッチアップしよう!! / Let's catch up Amazon ECS Managed Instances
cocoeyes02
0
120
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
650
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.1k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Documentation Writing (for coders)
carmenintech
76
5.1k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
Leading Effective Engineering Teams in the AI Era
addyosmani
7
700
Bash Introduction
62gerente
615
210k
Code Reviewing Like a Champion
maltzj
526
40k
For a Future-Friendly Web
brad_frost
180
10k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6k
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? ճ