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
Defly
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Andrew Liu
August 27, 2011
Programming
380
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Defly
A debug tool for Ruby
Andrew Liu
August 27, 2011
More Decks by Andrew Liu
See All by Andrew Liu
Facebook Graph API
eggegg
7
690
HTTP
eggegg
17
1.5k
Version Control System - Git
eggegg
4
700
Introduction to Ruby
eggegg
3
650
Other Decks in Programming
See All in Programming
AI がコードを書く時代における新卒エンジニアの仕事風景 (2026) / New Graduate Engineers in the Era of AI Coding (2026)
sushichan044
0
230
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
8
5.3k
共通化で考えるべきは、実装より公開する型だった
codeegg
0
270
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
540
1年で人数1.5倍、PR数5.5倍増。 品質とアウトカムはどうなったか、 何が効いたか
ike002jp
0
140
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
350
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
1
210
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
530
Android CLI
fornewid
0
120
php-fpmのプロセスが枯渇した日-調査・対処・そして本当にやるべきだったこと-
shibuchaaaan
0
120
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
4
1.1k
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
2
620
Featured
See All Featured
The Limits of Empathy - UXLibs8
cassininazir
1
530
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.3k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Six Lessons from altMBA
skipperchong
29
4.3k
Utilizing Notion as your number one productivity tool
mfonobong
4
450
New Earth Scene 8
popppiees
3
2.4k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1k
[SF Ruby Conf 2025] Rails X
palkan
2
1.2k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
910
Transcript
Defly Debugging and Tracing Tool for Ruby http://github.com/eggegg/defly
Andrew Liu 劉彥廷 • College Student • Intern @ Cardinalblue
• eggegg @ github • Ruby, iOS, Android •
[email protected]
gem install defly
Defly is for... • Trace method calls • Trace instance
variables • Better error messages • Inspect the point of error
class Warrior attr_accessor :hp, :mp def sleep self.hp += 10
self.mp += 2 end end
class Warrior attr_accessor :hp, :mp def sleep puts "BEFORE: #{@hp},
#{@mp}" self.hp += 10 puts "AFTER ADDING HP: #{@hp}, #{@mp}" self.mp += 2 puts "AFTER ADDING MP: #{@hp}, #{@mp}" end end
class Warrior attr_accessor :hp, :mp def sleep self.hp += 10
self.mp += 2 end end require 'defly' Warrior.debug! Warrior.new.trace([:hp, :hp=, :mp, :mp=, :sleep], [:@hp, :@mp]) do |warrior| warrior.hp = 10 warrior.mp = 20 warrior.sleep end
Tracing hp, hp=, mp, mp=, sleep on Warrior instance Tracing
@hp, @mp on Warrior instance <<<<< Warrior#hp=(10) # (irb):14:in `block in irb_binding' @hp = 10 # undefined @mp = nil # undefined >>>>> 10 <<<<< Warrior#mp=(20) # (irb):15:in `block in irb_binding' @mp = 20 # undefined >>>>> 20 <<<<< Warrior#sleep() # (irb):16:in `block in irb_binding' <<<<< Warrior#hp() # (irb):7:in `sleep' >>>>> 10 <<<<< Warrior#hp=(20) # (irb):7:in `sleep' @hp = 20 # 10 -> 20 >>>>> 20 <<<<< Warrior#mp() # (irb):8:in `sleep' >>>>> 20 <<<<< Warrior#mp=(22) # (irb):8:in `sleep' @mp = 22 # 20 -> 22 >>>>> 22 >>>>> 22
NoMethodError debugging = nil debugging.is_annoying irb(main):001:0> require 'bug' NoMethodError: undefined
method `is_annoying' for nil:NilClass from /Users/eggegg/bug.rb:2:in `<top (required)>' ... bug.rb irb Where is the bug???
irb(main):003:0> require 'defly' => true irb(main):004:0> require 'bug' NoMethodError: undefined
method `is_annoying' for nil:NilClass bug.rb:2> debugging.<<is_annoying>> from /Users/andrewliu/bug.rb:2:in `<top (required)>'
Inspecting Errors class Rocket def launch! @reason = "Bugs invasion"
raise "Engine Fail" end end Rocket.debug! rocket = Rocket.new rocket.watch_error "Engine Fail" rocket.launch!
>>>>> Error received: "Engine Fail" >>>>> #<Rocket:0(0)>> @reason => "Bugs
invasion" #<Rocket:0(0)>> Ruby shell (Rib by godfat) to inspect errors!
Thanks! Any Question?