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
410
Foreman
zh
0
110
Other Decks in Programming
See All in Programming
Fluid Templating in TYPO3 14
s2b
0
130
CSC307 Lecture 07
javiergs
PRO
0
550
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6k
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
550
Basic Architectures
denyspoltorak
0
660
組織で育むオブザーバビリティ
ryota_hnk
0
170
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
450
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
170
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
970
今から始めるClaude Code超入門
448jp
8
8.5k
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
160
Fragmented Architectures
denyspoltorak
0
150
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
Navigating Weather and Climate Data
rabernat
0
100
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
Prompt Engineering for Job Search
mfonobong
0
160
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
55
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
62
My Coaching Mixtape
mlcsv
0
46
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
580
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? ճ