pry-byebug 1.3.3 → 2.0.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/.rubocop.yml +2 -0
- data/CHANGELOG.md +9 -0
- data/Gemfile +8 -3
- data/README.md +30 -38
- data/lib/pry-byebug/base.rb +4 -4
- data/lib/pry-byebug/breakpoints.rb +44 -30
- data/lib/pry-byebug/cli.rb +1 -1
- data/lib/pry-byebug/commands.rb +115 -87
- data/lib/pry-byebug/processor.rb +64 -86
- data/lib/pry-byebug/pry_remote_ext.rb +11 -12
- data/lib/pry-byebug/version.rb +1 -1
- data/pry-byebug.gemspec +3 -3
- data/test/base_test.rb +5 -3
- data/test/breakpoints_test.rb +102 -3
- data/test/commands_test.rb +35 -136
- data/test/examples/break1.rb +9 -6
- data/test/examples/break2.rb +7 -4
- data/test/examples/stepping.rb +12 -8
- data/test/processor_test.rb +22 -2
- data/test/pry_ext_test.rb +0 -2
- data/test/pry_remote_ext_test.rb +0 -2
- data/test/test_helper.rb +12 -11
- metadata +8 -7
data/test/examples/break1.rb
CHANGED
@@ -1,20 +1,23 @@
|
|
1
1
|
binding.pry
|
2
2
|
|
3
|
-
|
3
|
+
#
|
4
|
+
# A toy example for testing break commands.
|
5
|
+
#
|
6
|
+
class Break1Example
|
4
7
|
def a
|
5
8
|
z = 2
|
6
|
-
b
|
9
|
+
z + b
|
7
10
|
end
|
8
11
|
|
9
12
|
def b
|
10
|
-
|
11
|
-
c!
|
13
|
+
z = 5
|
14
|
+
z + c!
|
12
15
|
end
|
13
16
|
|
14
17
|
def c!
|
15
18
|
z = 4
|
16
|
-
|
19
|
+
z
|
17
20
|
end
|
18
21
|
end
|
19
22
|
|
20
|
-
|
23
|
+
Break1Example.new.a
|
data/test/examples/break2.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
-
|
1
|
+
#
|
2
|
+
# Another toy example for testing break commands.
|
3
|
+
#
|
4
|
+
class Break2Example
|
2
5
|
def a
|
3
6
|
binding.pry
|
4
7
|
z = 2
|
5
|
-
b
|
8
|
+
z + b
|
6
9
|
end
|
7
10
|
|
8
11
|
def b
|
@@ -11,8 +14,8 @@ class BreakExample
|
|
11
14
|
|
12
15
|
def c
|
13
16
|
z = 4
|
14
|
-
5
|
17
|
+
z + 5
|
15
18
|
end
|
16
19
|
end
|
17
20
|
|
18
|
-
|
21
|
+
Break2Example.new.a
|
data/test/examples/stepping.rb
CHANGED
@@ -1,23 +1,27 @@
|
|
1
1
|
binding.pry
|
2
2
|
|
3
|
+
#
|
4
|
+
# Toy class for testing steps
|
5
|
+
#
|
3
6
|
class SteppingExample
|
4
|
-
def
|
7
|
+
def method_a
|
5
8
|
z = 2
|
6
|
-
|
9
|
+
z + method_b
|
7
10
|
end
|
8
11
|
|
9
|
-
def
|
10
|
-
|
11
|
-
c
|
12
|
+
def method_b
|
13
|
+
c = Math::PI / 2
|
14
|
+
c += method_c
|
15
|
+
c + 1
|
12
16
|
end
|
13
17
|
|
14
|
-
def
|
18
|
+
def method_c
|
15
19
|
z = 4
|
16
|
-
|
20
|
+
z
|
17
21
|
end
|
18
22
|
end
|
19
23
|
|
20
|
-
ex = SteppingExample.new.
|
24
|
+
ex = SteppingExample.new.method_a
|
21
25
|
2.times do
|
22
26
|
ex += 1
|
23
27
|
end
|
data/test/processor_test.rb
CHANGED
@@ -1,6 +1,26 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
|
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
|
4
12
|
|
5
|
-
|
13
|
+
describe 'Initialization' do
|
14
|
+
let(:step_file) { test_file('stepping') }
|
15
|
+
|
16
|
+
before do
|
17
|
+
@input = InputTester.new
|
18
|
+
@output = StringIO.new
|
19
|
+
redirect_pry_io(@input, @output) { load step_file }
|
20
|
+
end
|
6
21
|
|
22
|
+
it 'stops execution at the first line after binding.pry' do
|
23
|
+
@output.string.must_match(/\=> 6:/)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/test/pry_ext_test.rb
CHANGED
data/test/pry_remote_ext_test.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -3,21 +3,26 @@ require 'minitest/autorun'
|
|
3
3
|
require 'pry-byebug'
|
4
4
|
require 'mocha/setup'
|
5
5
|
|
6
|
+
#
|
6
7
|
# Set I/O streams. Out defaults to an anonymous StringIO.
|
8
|
+
#
|
7
9
|
def redirect_pry_io(new_in, new_out = StringIO.new)
|
8
|
-
old_in = Pry.input
|
9
|
-
|
10
|
-
|
11
|
-
Pry.input = new_in
|
12
|
-
Pry.output = new_out
|
10
|
+
old_in, old_out = Pry.input, Pry.output
|
11
|
+
Pry.input, Pry.output = new_in, new_out
|
13
12
|
begin
|
14
13
|
yield
|
15
14
|
ensure
|
16
|
-
Pry.input = old_in
|
17
|
-
Pry.output = old_out
|
15
|
+
Pry.input, Pry.output = old_in, old_out
|
18
16
|
end
|
19
17
|
end
|
20
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
|
+
#
|
21
26
|
class InputTester
|
22
27
|
def initialize(*actions)
|
23
28
|
@orig_actions = actions.dup
|
@@ -27,8 +32,4 @@ class InputTester
|
|
27
32
|
def readline(*)
|
28
33
|
@actions.shift
|
29
34
|
end
|
30
|
-
|
31
|
-
def rewind
|
32
|
-
@actions = @orig_actions.dup
|
33
|
-
end
|
34
35
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry-byebug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Rodríguez
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-09-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pry
|
@@ -31,23 +31,24 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
34
|
+
version: '3.4'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
41
|
+
version: '3.4'
|
42
42
|
description: |-
|
43
|
-
Combine 'pry' with 'byebug'. Adds 'step', 'next',
|
44
|
-
|
43
|
+
Combine 'pry' with 'byebug'. Adds 'step', 'next',
|
44
|
+
'finish', 'continue' and 'break' commands to control execution.
|
45
45
|
email: deivid.rodriguez@gmail.com
|
46
46
|
executables: []
|
47
47
|
extensions: []
|
48
48
|
extra_rdoc_files: []
|
49
49
|
files:
|
50
50
|
- ".gitignore"
|
51
|
+
- ".rubocop.yml"
|
51
52
|
- ".travis.yml"
|
52
53
|
- CHANGELOG.md
|
53
54
|
- Gemfile
|
@@ -94,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
95
|
version: '0'
|
95
96
|
requirements: []
|
96
97
|
rubyforge_project:
|
97
|
-
rubygems_version: 2.
|
98
|
+
rubygems_version: 2.4.1
|
98
99
|
signing_key:
|
99
100
|
specification_version: 4
|
100
101
|
summary: Fast debugging with Pry.
|