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
Sinatra: My Way
Search
Matthew Conway
July 19, 2012
Programming
1.1k
8
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Sinatra: My Way
How I'm using Sinatra: structure and useful scripts
Matthew Conway
July 19, 2012
More Decks by Matthew Conway
See All by Matthew Conway
Building Heroku Add-ons
mattonrails
2
770
Other Decks in Programming
See All in Programming
3Dシーンの圧縮
fadis
1
770
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
490
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
540
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
160
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
320
ふつうのFeature Flag実践入門
irof
7
3.9k
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
2
680
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
130
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
250
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.3k
OSもどきOS
arkw
0
560
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
340
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
77
5.4k
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
Embracing the Ebb and Flow
colly
88
5.1k
A better future with KSS
kneath
240
18k
The Invisible Side of Design
smashingmag
302
52k
Context Engineering - Making Every Token Count
addyosmani
9
960
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
Deep Space Network (abreviated)
tonyrice
0
170
ラッコキーワード サービス紹介資料
rakko
1
3.6M
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
Scaling GitHub
holman
464
140k
Transcript
SINATRA my way
MATTHEW CONWAY @mattonrails
what is this? why am i here?
we’re going to learn you some standards! sinatra: you’re great.
but
we’re going to learn you some standards! sinatra: you’re great.
but (yeah, don’t tell him i said that)
to avoid confusion, we need to make some rules...
not ‘all the time’ rules, but within an application
ring-a ding-ding
you need... more structure handy scripts
so... we’re doin it your way?
(frank’s a smart guy)
STRUCTURE
classic style modular style not
the simple app
Gemfile Procfile app.rb config.ru script/
# Gemfile source :rubygems gem ‘sinatra’ gem ‘foreman’ gem ‘unicorn’
group :development do gem ‘shotgun’ gem ‘thin’ end
# Procfile web: bundle exec unicorn --port $PORT
# app.rb module Haiku class App < Sinatra::Base get ‘/’
do @haiku = Redis.srandmember(‘haiku’) haml :home end ... end end
# config.ru require ‘./app’ run Haiku::App
as it grows
Gemfile Procfile Rakefile app/ config/ config.ru db/ script/
Com Fl With M ...or collaborate with me ...or something
where do I start?
is bundler installed? do i have the required ruby? o
noes imagemagick! forgot to migrate... nice of you to mention those environment variables I apparently need to set yum install all --the --things brew uninstall patience mysqladmin -u wizard create blawg_development
None
script/bootstrap
“Never send a README to do a setup script’s job.”
@trek Trek Glowacki
script/bootstrap dependency checks bundler database setup does your job
HOW IS SINATRA SERVER FORMED?* * http://cl.ly/ICAy
ruby le_app.rb rackup -p 5000 thin --rackup config.ru start shotgun
-p 5000 bieber_site.rb
None
script/server
look familiar?
script/console
BONUS!
know how to get a console to sinatra on heroku?
maybe that’s a trick question
maybe that’s a trick question (since it depends)
heroku run script/console
now you can!
IN SUMMARY
Furthe Reading
Sinatra: Up and Running Alan Harris Konstantin Haase
YOU develop your own conventions for building sinatra apps share
them with the community
Thanks!
Asap, Omnibus Type Lavenderi , Lost Typ Menlo