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
HOW TO READ HUGE OPEN SOURCE CODE EASILY
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
yhirano55
May 01, 2019
Technology
860
3
Share
HOW TO READ HUGE OPEN SOURCE CODE EASILY
for RailsConf 2019 LT
yhirano55
May 01, 2019
More Decks by yhirano55
See All by yhirano55
カンファレンス型 技術イベントの作り方 〜Rails Developers Meetup の辿った道〜 / How to Organize a Tech Conference
yhirano55
27
6.7k
Other Decks in Technology
See All in Technology
"SQLは書けません"から始まる データドリブン
kubell_hr
2
470
Azure Static Web Apps の自動ビルドがタイムアウトしやすくなった状況に対応した件/global-azure2026
thara0402
0
370
目的ファーストのハーネス設計 ~ハーネスの変更容易性を高めるための優先順位~
gotalab555
8
2k
AI時代のガードレールとしてのAPIガバナンス
nagix
0
210
クラウドネイティブな開発 ~ 認知負荷に立ち向かうためのコンテナ活用
literalice
0
110
ハーネスエンジニアリングをやりすぎた話 ~そのハーネスは解体された~
gotalab555
3
1.2k
生成AI時代のエンジニア育成 変わる時代と変わらないコト
starfish719
0
9.7k
新メンバーのために、シニアエンジニアが環境を作る時代
puku0x
0
1.1k
え!?初参加で 300冊以上 も頒布!? これは大成功!そのはずなのに わいの財布は 赤字 の件
hellohazime
0
160
Claude Code を安全に使おう勉強会 / Claude Code Security Basics
masahirokawahara
2
21k
「責任あるAIエージェント」こそ自社で開発しよう!
minorun365
9
1.7k
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.3k
Featured
See All Featured
Unsuck your backbone
ammeep
672
58k
HDC tutorial
michielstock
2
620
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
680
Utilizing Notion as your number one productivity tool
mfonobong
4
290
Become a Pro
speakerdeck
PRO
31
5.9k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
A designer walks into a library…
pauljervisheath
211
24k
Transcript
HOW TO READ HUGE OPEN SOURCE CODE EASILY @yhirano55 at
RailsConf 2019
self.inspect ➤Yoshiyuki Hirano from JAPAN ➤GitHub: @yhirano55 ➤Twitter: @yoshi_hirano ➤Rails
Contributors #62 ➤I’m chief organizer of “Railsdm” ➤I love Rails community
Have you ever read Ruby on Rails source code?
MORE QUESTIONS ➤Do you know the request/response Lifecycle of Rails
application? ➤Do you know the steps of Active Record's create, update, validate, and destroy? ➤Do you know the processing of initialization of Rails application?
I do not think many of them actually do
To tell the truth,
I have not, too
I guess we don't have much time and patience
Yesterday, I was impressed by Skylight’s sponsor talk. The design
of the rack application is really elegant
AND.. ➤I want to read the code of its lifecycle
of Rails application ➤But I don't want to spend much time to trace the code ➤I want to read source code easily. What would you do?
Finally, I've shipped a new RubyGem this morning
yhirano55/trace_location
DEMO
At first, boot rails console, and set request env
And execute `Rails.application.call(env)` inside `TraceLocation.trace` block
Then it generates a log file
It’s traced locations about `Rails.application.call(env)`
It’s traced locations about `Rails.application.call(env)` CALL on rails/engine.rb:522 #call
It’s traced locations about `Rails.application.call(env)` CALL on rails/application.rb:607 #build_request
It helps you can get tracing the processing of the
Lifecycle of Rails application easily!!
HOW IT WORK? ➤Use TracePoint that is a Ruby standard
API ➤TracePoint API is one of the BLACK MAGIC in Ruby
IMPLEMENTATION This is TracePoint
IMPLEMENTATION Collect logs
IMPLEMENTATION Trace events while block call And disable when it
finished
In making this gem, I used TracePoint for the first
time. It makes me really feel so good!!
It helps you get deeply understanding Ruby on Rails
It's my pleasure to help you enjoy Ruby on Rails
self.inspect ➤Yoshiyuki Hirano from JAPAN ➤GitHub: @yhirano55 ➤Twitter: @yoshi_hirano ➤Rails
Contributors #62 ➤I’m chief organizer of “Railsdm” ➤I love Rails community
We’re going to have a new Ruby on Rails conference
The name is…
RailsKaigi 2020
We hope you join RailsKaigi 2020 in Japan
yhirano55/trace_location Thank you so much