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
Webmachine (Ruby)
Search
Paweł Pacana
March 12, 2013
Programming
1
250
Webmachine (Ruby)
presented on KRUG
Paweł Pacana
March 12, 2013
Tweet
Share
More Decks by Paweł Pacana
See All by Paweł Pacana
DRUG Facts
pawelpacana
2
230
Other Decks in Programming
See All in Programming
WebComponentsで フレームワークを1ページに共存させる
webuilder240
0
150
オブジェクト指向は必要なのか / Is object-oriented needed?
kishida
27
19k
Ruby製社内ツールのGo移行
bgpat
2
270
Deno に Web 標準 API を実装する / Implementing Web Standard API to Deno
petamoriken
0
350
複雑なドメインを扱うプロダクトの探索フェーズではいつどのようにテストをするのか / How to testing during exploratory phase
boykush
2
150
イベントストーミングによるオブジェクトモデリング・オブジェクト指向プログラミングの適用・開発プロセスの変遷・アーキテクチャの変革 / Object modeling with Event Storming.
nrslib
12
3.2k
両面どころかインフラもTSでできるよ ~ 全方位TypeScriptによるプロダクト開発 ~
myfinder
9
2.5k
Data Contracts In Practice With Debezium and Apache Flink (Kafka Summit London)
gunnarmorling
2
280
コミュニティに参加したことで起きた変化
ohmori_yusuke
3
130
Honoとhtmx
yusukebe
6
1.2k
Material 3で Material 2ぽい見た目にする
numeroanddev
2
250
Creating Retro-Style Photos Using Swift
ski
1
360
Featured
See All Featured
Designing for Performance
lara
601
67k
What’s in a name? Adding method to the madness
productmarketing
PRO
14
2.6k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
185
15k
Building Flexible Design Systems
yeseniaperezcruz
317
37k
We Have a Design System, Now What?
morganepeng
42
6.7k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
219
21k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
Reflections from 52 weeks, 52 projects
jeffersonlam
343
19k
Producing Creativity
orderedlist
PRO
335
39k
Raft: Consensus for Rubyists
vanstee
130
6.2k
Side Projects
sachag
451
41k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
14
1.3k
Transcript
WEBMACHINE THE HTTP TOOLKIT IN RUBY @pawelpacana
I’m not a native speaker DISCLAIMER
HTTP 1.1 SPEC RFC2616
TOOLKIT • „A toolkit for easily creating well- behaved HTTP
applications” • not a framework • Sinatra vs. Rails • extracted from Riak
RACK INTERFACE app = proc { |env| [ 200, #
Status {'Content-Type' => 'text/plain'}, # Headers ["Hello World!"] # Body ] }
RACK MIDDLEWARE • Head, ContentLength, ContentType, Deflater, …
HTTP IS HARD
WEBMACHINE • FSM modelling HTTP • negotiate hard decisions transparently
HTTP IS RESOURCES • data or service • identified by
URI • representations
WEBMACHINE • resources as a core building block • declare
resources, don’t perform actions • resource callbacks
EXAMPLES show me the code
ADAPTERS • WEBrick • Mongrel • Rack* • Reel •
Hatetepe
ECOSYSTEM • webmachine-test • webmachine-linking • webmachine-actionview • webmachine-sprockets •
irwebmachine
MY OBSERVATIONS • good as HTTP content delivery mechanism in
Ports and Adapters architecture • good for Hypermedia APIs • small enough to read and trust it
GOING DEEPER http://bit.ly/resources-for-real-this-time
THANK YOU @pawelpacana
DRUG #40 NEXT MONDAY 19:00 http://drug.org.pl