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
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
170
Hex Core
wojtekmach
0
170
Recurrences & Intervals
wojtekmach
2
510
Building an Umbrella Project
wojtekmach
21
6.1k
Advanced OOP in Elixir
wojtekmach
6
680
OOP in Elixir
wojtekmach
4
320
Pattern Matching
wojtekmach
1
330
Other Decks in Programming
See All in Programming
技術的負債解消で開発者の未来を開く- AIの力でコード刷新
kmd2kmd
0
120
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
130
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.5k
Signal Forms: Details & Live Coding @enterJS 2026 in Mannheim
manfredsteyer
PRO
0
200
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
180
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
280
Inside Stream API
skrb
1
810
Vite+ Unified Toolchain for the Web
naokihaba
0
370
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
610
Creating Composable Callables in Contemporary C++
rollbear
0
170
JavaDoc 再入門
nagise
1
430
Featured
See All Featured
Music & Morning Musume
bryan
47
7.3k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
Designing for humans not robots
tammielis
254
26k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
170
RailsConf 2023
tenderlove
30
1.5k
Typedesign – Prime Four
hannesfritz
42
3.1k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
380
Context Engineering - Making Every Token Count
addyosmani
9
990
A Soul's Torment
seathinner
6
3k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.5k
Evolving SEO for Evolving Search Engines
ryanjones
0
230
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
380
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