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
Formatting ruby code
Search
Wojtek Mach
April 16, 2014
Programming
0
120
Formatting ruby code
Wojtek Mach
April 16, 2014
Tweet
Share
More Decks by Wojtek Mach
See All by Wojtek Mach
Writing an Ecto Adapter: Introducing MyXQL
wojtekmach
1
140
Hex Core
wojtekmach
0
140
Recurrences & Intervals
wojtekmach
2
470
Building an Umbrella Project
wojtekmach
21
5.9k
Advanced OOP in Elixir
wojtekmach
6
660
OOP in Elixir
wojtekmach
4
300
Pattern Matching
wojtekmach
1
310
Other Decks in Programming
See All in Programming
イベントストーミングのはじめかた / Getting Started with Event Storming
nrslib
1
650
2026年向け会社紹介資料
misu
0
250
Duke on CRaC with Jakarta EE
ivargrimstad
0
130
Amazon Bedrock Knowledge Bases Hands-on
konny0311
0
150
FlutterKaigi 2025 システム裏側
yumnumm
0
1.1k
Flutterチームから作る組織の越境文化
findy_eventslides
0
520
Atomics APIを知る / Understanding Atomics API
ssssota
1
150
AI 時代だからこそ抑えたい「価値のある」PHP ユニットテストを書く技術 #phpconfuk / phpcon-fukuoka-2025
shogogg
1
570
Evolving NEWT’s TypeScript Backend for the AI-Driven Era
xpromx
0
120
Feature Flags Suck! - KubeCon Atlanta 2025
phodgson
0
150
The Missing Link in Angular's Signal Story: Resource API and httpResource
manfredsteyer
PRO
0
140
全員アーキテクトで挑む、 巨大で高密度なドメインの紐解き方
agatan
5
6.2k
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
340
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
Done Done
chrislema
186
16k
The Cult of Friendly URLs
andyhume
79
6.7k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
54k
Stop Working from a Prison Cell
hatefulcrawdad
272
21k
Transcript
Formatting Ruby Code
4 rules of simple design (Kent Beck) 1. All tests
pass 2. No duplicate code 3. Express all the ideas 4. Minimize classes and methods
4 rules of simple design (Kent Beck) 1. All tests
pass 2. No duplicate code 3. Express all the ideas 4. Minimize classes and methods 0. Code is properly formatted
Styleguides • https://github.com/bbatsov/ruby-style-guide • https://github.com/styleguide/ruby • etc
Styleguides
Styleguides • Styleguides are great, but...
Styleguides • Styleguides are great, but… • “Hey, can you
format code according to …”?
Go
Go • Go doesn’t have styleguides
Go • Go doesn’t have styleguides • gofmt a.go
rubyfmt
Parsing ruby code
Parsing ruby code https://github.com/seattlerb/ruby_parser
Parsing ruby code https://github.com/seattlerb/ruby2ruby
Diff
None
https://github.com/wojtekmach/rubyfmtbot
Thanks! • http://golang.org/cmd/gofmt • https://github.com/seattlerb/ruby_parser • https://github.com/seattlerb/sexp_processor • https://github.com/seattlerb/ruby2ruby •
https://github.com/wojtekmach/rubyfmt • https://github.com/wojtekmach/rubyfmtbot