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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Wojtek Mach
April 16, 2014
Programming
140
0
Share
Formatting ruby code
Wojtek Mach
April 16, 2014
More Decks by Wojtek Mach
See All by Wojtek Mach
Writing an Ecto Adapter: Introducing MyXQL
wojtekmach
1
160
Hex Core
wojtekmach
0
160
Recurrences & Intervals
wojtekmach
2
490
Building an Umbrella Project
wojtekmach
21
6.1k
Advanced OOP in Elixir
wojtekmach
6
670
OOP in Elixir
wojtekmach
4
310
Pattern Matching
wojtekmach
1
320
Other Decks in Programming
See All in Programming
アーキテクチャモダナイゼーションとは何か
nwiizo
19
5.5k
The Less-Told Story of Socket Timeouts
coe401_
3
670
決定論 vs 確率論:Gemini 3 FlashとTF-IDFを組み合わせた「法規判定エンジン」の構築
shukob
0
130
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
790
Vibe NLP for Applied NLP
inesmontani
PRO
0
500
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
190
10年分の技術的負債、完済へ ― Claude Code主導のAI駆動開発でスポーツブルを丸ごとリプレイスした話
takuya_houshima
0
2.7k
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
3
810
属人化しないコード品質の作り方_2026.04.07.pdf
muraaano
0
260
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
810
t *testing.T は どこからやってくるの?
otakakot
1
790
Offline should be the norm: building local-first apps with CRDTs & Kotlin Multiplatform
renaudmathieu
0
230
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
6.1k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
180
Crafting Experiences
bethany
1
120
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
280
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
120
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
150
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
140
For a Future-Friendly Web
brad_frost
183
10k
New Earth Scene 8
popppiees
3
2.1k
Balancing Empowerment & Direction
lara
6
1.1k
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