pry-byebug 3.1.0 → 3.2.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 +17 -1
- data/README.md +7 -6
- data/lib/byebug/processors/pry_processor.rb +3 -5
- data/lib/pry-byebug.rb +1 -3
- data/lib/pry-byebug/cli.rb +1 -2
- data/lib/pry-byebug/commands.rb +8 -0
- data/lib/pry-byebug/commands/breakpoint.rb +135 -0
- data/lib/pry-byebug/commands/continue.rb +37 -0
- data/lib/pry-byebug/commands/down.rb +33 -0
- data/lib/pry-byebug/commands/finish.rb +26 -0
- data/lib/pry-byebug/commands/frame.rb +33 -0
- data/lib/pry-byebug/commands/next.rb +37 -0
- data/lib/pry-byebug/commands/step.rb +32 -0
- data/lib/pry-byebug/commands/up.rb +33 -0
- data/lib/pry-byebug/helpers/breakpoints.rb +84 -0
- data/lib/pry-byebug/helpers/multiline.rb +21 -0
- data/lib/pry-byebug/helpers/navigation.rb +17 -0
- data/lib/pry-byebug/version.rb +1 -1
- data/lib/pry/byebug/breakpoints.rb +4 -0
- metadata +23 -45
- data/.gitignore +0 -18
- data/.rubocop.yml +0 -14
- data/.rubocop_todo.yml +0 -20
- data/.travis.yml +0 -9
- data/Gemfile +0 -14
- data/Rakefile +0 -17
- data/lib/pry/commands/breakpoint.rb +0 -216
- data/lib/pry/commands/frames.rb +0 -79
- data/lib/pry/commands/stepping.rb +0 -88
- data/pry-byebug.gemspec +0 -23
- data/test/base_test.rb +0 -16
- data/test/breakpoints_test.rb +0 -146
- data/test/examples/break1.rb +0 -23
- data/test/examples/break2.rb +0 -21
- data/test/examples/deep_stepping.rb +0 -9
- data/test/examples/frames.rb +0 -14
- data/test/examples/stepping.rb +0 -29
- data/test/frames_test.rb +0 -58
- data/test/processor_test.rb +0 -40
- data/test/pry_ext_test.rb +0 -4
- data/test/pry_remote_ext_test.rb +0 -4
- data/test/stepping_test.rb +0 -78
- data/test/test_helper.rb +0 -35
data/test/frames_test.rb
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
#
|
4
|
-
# Tests for pry-byebug frame commands.
|
5
|
-
#
|
6
|
-
class FramesTest < MiniTest::Spec
|
7
|
-
let(:output) { StringIO.new }
|
8
|
-
|
9
|
-
before do
|
10
|
-
Pry.color, Pry.pager, Pry.hooks = false, false, Pry::DEFAULT_HOOKS
|
11
|
-
end
|
12
|
-
|
13
|
-
describe 'Up command' do
|
14
|
-
let(:input) { InputTester.new('up', 'down') }
|
15
|
-
|
16
|
-
before do
|
17
|
-
redirect_pry_io(input, output) { load test_file('frames') }
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'shows current line' do
|
21
|
-
output.string.must_match(/=> \s*6: \s*method_b/)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe 'Down command' do
|
26
|
-
let(:input) { InputTester.new('up', 'down') }
|
27
|
-
|
28
|
-
before do
|
29
|
-
redirect_pry_io(input, output) { load test_file('frames') }
|
30
|
-
end
|
31
|
-
|
32
|
-
it 'shows current line' do
|
33
|
-
output.string.must_match(/=> \s*11: \s*end/)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
describe 'Frame command' do
|
38
|
-
before do
|
39
|
-
redirect_pry_io(input, output) { load test_file('frames') }
|
40
|
-
end
|
41
|
-
|
42
|
-
describe 'jump to frame 1' do
|
43
|
-
let(:input) { InputTester.new('frame 1', 'frame 0') }
|
44
|
-
|
45
|
-
it 'shows current line' do
|
46
|
-
output.string.must_match(/=> \s*6: \s*method_b/)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
describe 'jump to current frame' do
|
51
|
-
let(:input) { InputTester.new('frame 0') }
|
52
|
-
|
53
|
-
it 'shows current line' do
|
54
|
-
output.string.must_match(/=> \s*11: \s*end/)
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
data/test/processor_test.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
#
|
4
|
-
# Tests for pry-byebug's processor.
|
5
|
-
#
|
6
|
-
class ProcessorTest < Minitest::Spec
|
7
|
-
before do
|
8
|
-
Pry.color = false
|
9
|
-
Pry.pager = false
|
10
|
-
Pry.hooks = Pry::DEFAULT_HOOKS
|
11
|
-
end
|
12
|
-
|
13
|
-
describe 'Initialization' do
|
14
|
-
let(:step_file) { test_file('stepping') }
|
15
|
-
|
16
|
-
before do
|
17
|
-
Object.send :remove_const, :SteppingExample if defined? SteppingExample
|
18
|
-
@input = InputTester.new
|
19
|
-
@output = StringIO.new
|
20
|
-
redirect_pry_io(@input, @output) { load step_file }
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'stops execution at the first line after binding.pry' do
|
24
|
-
@output.string.must_match(/\=> 6:/)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe 'Initialization at the end of block/method call' do
|
29
|
-
let(:step_file) { test_file('deep_stepping') }
|
30
|
-
|
31
|
-
before do
|
32
|
-
@input, @output = InputTester.new, StringIO.new
|
33
|
-
redirect_pry_io(@input, @output) { load step_file }
|
34
|
-
end
|
35
|
-
|
36
|
-
it 'stops execution at the first line after binding.pry' do
|
37
|
-
@output.string.must_match(/\=> 7:/)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
data/test/pry_ext_test.rb
DELETED
data/test/pry_remote_ext_test.rb
DELETED
data/test/stepping_test.rb
DELETED
@@ -1,78 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
#
|
4
|
-
# Some common specs for stepping
|
5
|
-
#
|
6
|
-
module SteppingSpecs
|
7
|
-
def self.included(spec_class)
|
8
|
-
spec_class.class_eval do
|
9
|
-
it 'shows current line' do
|
10
|
-
@output.string.must_match(/\=> \s*#{@line}:/)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
#
|
17
|
-
# Tests for pry-byebug stepping commands.
|
18
|
-
#
|
19
|
-
class SteppingTest < MiniTest::Spec
|
20
|
-
let(:step_file) { test_file('stepping') }
|
21
|
-
|
22
|
-
before do
|
23
|
-
Object.send :remove_const, :SteppingExample if defined? SteppingExample
|
24
|
-
Pry.color, Pry.pager, Pry.hooks = false, false, Pry::DEFAULT_HOOKS
|
25
|
-
@output = StringIO.new
|
26
|
-
end
|
27
|
-
|
28
|
-
describe 'Step Command' do
|
29
|
-
describe 'single step' do
|
30
|
-
before do
|
31
|
-
@input, @line = InputTester.new('step'), 7
|
32
|
-
redirect_pry_io(@input, @output) { load step_file }
|
33
|
-
end
|
34
|
-
|
35
|
-
include SteppingSpecs
|
36
|
-
end
|
37
|
-
|
38
|
-
describe 'multiple step' do
|
39
|
-
before do
|
40
|
-
@input, @line = InputTester.new('step 2'), 12
|
41
|
-
redirect_pry_io(@input, @output) { load step_file }
|
42
|
-
end
|
43
|
-
|
44
|
-
include SteppingSpecs
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
describe 'Next Command' do
|
49
|
-
describe 'single step' do
|
50
|
-
before do
|
51
|
-
@input, @line = InputTester.new('break --delete-all', 'next'), 6
|
52
|
-
redirect_pry_io(@input, @output) { load step_file }
|
53
|
-
end
|
54
|
-
|
55
|
-
include SteppingSpecs
|
56
|
-
end
|
57
|
-
|
58
|
-
describe 'multiple step' do
|
59
|
-
before do
|
60
|
-
@input, @line = InputTester.new('break --delete-all', 'next 2'), 25
|
61
|
-
redirect_pry_io(@input, @output) { load step_file }
|
62
|
-
end
|
63
|
-
|
64
|
-
include SteppingSpecs
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
describe 'Finish Command' do
|
69
|
-
before do
|
70
|
-
@input = \
|
71
|
-
InputTester.new 'break --delete-all', 'break 19', 'continue', 'finish'
|
72
|
-
redirect_pry_io(@input, @output) { load step_file }
|
73
|
-
@line = 15
|
74
|
-
end
|
75
|
-
|
76
|
-
include SteppingSpecs
|
77
|
-
end
|
78
|
-
end
|
data/test/test_helper.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'pry/test/helper'
|
2
|
-
require 'minitest/autorun'
|
3
|
-
require 'pry-byebug'
|
4
|
-
require 'mocha/setup'
|
5
|
-
|
6
|
-
#
|
7
|
-
# Set I/O streams. Out defaults to an anonymous StringIO.
|
8
|
-
#
|
9
|
-
def redirect_pry_io(new_in, new_out = StringIO.new)
|
10
|
-
old_in, old_out = Pry.input, Pry.output
|
11
|
-
Pry.input, Pry.output = new_in, new_out
|
12
|
-
begin
|
13
|
-
yield
|
14
|
-
ensure
|
15
|
-
Pry.input, Pry.output = old_in, old_out
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_file(name)
|
20
|
-
(Pathname.new(__FILE__) + "../examples/#{name}.rb").cleanpath.to_s
|
21
|
-
end
|
22
|
-
|
23
|
-
#
|
24
|
-
# Simulate pry-byebug's input for testing
|
25
|
-
#
|
26
|
-
class InputTester
|
27
|
-
def initialize(*actions)
|
28
|
-
@orig_actions = actions.dup
|
29
|
-
@actions = actions
|
30
|
-
end
|
31
|
-
|
32
|
-
def readline(*)
|
33
|
-
@actions.shift
|
34
|
-
end
|
35
|
-
end
|