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
750
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
6k
Other Decks in Technology
See All in Technology
20250116_自部署内でAmazon Nova体験会をやってみた話
riz3f7
1
100
Alignment and Autonomy in Cybozu - 300人の開発組織でアラインメントと自律性を両立させるアジャイルな組織運営 / RSGT2025
ama_ch
1
2.4k
技術に触れたり、顔を出そう
maruto
1
150
テストを書かないためのテスト/ Tests for not writing tests
sinsoku
1
170
【Oracle Cloud ウェビナー】2025年のセキュリティ脅威を読み解く:リスクに備えるためのレジリエンスとデータ保護
oracle4engineer
PRO
1
100
Evolving Architecture
rainerhahnekamp
3
250
月間60万ユーザーを抱える 個人開発サービス「Walica」の 技術スタック変遷
miyachin
1
140
Git scrapingで始める継続的なデータ追跡 / Git Scraping
ohbarye
5
490
JAWS-UG20250116_iOSアプリエンジニアがAWSreInventに行ってきた(真面目編)
totokit4
0
140
EMConf JP の楽しみ方 / How to enjoy EMConf JP
pauli
2
150
Accessibility Inspectorを活用した アプリのアクセシビリティ向上方法
hinakko
0
180
デジタルアイデンティティ人材育成推進ワーキンググループ 翻訳サブワーキンググループ 活動報告 / 20250114-OIDF-J-EduWG-TranslationSWG
oidfj
0
540
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
98
18k
Optimising Largest Contentful Paint
csswizardry
33
3k
Docker and Python
trallard
43
3.2k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
VelocityConf: Rendering Performance Case Studies
addyosmani
327
24k
How to Ace a Technical Interview
jacobian
276
23k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
Done Done
chrislema
182
16k
Side Projects
sachag
452
42k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
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