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
130
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
150
Hex Core
wojtekmach
0
150
Recurrences & Intervals
wojtekmach
2
470
Building an Umbrella Project
wojtekmach
21
6k
Advanced OOP in Elixir
wojtekmach
6
670
OOP in Elixir
wojtekmach
4
300
Pattern Matching
wojtekmach
1
310
Other Decks in Programming
See All in Programming
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
Package Management Learnings from Homebrew
mikemcquaid
0
210
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
140
「ブロックテーマでは再現できない」は本当か?
inc2734
0
930
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
190
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
3.8k
CSC307 Lecture 07
javiergs
PRO
0
550
Data-Centric Kaggle
isax1015
2
770
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
5
400
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
420
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
160
MUSUBIXとは
nahisaho
0
130
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Documentation Writing (for coders)
carmenintech
77
5.2k
Building Adaptive Systems
keathley
44
2.9k
The SEO Collaboration Effect
kristinabergwall1
0
350
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
140
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
99
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
30 Presentation Tips
portentint
PRO
1
210
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Embracing the Ebb and Flow
colly
88
5k
Thoughts on Productivity
jonyablonski
74
5k
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