byebug 1.0.3 → 1.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +13 -11
- data/Rakefile +0 -6
- data/bin/byebug +83 -136
- data/ext/byebug/byebug.c +182 -96
- data/ext/byebug/byebug.h +5 -7
- data/ext/byebug/context.c +52 -40
- data/lib/byebug.rb +81 -81
- data/lib/byebug/command.rb +18 -35
- data/lib/byebug/commands/control.rb +1 -1
- data/lib/byebug/commands/display.rb +0 -2
- data/lib/byebug/commands/enable.rb +4 -16
- data/lib/byebug/commands/eval.rb +5 -3
- data/lib/byebug/commands/frame.rb +68 -69
- data/lib/byebug/commands/help.rb +2 -1
- data/lib/byebug/commands/info.rb +43 -42
- data/lib/byebug/commands/method.rb +4 -3
- data/lib/byebug/commands/set.rb +10 -19
- data/lib/byebug/commands/show.rb +6 -13
- data/lib/byebug/interface.rb +1 -1
- data/lib/byebug/processor.rb +14 -17
- data/lib/byebug/version.rb +1 -2
- data/old_doc/byebug.texi +576 -847
- data/test/breakpoints_test.rb +0 -1
- data/test/conditions_test.rb +35 -33
- data/test/display_test.rb +14 -13
- data/test/edit_test.rb +28 -25
- data/test/eval_test.rb +0 -2
- data/test/finish_test.rb +4 -3
- data/test/frame_test.rb +20 -21
- data/test/help_test.rb +26 -23
- data/test/info_test.rb +105 -108
- data/test/irb_test.rb +26 -25
- data/test/kill_test.rb +19 -19
- data/test/list_test.rb +140 -156
- data/test/method_test.rb +21 -22
- data/test/post_mortem_test.rb +2 -5
- data/test/quit_test.rb +16 -17
- data/test/reload_test.rb +2 -2
- data/test/restart_test.rb +0 -1
- data/test/save_test.rb +31 -32
- data/test/set_test.rb +50 -47
- data/test/show_test.rb +67 -66
- data/test/source_test.rb +31 -34
- data/test/stepping_test.rb +32 -34
- data/test/support/test_dsl.rb +1 -1
- data/test/trace_test.rb +1 -2
- data/test/variables_test.rb +36 -34
- metadata +2 -4
- data/lib/byebug/commands/tmate.rb +0 -36
- data/test/tmate_test.rb +0 -44
data/test/support/test_dsl.rb
CHANGED
@@ -34,7 +34,7 @@ module TestDsl
|
|
34
34
|
ENV['COLUMNS'].to_i > 10 ? ENV['COLUMNS'].to_i : 80
|
35
35
|
Byebug::Command.settings[:argv] = Byebug::ARGV
|
36
36
|
Byebug::Command.settings[:autolist] = 1
|
37
|
-
Byebug::Command.settings[:autoeval] =
|
37
|
+
Byebug::Command.settings[:autoeval] = true
|
38
38
|
Byebug::Command.settings[:reload_source_on_change] = 1
|
39
39
|
force_unset_const Byebug, 'BYEBUG_SCRIPT'
|
40
40
|
force_set_const Byebug, 'DEFAULT_START_SETTINGS',
|
data/test/trace_test.rb
CHANGED
@@ -142,10 +142,9 @@ describe 'Trace Command' do
|
|
142
142
|
|
143
143
|
describe 'Post Mortem' do
|
144
144
|
it 'must work in post-mortem mode' do
|
145
|
-
skip('No post morten mode for now')
|
146
145
|
enter 'cont', 'trace on'
|
147
146
|
debug_file 'post_mortem'
|
148
|
-
check_output_includes 'Tracing
|
147
|
+
check_output_includes 'Tracing is on'
|
149
148
|
end
|
150
149
|
end
|
151
150
|
|
data/test/variables_test.rb
CHANGED
@@ -1,115 +1,117 @@
|
|
1
1
|
require_relative 'test_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe 'Variables Command' do
|
4
4
|
include TestDsl
|
5
5
|
|
6
6
|
def after_setup
|
7
7
|
Byebug::Command.settings[:width] = 40
|
8
8
|
end
|
9
9
|
|
10
|
-
describe
|
11
|
-
it
|
10
|
+
describe 'class variables' do
|
11
|
+
it 'must show variables' do
|
12
12
|
enter 'break 19', 'cont', 'var class'
|
13
13
|
debug_file 'variables'
|
14
|
-
check_output_includes
|
14
|
+
check_output_includes '@@class_c = 3'
|
15
15
|
end
|
16
16
|
|
17
|
-
it
|
17
|
+
it 'must be able to use shortcut' do
|
18
18
|
enter 'break 19', 'cont', 'v cl'
|
19
19
|
debug_file 'variables'
|
20
|
-
check_output_includes
|
20
|
+
check_output_includes '@@class_c = 3'
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
describe
|
25
|
-
it
|
24
|
+
describe 'constants' do
|
25
|
+
it 'must show constants' do
|
26
26
|
enter 'break 25', 'cont', 'var const VariablesExample'
|
27
27
|
debug_file 'variables'
|
28
28
|
check_output_includes 'SOMECONST => "foo"'
|
29
29
|
end
|
30
30
|
|
31
|
-
it
|
31
|
+
it 'must be able to use shortcut' do
|
32
32
|
enter 'break 25', 'cont', 'v co VariablesExample'
|
33
33
|
debug_file 'variables'
|
34
34
|
check_output_includes 'SOMECONST => "foo"'
|
35
35
|
end
|
36
36
|
|
37
|
-
it
|
37
|
+
it 'must show error message if given object is not a Class or a Module' do
|
38
38
|
enter 'break 25', 'cont', 'var const v'
|
39
39
|
debug_file 'variables'
|
40
|
-
check_output_includes
|
40
|
+
check_output_includes 'Should be Class/Module: v'
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
describe
|
45
|
-
it
|
44
|
+
describe 'globals' do
|
45
|
+
it 'must show global variables' do
|
46
46
|
enter 'break 25', 'cont', 'var global'
|
47
47
|
debug_file 'variables'
|
48
48
|
check_output_includes '$glob = 100'
|
49
49
|
end
|
50
50
|
|
51
|
-
it
|
51
|
+
it 'must be able to use shortcut' do
|
52
52
|
enter 'break 25', 'cont', 'v g'
|
53
53
|
debug_file 'variables'
|
54
54
|
check_output_includes '$glob = 100'
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
describe
|
59
|
-
it
|
58
|
+
describe 'instance variables' do
|
59
|
+
it 'must show instance variables of the given object' do
|
60
60
|
enter 'break 25', 'cont', 'var instance v'
|
61
61
|
debug_file 'variables'
|
62
|
-
check_output_includes
|
62
|
+
check_output_includes '@inst_a = 1', '@inst_b = 2'
|
63
63
|
end
|
64
64
|
|
65
|
-
it
|
65
|
+
it 'must show instance variables of self' do
|
66
66
|
enter 'break 11', 'cont', 'var instance'
|
67
67
|
debug_file 'variables'
|
68
|
-
check_output_includes
|
68
|
+
check_output_includes '@inst_a = 1', '@inst_b = 2'
|
69
69
|
end
|
70
70
|
|
71
|
-
it
|
71
|
+
it 'must show instance variables' do
|
72
72
|
enter 'break 25', 'cont', 'var instance v'
|
73
73
|
debug_file 'variables'
|
74
|
-
check_output_includes
|
74
|
+
check_output_includes '@inst_a = 1', '@inst_b = 2'
|
75
75
|
end
|
76
76
|
|
77
|
-
it
|
77
|
+
it 'must be able to use shortcut' do
|
78
78
|
enter 'break 25', 'cont', 'v ins v'
|
79
79
|
debug_file 'variables'
|
80
|
-
check_output_includes
|
80
|
+
check_output_includes '@inst_a = 1', '@inst_b = 2'
|
81
81
|
end
|
82
82
|
|
83
|
-
it
|
83
|
+
it 'must cut long variable values according to :width setting' do
|
84
84
|
enter 'set width 20', 'break 25', 'cont', 'var instance v'
|
85
85
|
debug_file 'variables'
|
86
86
|
check_output_includes '@inst_c = "1111111111111111...'
|
87
87
|
end
|
88
88
|
|
89
|
-
it
|
89
|
+
it 'must show error if value doesn\'t have #to_s/#inspect methods' do
|
90
90
|
enter 'set width 21', 'break 25', 'cont', 'var instance v'
|
91
91
|
debug_file 'variables'
|
92
92
|
check_output_includes '@inst_d = *Error in evaluation*'
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
|
-
describe
|
97
|
-
it
|
96
|
+
describe 'local variables' do
|
97
|
+
it 'must show local variables' do
|
98
98
|
enter 'break 17', 'cont', 'var local'
|
99
99
|
debug_file 'variables'
|
100
|
-
check_output_includes
|
100
|
+
check_output_includes 'a => 4', 'b => nil', 'i => 1'
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
|
-
|
105
|
-
|
104
|
+
describe 'test for "var ct" command' do
|
105
|
+
it 'must work' do
|
106
|
+
skip('can\'t install ruby-internal gem')
|
107
|
+
end
|
108
|
+
end
|
106
109
|
|
107
|
-
describe
|
108
|
-
it
|
109
|
-
skip("No post morten mode for now")
|
110
|
+
describe 'Post Mortem' do
|
111
|
+
it 'must work in post-mortem mode' do
|
110
112
|
enter 'cont', 'var local'
|
111
113
|
debug_file 'post_mortem'
|
112
|
-
check_output_includes
|
114
|
+
check_output_includes 'x => nil', 'z => 4'
|
113
115
|
end
|
114
116
|
end
|
115
117
|
|
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: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Rodríguez
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-04-
|
13
|
+
date: 2013-04-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: columnize
|
@@ -155,7 +155,6 @@ files:
|
|
155
155
|
- lib/byebug/commands/source.rb
|
156
156
|
- lib/byebug/commands/stepping.rb
|
157
157
|
- lib/byebug/commands/threads.rb
|
158
|
-
- lib/byebug/commands/tmate.rb
|
159
158
|
- lib/byebug/commands/trace.rb
|
160
159
|
- lib/byebug/commands/variables.rb
|
161
160
|
- lib/byebug/context.rb
|
@@ -239,7 +238,6 @@ files:
|
|
239
238
|
- test/support/test_dsl.rb
|
240
239
|
- test/support/test_interface.rb
|
241
240
|
- test/test_helper.rb
|
242
|
-
- test/tmate_test.rb
|
243
241
|
- test/trace_test.rb
|
244
242
|
- test/variables_test.rb
|
245
243
|
homepage: http://github.com/deivid-rodriguez/byebug
|
@@ -1,36 +0,0 @@
|
|
1
|
-
module Byebug
|
2
|
-
if RUBY_PLATFORM =~ /darwin/
|
3
|
-
class TextMateCommand < Command # :nodoc:
|
4
|
-
def regexp
|
5
|
-
/^\s*tm(?:ate)?(?:\s*(\d+))?$/
|
6
|
-
end
|
7
|
-
|
8
|
-
def execute
|
9
|
-
if @match[1]
|
10
|
-
frm_n = @match[1].to_i
|
11
|
-
if frm_n > @state.context.stack_size || frm_n == 0
|
12
|
-
print "Wrong frame number\n"
|
13
|
-
return
|
14
|
-
end
|
15
|
-
file, line = @state.context.frame_file(frm_n-1), @state.context.frame_line(frm_n-1)
|
16
|
-
else
|
17
|
-
file, line = @state.file, @state.line
|
18
|
-
end
|
19
|
-
%x|open 'txmt://open?url=file://#{File.expand_path(file)}&line=#{line}'|
|
20
|
-
end
|
21
|
-
|
22
|
-
class << self
|
23
|
-
def help_command
|
24
|
-
'tmate'
|
25
|
-
end
|
26
|
-
|
27
|
-
def help(cmd)
|
28
|
-
%{
|
29
|
-
tm[ate] n\topens a current file in TextMate.
|
30
|
-
\t\tIt uses n-th frame if arg (n) is specifed.
|
31
|
-
}
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
data/test/tmate_test.rb
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
if RUBY_PLATFORM =~ /darwin/
|
2
|
-
require_relative 'test_helper'
|
3
|
-
|
4
|
-
describe "Tmate Command" do
|
5
|
-
include TestDsl
|
6
|
-
|
7
|
-
it "must open a current file with current frame in Textmate" do
|
8
|
-
Byebug::TextMateCommand.any_instance.expects(:`).with("open 'txmt://open?url=file://#{fullpath('tmate')}&line=7'")
|
9
|
-
enter 'break 7', 'cont', 'tmate'
|
10
|
-
debug_file 'tmate'
|
11
|
-
end
|
12
|
-
|
13
|
-
it "must open a current file with specified frame in Textmate" do
|
14
|
-
Byebug::TextMateCommand.any_instance.expects(:`).with("open 'txmt://open?url=file://#{fullpath('tmate')}&line=4'")
|
15
|
-
enter 'break 7', 'cont', 'tmate 2'
|
16
|
-
debug_file 'tmate'
|
17
|
-
end
|
18
|
-
|
19
|
-
describe "errors" do
|
20
|
-
it "must show an error message if frame == 0" do
|
21
|
-
enter 'tmate 0'
|
22
|
-
debug_file 'tmate'
|
23
|
-
check_output_includes "Wrong frame number"
|
24
|
-
end
|
25
|
-
|
26
|
-
it "must show an error message if frame > max frame" do
|
27
|
-
enter 'tmate 10'
|
28
|
-
debug_file 'tmate'
|
29
|
-
check_output_includes "Wrong frame number"
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
describe "Post Mortem" do
|
34
|
-
it "must work in post-mortem mode" do
|
35
|
-
skip("No post morten mode for now")
|
36
|
-
#Byebug::TextMateCommand.any_instance.expects(:`).with(
|
37
|
-
# "open 'txmt://open?url=file://#{fullpath('post_mortem')}&line=8'"
|
38
|
-
#)
|
39
|
-
#enter 'cont', 'tmate'
|
40
|
-
#debug_file 'post_mortem'
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|