tracer 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/tracer/irb.rb +29 -4
- data/lib/tracer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13d3b55fac8c903711f78ccb14e872f8c312dde28dda5ed7f5fa664d04dd2a3b
|
4
|
+
data.tar.gz: 71c21f53b34f98870d4e6b49c84432867375c24f56c3d3a4ebd47e4d6bdaeef5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54cb3be80359764539089df166a7ad922dea9ebea0cb8450a815f1956fbd780c3d6ed31bd5ea8e01cbf24689131c6463a5edb156220313b0c12e024f54d99565
|
7
|
+
data.tar.gz: 683343e41cb7150fdd256c4427a4ca9971a87b592093721e5d3f00a40141136eeaf884a9242e7b20f46a0e47f35f445eede9c2b612731f12a38f5f1c20ad6c3a
|
data/Gemfile.lock
CHANGED
data/lib/tracer/irb.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require_relative "../tracer"
|
1
2
|
require "irb/cmd/nop"
|
2
3
|
require "irb"
|
3
4
|
|
@@ -46,6 +47,11 @@ module IRB
|
|
46
47
|
description "Trace the target object (or self) in the given expression. Usage: `trace [target,] <expression>`"
|
47
48
|
|
48
49
|
def execute(*args)
|
50
|
+
if args.empty?
|
51
|
+
puts "Please provide the expression to trace. Usage: `trace [target,] <expression>`"
|
52
|
+
return
|
53
|
+
end
|
54
|
+
|
49
55
|
args = args.first.split(/,/, 2)
|
50
56
|
|
51
57
|
case args.size
|
@@ -56,8 +62,13 @@ module IRB
|
|
56
62
|
target = eval(args.first, irb_context.workspace.binding)
|
57
63
|
expression = args.last
|
58
64
|
else
|
59
|
-
|
60
|
-
|
65
|
+
puts "Please provide the expression to trace. Usage: `trace [target,] <expression>`"
|
66
|
+
return
|
67
|
+
end
|
68
|
+
|
69
|
+
unless expression
|
70
|
+
puts "Please provide the expression to trace. Usage: `trace [target,] <expression>`"
|
71
|
+
return
|
61
72
|
end
|
62
73
|
|
63
74
|
b = irb_context.workspace.binding
|
@@ -69,7 +80,14 @@ module IRB
|
|
69
80
|
category "Tracing"
|
70
81
|
description "Trace method calls in the given expression. Usage: `trace_call <expression>`"
|
71
82
|
|
72
|
-
def execute(
|
83
|
+
def execute(*args)
|
84
|
+
expression = args.first
|
85
|
+
|
86
|
+
unless expression
|
87
|
+
puts "Please provide the expression to trace. Usage: `trace_call <expression>`"
|
88
|
+
return
|
89
|
+
end
|
90
|
+
|
73
91
|
b = irb_context.workspace.binding
|
74
92
|
Tracer.trace_call { eval(expression, b) }
|
75
93
|
end
|
@@ -79,7 +97,14 @@ module IRB
|
|
79
97
|
category "Tracing"
|
80
98
|
description "Trace exceptions in the given expression. Usage: `trace_exception <expression>`"
|
81
99
|
|
82
|
-
def execute(
|
100
|
+
def execute(*args)
|
101
|
+
expression = args.first
|
102
|
+
|
103
|
+
unless expression
|
104
|
+
puts "Please provide the expression to trace. Usage: `trace_exception <expression>`"
|
105
|
+
return
|
106
|
+
end
|
107
|
+
|
83
108
|
b = irb_context.workspace.binding
|
84
109
|
Tracer.trace_exception { eval(expression, b) }
|
85
110
|
end
|
data/lib/tracer/version.rb
CHANGED