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
880
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
Bucharest Tech Week 2026 - Guardians of the Cloud-Native Galaxy
edeandrea
PRO
0
130
マルチアカウント環境での コーディングエージェントを使った障害調査が大変なので AIエージェントにReadOnly権限を付与してみた / ReadOnly AI Agents for Multi-Account AWS Incident Response
yamaguchitk333
2
110
自分が詳しくない領域でAIを使う #プロヒス2026
konifar
17
5.9k
「勝手に広まる」人気 AI エージェントを爆速で作ろう!(AWS Summit Japan 2026講演資料)
minorun365
PRO
10
2k
AIチャット検索改善の3週間
kworkdev
PRO
2
140
2026TECHFRESH畢業分享會 - Lightning Talk - E起 See See : 電商推薦讀心術? 數據說了算
line_developers_tw
PRO
0
1.3k
LayerXにおけるセキュリティ管理の現在地と次の一手
tosho
0
250
MUSUBI 田中裕一『AIと共に行う「しごとのリデザイン」- スモールバックオフィス編』AI Ops Lab #4
musubi
0
280
エラーバジェットのアラートのタイミングを考える.pdf
kairim0
0
180
不要なレビューをAIにまかせて AIコーディングの環境改善を加速した
shoota
1
230
SONiCのLinuxベースを活かしたZabbix監視
sonic
0
230
インシデントレスポンス演習 I / Incident Response Exercise I
ks91
PRO
0
100
Featured
See All Featured
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
180
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
230
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
140
Site-Speed That Sticks
csswizardry
13
1.2k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
Writing Fast Ruby
sferik
630
63k
A better future with KSS
kneath
240
18k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.1k
From π to Pie charts
rasagy
0
210
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