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
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
120
FDEが実現するAI駆動経営の現在地
gonta
2
220
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
4
1.7k
광주소프트웨어마이스터고등학교 DevFest 특강 - 바이브 코딩 시대에서 주니어 개발자로 살아남는 방법
utilforever
1
150
Apache Hive: そしてCloud Native Lakehouseへ
okumin
1
170
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
230
Laravel Boostに学ぶ、AIにPHPを書かせる技術 〜OSSの実装から蒸留するエージェント制御の王道〜
kentaroutakeda
3
530
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
540
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
500
吝嗇家のためのAI活用 / AI development for miser - ChatGPT + Issue Driven Development
tooppoo
0
200
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
330
AIが無かった頃の素敵な出会いの話
codmoninc
1
220
Featured
See All Featured
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
380
Bash Introduction
62gerente
615
220k
HDC tutorial
michielstock
2
750
Into the Great Unknown - MozCon
thekraken
41
2.6k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.3k
The Spectacular Lies of Maps
axbom
PRO
1
870
Code Reviewing Like a Champion
maltzj
528
40k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.2k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
980
Building Applications with DynamoDB
mza
96
7.1k
For a Future-Friendly Web
brad_frost
183
10k
Embracing the Ebb and Flow
colly
88
5.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