byebug 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/GUIDE.md +2 -2
  4. data/LICENSE +3 -3
  5. data/README.md +5 -4
  6. data/byebug.gemspec +1 -1
  7. data/ext/byebug/byebug.c +20 -19
  8. data/lib/byebug.rb +2 -53
  9. data/lib/byebug/command.rb +9 -109
  10. data/lib/byebug/commands/breakpoints.rb +1 -1
  11. data/lib/byebug/commands/control.rb +20 -21
  12. data/lib/byebug/commands/display.rb +2 -3
  13. data/lib/byebug/commands/eval.rb +6 -16
  14. data/lib/byebug/commands/finish.rb +1 -1
  15. data/lib/byebug/commands/frame.rb +9 -9
  16. data/lib/byebug/commands/help.rb +2 -3
  17. data/lib/byebug/commands/history.rb +28 -0
  18. data/lib/byebug/commands/info.rb +3 -3
  19. data/lib/byebug/commands/list.rb +2 -13
  20. data/lib/byebug/commands/method.rb +5 -45
  21. data/lib/byebug/commands/reload.rb +1 -12
  22. data/lib/byebug/commands/repl.rb +6 -15
  23. data/lib/byebug/commands/save.rb +2 -7
  24. data/lib/byebug/commands/set.rb +45 -116
  25. data/lib/byebug/commands/show.rb +22 -126
  26. data/lib/byebug/commands/stepping.rb +1 -1
  27. data/lib/byebug/commands/trace.rb +14 -25
  28. data/lib/byebug/commands/variables.rb +3 -41
  29. data/lib/byebug/helper.rb +11 -42
  30. data/lib/byebug/history.rb +5 -13
  31. data/lib/byebug/processors/command_processor.rb +6 -6
  32. data/lib/byebug/setting.rb +82 -0
  33. data/lib/byebug/settings/autoeval.rb +20 -0
  34. data/lib/byebug/settings/autoirb.rb +19 -0
  35. data/lib/byebug/settings/autolist.rb +19 -0
  36. data/lib/byebug/settings/autoreload.rb +11 -0
  37. data/lib/byebug/settings/autosave.rb +11 -0
  38. data/lib/byebug/settings/basename.rb +7 -0
  39. data/lib/byebug/settings/callstyle.rb +15 -0
  40. data/lib/byebug/settings/forcestep.rb +11 -0
  41. data/lib/byebug/settings/fullpath.rb +11 -0
  42. data/lib/byebug/settings/histfile.rb +16 -0
  43. data/lib/byebug/settings/histsize.rb +18 -0
  44. data/lib/byebug/settings/linetrace.rb +15 -0
  45. data/lib/byebug/settings/listsize.rb +15 -0
  46. data/lib/byebug/settings/post_mortem.rb +15 -0
  47. data/lib/byebug/settings/stack_on_error.rb +7 -0
  48. data/lib/byebug/settings/testing.rb +7 -0
  49. data/lib/byebug/settings/tracing_plus.rb +7 -0
  50. data/lib/byebug/settings/verbose.rb +7 -0
  51. data/lib/byebug/settings/width.rb +29 -0
  52. data/lib/byebug/version.rb +1 -1
  53. data/test/breakpoints_test.rb +345 -324
  54. data/test/conditions_test.rb +61 -48
  55. data/test/continue_test.rb +38 -27
  56. data/test/debugger_alias_test.rb +5 -3
  57. data/test/display_test.rb +103 -92
  58. data/test/edit_test.rb +42 -34
  59. data/test/eval_test.rb +91 -75
  60. data/test/finish_test.rb +51 -40
  61. data/test/frame_test.rb +197 -184
  62. data/test/help_test.rb +47 -38
  63. data/test/history_test.rb +54 -0
  64. data/test/info_test.rb +306 -293
  65. data/test/interrupt_test.rb +44 -38
  66. data/test/kill_test.rb +40 -31
  67. data/test/list_test.rb +166 -133
  68. data/test/method_test.rb +67 -60
  69. data/test/post_mortem_test.rb +56 -48
  70. data/test/quit_test.rb +44 -35
  71. data/test/reload_test.rb +36 -24
  72. data/test/repl_test.rb +57 -47
  73. data/test/restart_test.rb +56 -69
  74. data/test/save_test.rb +62 -53
  75. data/test/set_test.rb +140 -118
  76. data/test/show_test.rb +68 -201
  77. data/test/source_test.rb +39 -29
  78. data/test/stepping_test.rb +163 -136
  79. data/test/support/test_dsl.rb +9 -11
  80. data/test/test_helper.rb +2 -7
  81. data/test/thread_test.rb +121 -107
  82. data/test/trace_test.rb +86 -83
  83. data/test/variables_test.rb +104 -98
  84. metadata +27 -86
  85. data/test/examples/breakpoint.rb +0 -6
  86. data/test/examples/breakpoint_deep.rb +0 -4
  87. data/test/examples/conditions.rb +0 -4
  88. data/test/examples/continue.rb +0 -5
  89. data/test/examples/display.rb +0 -5
  90. data/test/examples/edit.rb +0 -4
  91. data/test/examples/eval.rb +0 -4
  92. data/test/examples/finish.rb +0 -3
  93. data/test/examples/frame.rb +0 -4
  94. data/test/examples/frame_deep.rb +0 -1
  95. data/test/examples/gcd.rb +0 -15
  96. data/test/examples/hanoi.rb +0 -34
  97. data/test/examples/help.rb +0 -1
  98. data/test/examples/info.rb +0 -6
  99. data/test/examples/info2.rb +0 -3
  100. data/test/examples/interrupt.rb +0 -8
  101. data/test/examples/kill.rb +0 -2
  102. data/test/examples/list.rb +0 -23
  103. data/test/examples/method.rb +0 -4
  104. data/test/examples/post_mortem.rb +0 -4
  105. data/test/examples/primes.rb +0 -25
  106. data/test/examples/quit.rb +0 -2
  107. data/test/examples/reload.rb +0 -6
  108. data/test/examples/repl.rb +0 -6
  109. data/test/examples/restart.rb +0 -6
  110. data/test/examples/save.rb +0 -3
  111. data/test/examples/set.rb +0 -3
  112. data/test/examples/settings.rb +0 -1
  113. data/test/examples/show.rb +0 -1
  114. data/test/examples/source.rb +0 -3
  115. data/test/examples/stepping.rb +0 -8
  116. data/test/examples/stepping_raise_from_c_method.rb +0 -3
  117. data/test/examples/stepping_raise_from_ruby_method.rb +0 -3
  118. data/test/examples/test-triangle.rb +0 -14
  119. data/test/examples/thread.rb +0 -5
  120. data/test/examples/tmate.rb +0 -10
  121. data/test/examples/trace.rb +0 -8
  122. data/test/examples/tri3.rb +0 -6
  123. data/test/examples/triangle.rb +0 -13
  124. data/test/examples/variables.rb +0 -4
  125. data/test/timeout_test.rb +0 -9
@@ -1,127 +1,133 @@
1
- class VariablesExample
2
- SOMECONST = 'foo' unless defined?(SOMECONST)
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
- def run
13
- a = 4
14
- b = [1, 2, 3].map do |i|
15
- a * i
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
- it 'must show variables' do
26
- enter 'var class'
27
- debug_file 'variables'
28
- check_output_includes '@@class_c = 3'
29
- end
22
+ class VariablesTestCase < TestDsl::TestCase
23
+ before do
24
+ @example = -> do
25
+ byebug
30
26
 
31
- it 'must be able to use shortcut' do
32
- enter 'v cl'
33
- debug_file 'variables'
34
- check_output_includes '@@class_c = 3'
27
+ v = Example.new
28
+ v.run
29
+ end
35
30
  end
36
- end
37
31
 
38
- describe 'constants' do
39
- it 'must show constants' do
40
- enter 'break 4', 'cont', 'var const VariablesExample'
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
- it 'must be able to use shortcut' do
46
- enter 'break 4', 'cont', 'v co VariablesExample'
47
- debug_file 'variables'
48
- check_output_includes 'SOMECONST => "foo"'
49
- end
36
+ it 'must show variables' do
37
+ enter 'var class'
38
+ debug_proc(@example)
39
+ check_output_includes(/@@runnables/)
40
+ end
50
41
 
51
- it 'must show error message if given object is not a class or a module' do
52
- enter 'break 4', 'cont', 'var const v'
53
- debug_file 'variables'
54
- check_output_includes 'Should be Class/Module: v'
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
- describe 'globals' do
59
- it 'must show global variables' do
60
- enter 'break 4', 'cont', 'var global'
61
- debug_file 'variables'
62
- check_output_includes '$VERBOSE = true'
63
- end
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
- it 'must be able to use shortcut' do
66
- enter 'break 4', 'cont', 'v g'
67
- debug_file 'variables'
68
- check_output_includes '$VERBOSE = true'
69
- end
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
- describe 'instance variables' do
73
- it 'must show instance variables of the given object' do
74
- enter 'break 4', 'cont', 'var instance v'
75
- debug_file 'variables'
76
- check_output_includes '@inst_a = 1', '@inst_b = 2'
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
- it 'must show instance variables of self' do
80
- enter "break #{__FILE__}:9", 'cont', 'var instance'
81
- debug_file 'variables'
82
- check_output_includes '@inst_a = 1', '@inst_b = 2'
83
- end
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
- it 'must show instance variables' do
86
- enter 'break 4', 'cont', 'var instance v'
87
- debug_file 'variables'
88
- check_output_includes '@inst_a = 1', '@inst_b = 2'
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
- it 'must be able to use shortcut' do
92
- enter 'break 4', 'cont', 'v ins v'
93
- debug_file 'variables'
94
- check_output_includes '@inst_a = 1', '@inst_b = 2'
95
- end
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
- describe 'when width is too small' do
98
- temporary_change_hash Byebug.settings, :width, 20
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 cut long variable values according it' do
101
- enter 'break 4', 'cont', 'var instance v'
102
- debug_file 'variables'
103
- check_output_includes '@inst_c = "1111111111111111...'
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
- it 'must show error if value doesn\'t have #to_s/#inspect methods' do
108
- enter 'break 4', 'cont', 'var instance v'
109
- debug_file 'variables'
110
- check_output_includes '@inst_d = *Error in evaluation*'
111
- end
112
- end
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
- describe 'local variables' do
115
- it 'must show local variables' do
116
- enter "break #{__FILE__}:15", 'cont', 'var local'
117
- debug_file 'variables'
118
- check_output_includes 'a => 4', 'b => nil', 'i => 1'
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
- describe 'test for "var ct" command' do
123
- it 'must work' do
124
- skip('can\'t install ruby-internal gem')
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.0.0
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-17 00:00:00.000000000 Z
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.3'
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.3'
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
@@ -1,6 +0,0 @@
1
- y = 3
2
- # A comment
3
- byebug
4
- z = 5
5
- BreakpointExample.new.b
6
- BreakpointExample.a(y+z)
@@ -1,4 +0,0 @@
1
- ex = BreakpointDeepExample.new.a
2
- 2.times do
3
- ex = ex ? ex : 1
4
- end
@@ -1,4 +0,0 @@
1
- byebug
2
- b = 5
3
- c = b + 5
4
- c = Object.new
@@ -1,5 +0,0 @@
1
- byebug
2
-
3
- b = 5
4
- c = b + 5
5
- ContinueExample.a(c)
@@ -1,5 +0,0 @@
1
- byebug
2
- d = 4
3
- d = d + 2
4
- d = d + 3
5
- d = d + 6
@@ -1,4 +0,0 @@
1
- byebug
2
- d = 1
3
- b = 2
4
- DummyObject.new(b, d)