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
yhirano55
May 01, 2019
Technology
3
840
HOW TO READ HUGE OPEN SOURCE CODE EASILY
for RailsConf 2019 LT
yhirano55
May 01, 2019
Tweet
Share
More Decks by yhirano55
See All by yhirano55
カンファレンス型 技術イベントの作り方 〜Rails Developers Meetup の辿った道〜 / How to Organize a Tech Conference
yhirano55
27
6.6k
Other Decks in Technology
See All in Technology
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
140
Context Engineeringが企業で不可欠になる理由
hirosatogamo
PRO
3
610
FinTech SREのAWSサービス活用/Leveraging AWS Services in FinTech SRE
maaaato
0
130
20260204_Midosuji_Tech
takuyay0ne
1
160
顧客の言葉を、そのまま信じない勇気
yamatai1212
1
360
Frontier Agents (Kiro autonomous agent / AWS Security Agent / AWS DevOps Agent) の紹介
msysh
3
180
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
470
ファインディの横断SREがTakumi byGMOと取り組む、セキュリティと開発スピードの両立
rvirus0817
1
1.4k
Codex 5.3 と Opus 4.6 にコーポレートサイトを作らせてみた / Codex 5.3 vs Opus 4.6
ama_ch
0
170
Webhook best practices for rock solid and resilient deployments
glaforge
2
300
Embedded SREの終わりを設計する 「なんとなく」から計画的な自立支援へ
sansantech
PRO
3
2.5k
超初心者からでも大丈夫!オープンソース半導体の楽しみ方〜今こそ!オレオレチップをつくろう〜
keropiyo
0
110
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
520
Git: the NoSQL Database
bkeepers
PRO
432
66k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
83
Leo the Paperboy
mayatellez
4
1.4k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
51
Making Projects Easy
brettharned
120
6.6k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
450
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
250
We Have a Design System, Now What?
morganepeng
54
8k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
340
Navigating Team Friction
lara
192
16k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
110
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