Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
150
Hex Core
wojtekmach
0
140
Recurrences & Intervals
wojtekmach
2
470
Building an Umbrella Project
wojtekmach
21
6k
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
React Native New Architecture 移行実践報告
taminif
1
150
生成AIを利用するだけでなく、投資できる組織へ
pospome
1
250
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
120
CSC509 Lecture 14
javiergs
PRO
0
220
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
9
1.1k
STYLE
koic
0
160
全員アーキテクトで挑む、 巨大で高密度なドメインの紐解き方
agatan
8
20k
【Streamlit x Snowflake】データ基盤からアプリ開発・AI活用まで、すべてをSnowflake内で実現
ayumu_yamaguchi
1
120
ID管理機能開発の裏側 高速にSaaS連携を実現したチームのAI活用編
atzzcokek
0
210
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
2
660
認証・認可の基本を学ぼう後編
kouyuume
0
180
AWS CDKの推しポイントN選
akihisaikeda
1
240
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Git: the NoSQL Database
bkeepers
PRO
432
66k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Producing Creativity
orderedlist
PRO
348
40k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Into the Great Unknown - MozCon
thekraken
40
2.2k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
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