byebug 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/GUIDE.md +2 -2
- data/LICENSE +3 -3
- data/README.md +5 -4
- data/byebug.gemspec +1 -1
- data/ext/byebug/byebug.c +20 -19
- data/lib/byebug.rb +2 -53
- data/lib/byebug/command.rb +9 -109
- data/lib/byebug/commands/breakpoints.rb +1 -1
- data/lib/byebug/commands/control.rb +20 -21
- data/lib/byebug/commands/display.rb +2 -3
- data/lib/byebug/commands/eval.rb +6 -16
- data/lib/byebug/commands/finish.rb +1 -1
- data/lib/byebug/commands/frame.rb +9 -9
- data/lib/byebug/commands/help.rb +2 -3
- data/lib/byebug/commands/history.rb +28 -0
- data/lib/byebug/commands/info.rb +3 -3
- data/lib/byebug/commands/list.rb +2 -13
- data/lib/byebug/commands/method.rb +5 -45
- data/lib/byebug/commands/reload.rb +1 -12
- data/lib/byebug/commands/repl.rb +6 -15
- data/lib/byebug/commands/save.rb +2 -7
- data/lib/byebug/commands/set.rb +45 -116
- data/lib/byebug/commands/show.rb +22 -126
- data/lib/byebug/commands/stepping.rb +1 -1
- data/lib/byebug/commands/trace.rb +14 -25
- data/lib/byebug/commands/variables.rb +3 -41
- data/lib/byebug/helper.rb +11 -42
- data/lib/byebug/history.rb +5 -13
- data/lib/byebug/processors/command_processor.rb +6 -6
- data/lib/byebug/setting.rb +82 -0
- data/lib/byebug/settings/autoeval.rb +20 -0
- data/lib/byebug/settings/autoirb.rb +19 -0
- data/lib/byebug/settings/autolist.rb +19 -0
- data/lib/byebug/settings/autoreload.rb +11 -0
- data/lib/byebug/settings/autosave.rb +11 -0
- data/lib/byebug/settings/basename.rb +7 -0
- data/lib/byebug/settings/callstyle.rb +15 -0
- data/lib/byebug/settings/forcestep.rb +11 -0
- data/lib/byebug/settings/fullpath.rb +11 -0
- data/lib/byebug/settings/histfile.rb +16 -0
- data/lib/byebug/settings/histsize.rb +18 -0
- data/lib/byebug/settings/linetrace.rb +15 -0
- data/lib/byebug/settings/listsize.rb +15 -0
- data/lib/byebug/settings/post_mortem.rb +15 -0
- data/lib/byebug/settings/stack_on_error.rb +7 -0
- data/lib/byebug/settings/testing.rb +7 -0
- data/lib/byebug/settings/tracing_plus.rb +7 -0
- data/lib/byebug/settings/verbose.rb +7 -0
- data/lib/byebug/settings/width.rb +29 -0
- data/lib/byebug/version.rb +1 -1
- data/test/breakpoints_test.rb +345 -324
- data/test/conditions_test.rb +61 -48
- data/test/continue_test.rb +38 -27
- data/test/debugger_alias_test.rb +5 -3
- data/test/display_test.rb +103 -92
- data/test/edit_test.rb +42 -34
- data/test/eval_test.rb +91 -75
- data/test/finish_test.rb +51 -40
- data/test/frame_test.rb +197 -184
- data/test/help_test.rb +47 -38
- data/test/history_test.rb +54 -0
- data/test/info_test.rb +306 -293
- data/test/interrupt_test.rb +44 -38
- data/test/kill_test.rb +40 -31
- data/test/list_test.rb +166 -133
- data/test/method_test.rb +67 -60
- data/test/post_mortem_test.rb +56 -48
- data/test/quit_test.rb +44 -35
- data/test/reload_test.rb +36 -24
- data/test/repl_test.rb +57 -47
- data/test/restart_test.rb +56 -69
- data/test/save_test.rb +62 -53
- data/test/set_test.rb +140 -118
- data/test/show_test.rb +68 -201
- data/test/source_test.rb +39 -29
- data/test/stepping_test.rb +163 -136
- data/test/support/test_dsl.rb +9 -11
- data/test/test_helper.rb +2 -7
- data/test/thread_test.rb +121 -107
- data/test/trace_test.rb +86 -83
- data/test/variables_test.rb +104 -98
- metadata +27 -86
- data/test/examples/breakpoint.rb +0 -6
- data/test/examples/breakpoint_deep.rb +0 -4
- data/test/examples/conditions.rb +0 -4
- data/test/examples/continue.rb +0 -5
- data/test/examples/display.rb +0 -5
- data/test/examples/edit.rb +0 -4
- data/test/examples/eval.rb +0 -4
- data/test/examples/finish.rb +0 -3
- data/test/examples/frame.rb +0 -4
- data/test/examples/frame_deep.rb +0 -1
- data/test/examples/gcd.rb +0 -15
- data/test/examples/hanoi.rb +0 -34
- data/test/examples/help.rb +0 -1
- data/test/examples/info.rb +0 -6
- data/test/examples/info2.rb +0 -3
- data/test/examples/interrupt.rb +0 -8
- data/test/examples/kill.rb +0 -2
- data/test/examples/list.rb +0 -23
- data/test/examples/method.rb +0 -4
- data/test/examples/post_mortem.rb +0 -4
- data/test/examples/primes.rb +0 -25
- data/test/examples/quit.rb +0 -2
- data/test/examples/reload.rb +0 -6
- data/test/examples/repl.rb +0 -6
- data/test/examples/restart.rb +0 -6
- data/test/examples/save.rb +0 -3
- data/test/examples/set.rb +0 -3
- data/test/examples/settings.rb +0 -1
- data/test/examples/show.rb +0 -1
- data/test/examples/source.rb +0 -3
- data/test/examples/stepping.rb +0 -8
- data/test/examples/stepping_raise_from_c_method.rb +0 -3
- data/test/examples/stepping_raise_from_ruby_method.rb +0 -3
- data/test/examples/test-triangle.rb +0 -14
- data/test/examples/thread.rb +0 -5
- data/test/examples/tmate.rb +0 -10
- data/test/examples/trace.rb +0 -8
- data/test/examples/tri3.rb +0 -6
- data/test/examples/triangle.rb +0 -13
- data/test/examples/variables.rb +0 -4
- data/test/timeout_test.rb +0 -9
data/test/variables_test.rb
CHANGED
@@ -1,127 +1,133 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
def initialize
|
5
|
-
@inst_a = 1
|
6
|
-
@inst_b = 2
|
7
|
-
@inst_c = "1" * 40
|
8
|
-
@inst_d = BasicObject.new
|
9
|
-
@@class_c = 3
|
10
|
-
end
|
1
|
+
module VariablesTest
|
2
|
+
class Example
|
3
|
+
SOMECONST = 'foo' unless defined?(SOMECONST)
|
11
4
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
5
|
+
def initialize
|
6
|
+
@inst_a = 1
|
7
|
+
@inst_b = 2
|
8
|
+
@inst_c = "1" * 40
|
9
|
+
@inst_d = BasicObject.new
|
10
|
+
end
|
11
|
+
|
12
|
+
def run
|
13
|
+
a = 4
|
14
|
+
b = [1, 2, 3].map do |i|
|
15
|
+
a * i
|
16
|
+
end
|
17
|
+
b
|
16
18
|
end
|
17
|
-
b
|
18
19
|
end
|
19
|
-
end
|
20
20
|
|
21
|
-
class TestVariables < TestDsl::TestCase
|
22
|
-
describe 'class variables' do
|
23
|
-
before { enter "break #{__FILE__}:17", 'cont' }
|
24
21
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
end
|
22
|
+
class VariablesTestCase < TestDsl::TestCase
|
23
|
+
before do
|
24
|
+
@example = -> do
|
25
|
+
byebug
|
30
26
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
check_output_includes '@@class_c = 3'
|
27
|
+
v = Example.new
|
28
|
+
v.run
|
29
|
+
end
|
35
30
|
end
|
36
|
-
end
|
37
31
|
|
38
|
-
|
39
|
-
|
40
|
-
enter 'break
|
41
|
-
debug_file 'variables'
|
42
|
-
check_output_includes 'SOMECONST => "foo"'
|
43
|
-
end
|
32
|
+
# we check a class minitest variable... brittle but ok for now
|
33
|
+
describe 'class variables' do
|
34
|
+
before { enter 'break 28', 'cont' }
|
44
35
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
36
|
+
it 'must show variables' do
|
37
|
+
enter 'var class'
|
38
|
+
debug_proc(@example)
|
39
|
+
check_output_includes(/@@runnables/)
|
40
|
+
end
|
50
41
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
42
|
+
it 'must be able to use shortcut' do
|
43
|
+
enter 'v cl'
|
44
|
+
debug_proc(@example)
|
45
|
+
check_output_includes(/@@runnables/)
|
46
|
+
end
|
55
47
|
end
|
56
|
-
end
|
57
48
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
49
|
+
describe 'constants' do
|
50
|
+
it 'must show constants' do
|
51
|
+
enter 'break 28', 'cont', 'var const Example'
|
52
|
+
debug_proc(@example)
|
53
|
+
check_output_includes 'SOMECONST => "foo"'
|
54
|
+
end
|
64
55
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
end
|
56
|
+
it 'must be able to use shortcut' do
|
57
|
+
enter 'break 28', 'cont', 'v co Example'
|
58
|
+
debug_proc(@example)
|
59
|
+
check_output_includes 'SOMECONST => "foo"'
|
60
|
+
end
|
71
61
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
62
|
+
it 'must show error message if given object is not a class or a module' do
|
63
|
+
enter 'break 28', 'cont', 'var const v'
|
64
|
+
debug_proc(@example)
|
65
|
+
check_output_includes 'Should be Class/Module: v'
|
66
|
+
end
|
77
67
|
end
|
78
68
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
69
|
+
describe 'globals' do
|
70
|
+
it 'must show global variables' do
|
71
|
+
enter 'break 28', 'cont', 'var global'
|
72
|
+
debug_proc(@example)
|
73
|
+
check_output_includes '$VERBOSE = true'
|
74
|
+
end
|
84
75
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
76
|
+
it 'must be able to use shortcut' do
|
77
|
+
enter 'break 28', 'cont', 'v g'
|
78
|
+
debug_proc(@example)
|
79
|
+
check_output_includes '$VERBOSE = true'
|
80
|
+
end
|
89
81
|
end
|
90
82
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
83
|
+
describe 'instance variables' do
|
84
|
+
it 'must show instance variables of the given object' do
|
85
|
+
enter 'break 28', 'cont', 'var instance v'
|
86
|
+
debug_proc(@example)
|
87
|
+
check_output_includes '@inst_a = 1', '@inst_b = 2'
|
88
|
+
end
|
96
89
|
|
97
|
-
|
98
|
-
|
90
|
+
it 'must show instance variables of self' do
|
91
|
+
enter 'break 9', 'cont', 'var instance'
|
92
|
+
debug_proc(@example)
|
93
|
+
check_output_includes '@inst_a = 1', '@inst_b = 2'
|
94
|
+
end
|
99
95
|
|
100
|
-
it 'must
|
101
|
-
enter 'break
|
102
|
-
|
103
|
-
check_output_includes '@
|
96
|
+
it 'must show instance variables' do
|
97
|
+
enter 'break 28', 'cont', 'var instance v'
|
98
|
+
debug_proc(@example)
|
99
|
+
check_output_includes '@inst_a = 1', '@inst_b = 2'
|
104
100
|
end
|
105
|
-
end
|
106
101
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
102
|
+
it 'must be able to use shortcut' do
|
103
|
+
enter 'break 28', 'cont', 'v ins v'
|
104
|
+
debug_proc(@example)
|
105
|
+
check_output_includes '@inst_a = 1', '@inst_b = 2'
|
106
|
+
end
|
107
|
+
|
108
|
+
describe 'when width is too small' do
|
109
|
+
temporary_change_hash Byebug::Setting, :width, 20
|
110
|
+
|
111
|
+
it 'must cut long variable values according it' do
|
112
|
+
enter 'break 28', 'cont', 'var instance v'
|
113
|
+
debug_proc(@example)
|
114
|
+
check_output_includes '@inst_c = "1111111111111111...'
|
115
|
+
end
|
116
|
+
end
|
113
117
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
118
|
+
it 'must show error if value doesn\'t have #to_s/#inspect methods' do
|
119
|
+
enter 'break 28', 'cont', 'var instance v'
|
120
|
+
debug_proc(@example)
|
121
|
+
check_output_includes '@inst_d = *Error in evaluation*'
|
122
|
+
end
|
119
123
|
end
|
120
|
-
end
|
121
124
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
+
describe 'local variables' do
|
126
|
+
it 'must show local variables' do
|
127
|
+
enter 'break 15', 'cont', 'var local'
|
128
|
+
debug_proc(@example)
|
129
|
+
check_output_includes 'a => 4', 'b => nil', 'i => 1'
|
130
|
+
end
|
125
131
|
end
|
126
132
|
end
|
127
133
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: byebug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Rodriguez
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-04-
|
13
|
+
date: 2014-04-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: columnize
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '0.
|
21
|
+
version: '0.8'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: '0.
|
28
|
+
version: '0.8'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: debugger-linecache
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- lib/byebug/commands/finish.rb
|
88
88
|
- lib/byebug/commands/frame.rb
|
89
89
|
- lib/byebug/commands/help.rb
|
90
|
+
- lib/byebug/commands/history.rb
|
90
91
|
- lib/byebug/commands/info.rb
|
91
92
|
- lib/byebug/commands/kill.rb
|
92
93
|
- lib/byebug/commands/list.rb
|
@@ -114,6 +115,26 @@ files:
|
|
114
115
|
- lib/byebug/processors/command_processor.rb
|
115
116
|
- lib/byebug/processors/control_command_processor.rb
|
116
117
|
- lib/byebug/remote.rb
|
118
|
+
- lib/byebug/setting.rb
|
119
|
+
- lib/byebug/settings/autoeval.rb
|
120
|
+
- lib/byebug/settings/autoirb.rb
|
121
|
+
- lib/byebug/settings/autolist.rb
|
122
|
+
- lib/byebug/settings/autoreload.rb
|
123
|
+
- lib/byebug/settings/autosave.rb
|
124
|
+
- lib/byebug/settings/basename.rb
|
125
|
+
- lib/byebug/settings/callstyle.rb
|
126
|
+
- lib/byebug/settings/forcestep.rb
|
127
|
+
- lib/byebug/settings/fullpath.rb
|
128
|
+
- lib/byebug/settings/histfile.rb
|
129
|
+
- lib/byebug/settings/histsize.rb
|
130
|
+
- lib/byebug/settings/linetrace.rb
|
131
|
+
- lib/byebug/settings/listsize.rb
|
132
|
+
- lib/byebug/settings/post_mortem.rb
|
133
|
+
- lib/byebug/settings/stack_on_error.rb
|
134
|
+
- lib/byebug/settings/testing.rb
|
135
|
+
- lib/byebug/settings/tracing_plus.rb
|
136
|
+
- lib/byebug/settings/verbose.rb
|
137
|
+
- lib/byebug/settings/width.rb
|
117
138
|
- lib/byebug/version.rb
|
118
139
|
- test/breakpoints_test.rb
|
119
140
|
- test/conditions_test.rb
|
@@ -122,49 +143,10 @@ files:
|
|
122
143
|
- test/display_test.rb
|
123
144
|
- test/edit_test.rb
|
124
145
|
- test/eval_test.rb
|
125
|
-
- test/examples/breakpoint.rb
|
126
|
-
- test/examples/breakpoint_deep.rb
|
127
|
-
- test/examples/conditions.rb
|
128
|
-
- test/examples/continue.rb
|
129
|
-
- test/examples/display.rb
|
130
|
-
- test/examples/edit.rb
|
131
|
-
- test/examples/eval.rb
|
132
|
-
- test/examples/finish.rb
|
133
|
-
- test/examples/frame.rb
|
134
|
-
- test/examples/frame_deep.rb
|
135
|
-
- test/examples/gcd.rb
|
136
|
-
- test/examples/hanoi.rb
|
137
|
-
- test/examples/help.rb
|
138
|
-
- test/examples/info.rb
|
139
|
-
- test/examples/info2.rb
|
140
|
-
- test/examples/interrupt.rb
|
141
|
-
- test/examples/kill.rb
|
142
|
-
- test/examples/list.rb
|
143
|
-
- test/examples/method.rb
|
144
|
-
- test/examples/post_mortem.rb
|
145
|
-
- test/examples/primes.rb
|
146
|
-
- test/examples/quit.rb
|
147
|
-
- test/examples/reload.rb
|
148
|
-
- test/examples/repl.rb
|
149
|
-
- test/examples/restart.rb
|
150
|
-
- test/examples/save.rb
|
151
|
-
- test/examples/set.rb
|
152
|
-
- test/examples/settings.rb
|
153
|
-
- test/examples/show.rb
|
154
|
-
- test/examples/source.rb
|
155
|
-
- test/examples/stepping.rb
|
156
|
-
- test/examples/stepping_raise_from_c_method.rb
|
157
|
-
- test/examples/stepping_raise_from_ruby_method.rb
|
158
|
-
- test/examples/test-triangle.rb
|
159
|
-
- test/examples/thread.rb
|
160
|
-
- test/examples/tmate.rb
|
161
|
-
- test/examples/trace.rb
|
162
|
-
- test/examples/tri3.rb
|
163
|
-
- test/examples/triangle.rb
|
164
|
-
- test/examples/variables.rb
|
165
146
|
- test/finish_test.rb
|
166
147
|
- test/frame_test.rb
|
167
148
|
- test/help_test.rb
|
149
|
+
- test/history_test.rb
|
168
150
|
- test/info_test.rb
|
169
151
|
- test/interrupt_test.rb
|
170
152
|
- test/kill_test.rb
|
@@ -186,7 +168,6 @@ files:
|
|
186
168
|
- test/support/test_interface.rb
|
187
169
|
- test/test_helper.rb
|
188
170
|
- test/thread_test.rb
|
189
|
-
- test/timeout_test.rb
|
190
171
|
- test/trace_test.rb
|
191
172
|
- test/variables_test.rb
|
192
173
|
homepage: http://github.com/deivid-rodriguez/byebug
|
@@ -221,49 +202,10 @@ test_files:
|
|
221
202
|
- test/display_test.rb
|
222
203
|
- test/edit_test.rb
|
223
204
|
- test/eval_test.rb
|
224
|
-
- test/examples/breakpoint.rb
|
225
|
-
- test/examples/breakpoint_deep.rb
|
226
|
-
- test/examples/conditions.rb
|
227
|
-
- test/examples/continue.rb
|
228
|
-
- test/examples/display.rb
|
229
|
-
- test/examples/edit.rb
|
230
|
-
- test/examples/eval.rb
|
231
|
-
- test/examples/finish.rb
|
232
|
-
- test/examples/frame.rb
|
233
|
-
- test/examples/frame_deep.rb
|
234
|
-
- test/examples/gcd.rb
|
235
|
-
- test/examples/hanoi.rb
|
236
|
-
- test/examples/help.rb
|
237
|
-
- test/examples/info.rb
|
238
|
-
- test/examples/info2.rb
|
239
|
-
- test/examples/interrupt.rb
|
240
|
-
- test/examples/kill.rb
|
241
|
-
- test/examples/list.rb
|
242
|
-
- test/examples/method.rb
|
243
|
-
- test/examples/post_mortem.rb
|
244
|
-
- test/examples/primes.rb
|
245
|
-
- test/examples/quit.rb
|
246
|
-
- test/examples/reload.rb
|
247
|
-
- test/examples/repl.rb
|
248
|
-
- test/examples/restart.rb
|
249
|
-
- test/examples/save.rb
|
250
|
-
- test/examples/set.rb
|
251
|
-
- test/examples/settings.rb
|
252
|
-
- test/examples/show.rb
|
253
|
-
- test/examples/source.rb
|
254
|
-
- test/examples/stepping.rb
|
255
|
-
- test/examples/stepping_raise_from_c_method.rb
|
256
|
-
- test/examples/stepping_raise_from_ruby_method.rb
|
257
|
-
- test/examples/test-triangle.rb
|
258
|
-
- test/examples/thread.rb
|
259
|
-
- test/examples/tmate.rb
|
260
|
-
- test/examples/trace.rb
|
261
|
-
- test/examples/tri3.rb
|
262
|
-
- test/examples/triangle.rb
|
263
|
-
- test/examples/variables.rb
|
264
205
|
- test/finish_test.rb
|
265
206
|
- test/frame_test.rb
|
266
207
|
- test/help_test.rb
|
208
|
+
- test/history_test.rb
|
267
209
|
- test/info_test.rb
|
268
210
|
- test/interrupt_test.rb
|
269
211
|
- test/kill_test.rb
|
@@ -285,6 +227,5 @@ test_files:
|
|
285
227
|
- test/support/test_interface.rb
|
286
228
|
- test/test_helper.rb
|
287
229
|
- test/thread_test.rb
|
288
|
-
- test/timeout_test.rb
|
289
230
|
- test/trace_test.rb
|
290
231
|
- test/variables_test.rb
|
data/test/examples/breakpoint.rb
DELETED
data/test/examples/conditions.rb
DELETED
data/test/examples/continue.rb
DELETED
data/test/examples/display.rb
DELETED
data/test/examples/edit.rb
DELETED