pry-byebug 3.0.1 → 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.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/.rubocop_todo.yml +20 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +3 -3
- data/README.md +8 -0
- data/Rakefile +8 -1
- data/lib/byebug/processors/pry_processor.rb +77 -20
- data/lib/pry-byebug.rb +2 -0
- data/lib/pry-byebug/cli.rb +4 -1
- data/lib/pry-byebug/pry_ext.rb +0 -1
- data/lib/pry-byebug/version.rb +1 -1
- data/lib/pry/byebug/breakpoints.rb +7 -4
- data/lib/pry/commands/breakpoint.rb +2 -5
- data/lib/pry/commands/frames.rb +79 -0
- data/lib/pry/commands/stepping.rb +4 -6
- data/pry-byebug.gemspec +1 -1
- data/test/breakpoints_test.rb +17 -14
- data/test/examples/break1.rb +2 -2
- data/test/examples/deep_stepping.rb +1 -1
- data/test/examples/frames.rb +14 -0
- data/test/examples/stepping.rb +1 -1
- data/test/frames_test.rb +58 -0
- data/test/processor_test.rb +1 -0
- data/test/{commands_test.rb → stepping_test.rb} +3 -2
- metadata +13 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5b8fdd92c518cf1c6800d1c1d1c481c5c0154f4
|
4
|
+
data.tar.gz: 92484d0776f36921b38ff4f89f8a3c867c076544
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac47acea5c530840ecaac8e51dffaf0c0d88ff45f78c1aebbd2ffba67e89461cf0cf9ef400cfdfc7b53b6c1e24ebd9405d24eca1ab90ed70dd37034ffd4d2b8b
|
7
|
+
data.tar.gz: a0f259126736dea8c91727c1a506fc87a4ff94626ae609892cc83e3c68e33eda8ed5767511a027189e8a7c2db4495010f1643f8915b1df95b0c02103ce36f8fe
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# This configuration was generated by `rubocop --auto-gen-config`
|
2
|
+
# on 2015-03-13 12:00:51 -0300 using RuboCop version 0.29.1.
|
3
|
+
# The point is for the user to remove these configuration records
|
4
|
+
# one by one as the offenses are removed from the code base.
|
5
|
+
# Note that changes in the inspected code, or installation of new
|
6
|
+
# versions of RuboCop, may require this file to be generated again.
|
7
|
+
|
8
|
+
# Offense count: 1
|
9
|
+
Metrics/AbcSize:
|
10
|
+
Max: 39
|
11
|
+
|
12
|
+
# Offense count: 1
|
13
|
+
# Configuration parameters: CountComments.
|
14
|
+
Metrics/ClassLength:
|
15
|
+
Max: 142
|
16
|
+
|
17
|
+
# Offense count: 1
|
18
|
+
# Configuration parameters: CountComments.
|
19
|
+
Metrics/MethodLength:
|
20
|
+
Max: 23
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -2,13 +2,13 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem 'rake', '~> 10.
|
5
|
+
gem 'rake', '~> 10.4'
|
6
6
|
|
7
7
|
group :development do
|
8
|
-
gem 'rubocop', '
|
8
|
+
gem 'rubocop', '0.29.1'
|
9
9
|
end
|
10
10
|
|
11
11
|
group :test do
|
12
12
|
gem 'mocha', '~> 1.1'
|
13
|
-
gem 'minitest', '~> 5.
|
13
|
+
gem 'minitest', '~> 5.5'
|
14
14
|
end
|
data/README.md
CHANGED
@@ -51,6 +51,14 @@ optional numeric argument to step multiple lines.
|
|
51
51
|
|
52
52
|
**continue:** Continue program execution and end the Pry session.
|
53
53
|
|
54
|
+
**up:** Moves the stack frame up. Takes an optional numeric argument to move
|
55
|
+
multiple frames.
|
56
|
+
|
57
|
+
**down:** Moves the stack frame down. Takes an optional numeric argument to move
|
58
|
+
multiple frames.
|
59
|
+
|
60
|
+
**frame:** Moves to a specific frame. Called without arguments will show the
|
61
|
+
current frame.
|
54
62
|
|
55
63
|
## Matching Byebug Behaviour
|
56
64
|
|
data/Rakefile
CHANGED
@@ -1,10 +1,17 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
|
+
|
2
3
|
require 'rake/testtask'
|
3
4
|
|
4
5
|
desc 'Run tests'
|
5
6
|
Rake::TestTask.new(:test) do |t|
|
6
7
|
t.libs << 'test'
|
8
|
+
t.ruby_opts += ['-w']
|
7
9
|
t.pattern = 'test/**/*_test.rb'
|
8
10
|
end
|
9
11
|
|
10
|
-
|
12
|
+
require 'rubocop/rake_task'
|
13
|
+
|
14
|
+
desc 'Run RuboCop'
|
15
|
+
task(:rubocop) { RuboCop::RakeTask.new }
|
16
|
+
|
17
|
+
task default: [:test, :rubocop]
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'pry'
|
2
1
|
require 'byebug'
|
3
2
|
|
4
3
|
module Byebug
|
@@ -7,11 +6,17 @@ module Byebug
|
|
7
6
|
#
|
8
7
|
class PryProcessor < Processor
|
9
8
|
attr_accessor :pry
|
9
|
+
attr_reader :state
|
10
|
+
|
11
|
+
extend Forwardable
|
12
|
+
def_delegators :@pry, :output
|
13
|
+
def_delegators Pry::Helpers::Text, :bold
|
10
14
|
|
11
15
|
def initialize(interface = LocalInterface.new)
|
12
16
|
super(interface)
|
13
17
|
|
14
18
|
Byebug.handler = self
|
19
|
+
Byebug::Setting[:autolist] = false
|
15
20
|
end
|
16
21
|
|
17
22
|
def start
|
@@ -23,6 +28,14 @@ module Byebug
|
|
23
28
|
# Wrap a Pry REPL to catch navigational commands and act on them.
|
24
29
|
#
|
25
30
|
def run(&_block)
|
31
|
+
@state ||= Byebug::RegularState.new(
|
32
|
+
Byebug.current_context,
|
33
|
+
[],
|
34
|
+
Byebug.current_context.frame_file,
|
35
|
+
interface,
|
36
|
+
Byebug.current_context.frame_line
|
37
|
+
)
|
38
|
+
|
26
39
|
return_value = nil
|
27
40
|
|
28
41
|
command = catch(:breakout_nav) do # Throws from PryByebug::Commands
|
@@ -33,7 +46,7 @@ module Byebug
|
|
33
46
|
# Pry instance to resume after stepping
|
34
47
|
@pry = command[:pry]
|
35
48
|
|
36
|
-
perform(command[:action],
|
49
|
+
perform(command[:action], command[:options])
|
37
50
|
|
38
51
|
return_value
|
39
52
|
end
|
@@ -41,15 +54,12 @@ module Byebug
|
|
41
54
|
#
|
42
55
|
# Set up a number of navigational commands to be performed by Byebug.
|
43
56
|
#
|
44
|
-
def perform(action,
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
when :finish
|
51
|
-
Byebug.current_context.step_out(times)
|
52
|
-
end
|
57
|
+
def perform(action, options = {})
|
58
|
+
return unless [
|
59
|
+
:next, :step, :finish, :up, :down, :frame
|
60
|
+
].include?(action)
|
61
|
+
|
62
|
+
send("perform_#{action}", options)
|
53
63
|
end
|
54
64
|
|
55
65
|
# --- Callbacks from byebug C extension ---
|
@@ -76,34 +86,81 @@ module Byebug
|
|
76
86
|
def at_breakpoint(_context, breakpoint)
|
77
87
|
@pry ||= Pry.new
|
78
88
|
|
79
|
-
|
80
|
-
@pry.output.print Pry::Helpers::Text.bold(brkpt_num)
|
81
|
-
|
82
|
-
n_hits = breakpoint.hit_count
|
83
|
-
@pry.output.puts(n_hits == 1 ? 'First hit' : "Hit #{n_hits} times.")
|
89
|
+
output.puts bold("\n Breakpoint #{breakpoint.id}. ") + n_hits(breakpoint)
|
84
90
|
|
85
91
|
expr = breakpoint.expr
|
86
92
|
return unless expr
|
87
93
|
|
88
|
-
|
89
|
-
@pry.output.puts expr
|
94
|
+
output.puts bold('Condition: ') + expr
|
90
95
|
end
|
91
96
|
|
92
97
|
private
|
93
98
|
|
99
|
+
def n_hits(breakpoint)
|
100
|
+
n_hits = breakpoint.hit_count
|
101
|
+
|
102
|
+
n_hits == 1 ? 'First hit' : "Hit #{n_hits} times."
|
103
|
+
end
|
104
|
+
|
94
105
|
#
|
95
106
|
# Resume an existing Pry REPL at the paused point.
|
96
107
|
#
|
97
108
|
def resume_pry(context)
|
98
|
-
|
109
|
+
frame_position = state ? state.frame : 0
|
110
|
+
|
111
|
+
new_binding = context.frame_binding(frame_position)
|
99
112
|
|
100
113
|
run do
|
101
|
-
if @pry
|
114
|
+
if defined?(@pry) && @pry
|
102
115
|
@pry.repl(new_binding)
|
103
116
|
else
|
104
117
|
@pry = Pry.start_without_pry_byebug(new_binding)
|
105
118
|
end
|
106
119
|
end
|
107
120
|
end
|
121
|
+
|
122
|
+
def perform_next(options)
|
123
|
+
lines = (options[:lines] || 1).to_i
|
124
|
+
state.context.step_over(lines, state.frame)
|
125
|
+
end
|
126
|
+
|
127
|
+
def perform_step(options)
|
128
|
+
times = (options[:times] || 1).to_i
|
129
|
+
state.context.step_into(times, state.frame)
|
130
|
+
end
|
131
|
+
|
132
|
+
def perform_finish(*)
|
133
|
+
state.context.step_out(1)
|
134
|
+
end
|
135
|
+
|
136
|
+
def perform_up(options)
|
137
|
+
times = (options[:times] || 1).to_i
|
138
|
+
|
139
|
+
command = Byebug::UpCommand.new(state)
|
140
|
+
command.match("up #{times}")
|
141
|
+
command.execute
|
142
|
+
|
143
|
+
resume_pry(state.context)
|
144
|
+
end
|
145
|
+
|
146
|
+
def perform_down(options)
|
147
|
+
times = (options[:times] || 1).to_i
|
148
|
+
|
149
|
+
command = Byebug::DownCommand.new(state)
|
150
|
+
command.match("down #{times}")
|
151
|
+
command.execute
|
152
|
+
|
153
|
+
resume_pry(state.context)
|
154
|
+
end
|
155
|
+
|
156
|
+
def perform_frame(options)
|
157
|
+
index = options[:index] ? options[:index].to_i : ''
|
158
|
+
|
159
|
+
command = Byebug::FrameCommand.new(state)
|
160
|
+
command.match("frame #{index}")
|
161
|
+
command.execute
|
162
|
+
|
163
|
+
resume_pry(state.context)
|
164
|
+
end
|
108
165
|
end
|
109
166
|
end
|
data/lib/pry-byebug.rb
CHANGED
data/lib/pry-byebug/cli.rb
CHANGED
data/lib/pry-byebug/pry_ext.rb
CHANGED
data/lib/pry-byebug/version.rb
CHANGED
@@ -84,8 +84,11 @@ class Pry
|
|
84
84
|
# Deletes an existing breakpoint with the given ID.
|
85
85
|
#
|
86
86
|
def delete(id)
|
87
|
-
deleted =
|
88
|
-
::Byebug
|
87
|
+
deleted =
|
88
|
+
::Byebug.started? &&
|
89
|
+
::Byebug::Breakpoint.remove(id) &&
|
90
|
+
breakpoints.delete(find_by_id(id))
|
91
|
+
|
89
92
|
fail(ArgumentError, "No breakpoint ##{id}") unless deleted
|
90
93
|
end
|
91
94
|
|
@@ -147,8 +150,8 @@ class Pry
|
|
147
150
|
end
|
148
151
|
|
149
152
|
def validate_expression(exp)
|
150
|
-
|
151
|
-
|
153
|
+
valid = exp && (exp.empty? || !Pry::Code.complete_expression?(exp))
|
154
|
+
return unless valid
|
152
155
|
|
153
156
|
fail("Invalid breakpoint conditional: #{expression}")
|
154
157
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'pry'
|
2
1
|
require 'pry/byebug/breakpoints'
|
3
2
|
|
4
3
|
#
|
@@ -57,8 +56,7 @@ class Pry
|
|
57
56
|
all.each do |option|
|
58
57
|
next unless opts.present?(option)
|
59
58
|
|
60
|
-
|
61
|
-
return send(method_name)
|
59
|
+
return send("process_#{option.gsub('-', '_')}")
|
62
60
|
end
|
63
61
|
|
64
62
|
new_breakpoint unless args.empty?
|
@@ -141,7 +139,6 @@ class Pry
|
|
141
139
|
else
|
142
140
|
print_breakpoints_header
|
143
141
|
breakpoints.each { |b| print_short_breakpoint(b) }
|
144
|
-
output.puts
|
145
142
|
end
|
146
143
|
end
|
147
144
|
end
|
@@ -186,7 +183,7 @@ class Pry
|
|
186
183
|
# Print out concise information about a breakpoint.
|
187
184
|
#
|
188
185
|
def print_short_breakpoint(breakpoint)
|
189
|
-
id =
|
186
|
+
id = format('%*d', max_width, breakpoint.id)
|
190
187
|
status = breakpoint.enabled? ? 'Yes' : 'No'
|
191
188
|
expr = breakpoint.expr ? breakpoint.expr : ''
|
192
189
|
|
@@ -0,0 +1,79 @@
|
|
1
|
+
#
|
2
|
+
# Main Pry class.
|
3
|
+
#
|
4
|
+
# We're going to add to it custom frame commands for Pry-Byebug
|
5
|
+
#
|
6
|
+
class Pry
|
7
|
+
FrameCommands = CommandSet.new do
|
8
|
+
create_command 'up' do
|
9
|
+
description 'Move current frame up.'
|
10
|
+
|
11
|
+
banner <<-BANNER
|
12
|
+
Usage: up [TIMES]
|
13
|
+
|
14
|
+
Move current frame up. By default, moves by 1 frame.
|
15
|
+
|
16
|
+
Examples:
|
17
|
+
up #=> Move up 1 frame.
|
18
|
+
up 5 #=> Move up 5 frames.
|
19
|
+
BANNER
|
20
|
+
|
21
|
+
def process
|
22
|
+
PryByebug.check_file_context(target)
|
23
|
+
|
24
|
+
frame_navigation :up, times: args.first
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
create_command 'down' do
|
29
|
+
description 'Move current frame down.'
|
30
|
+
|
31
|
+
banner <<-BANNER
|
32
|
+
Usage: down [TIMES]
|
33
|
+
|
34
|
+
Move current frame down. By default, moves by 1 frame.
|
35
|
+
|
36
|
+
Examples:
|
37
|
+
down #=> Move down 1 frame.
|
38
|
+
down 5 #=> Move down 5 frames.
|
39
|
+
BANNER
|
40
|
+
|
41
|
+
def process
|
42
|
+
PryByebug.check_file_context(target)
|
43
|
+
|
44
|
+
frame_navigation :down, times: args.first
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
create_command 'frame' do
|
49
|
+
description 'Move to specified frame #.'
|
50
|
+
|
51
|
+
banner <<-BANNER
|
52
|
+
Usage: frame [TIMES]
|
53
|
+
|
54
|
+
Move to specified frame #.
|
55
|
+
|
56
|
+
Examples:
|
57
|
+
frame #=> Show current frame #.
|
58
|
+
frame 5 #=> Move to frame 5.
|
59
|
+
BANNER
|
60
|
+
|
61
|
+
def process
|
62
|
+
PryByebug.check_file_context(target)
|
63
|
+
|
64
|
+
frame_navigation :frame, index: args.first
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
helpers do
|
69
|
+
def frame_navigation(action, options = {})
|
70
|
+
_pry_.binding_stack.clear # Clear the binding stack.
|
71
|
+
|
72
|
+
# Break out of the REPL loop and signal tracer
|
73
|
+
throw :breakout_nav, action: action, options: options, pry: _pry_
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
Pry.commands.import(FrameCommands)
|
79
|
+
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'pry'
|
2
|
-
|
3
1
|
#
|
4
2
|
# Main Pry class.
|
5
3
|
#
|
@@ -23,7 +21,7 @@ class Pry
|
|
23
21
|
def process
|
24
22
|
PryByebug.check_file_context(target)
|
25
23
|
|
26
|
-
breakout_navigation :step, args.first
|
24
|
+
breakout_navigation :step, times: args.first
|
27
25
|
end
|
28
26
|
end
|
29
27
|
|
@@ -44,7 +42,7 @@ class Pry
|
|
44
42
|
def process
|
45
43
|
PryByebug.check_file_context(target)
|
46
44
|
|
47
|
-
breakout_navigation :next, args.first
|
45
|
+
breakout_navigation :next, lines: args.first
|
48
46
|
end
|
49
47
|
end
|
50
48
|
|
@@ -77,11 +75,11 @@ class Pry
|
|
77
75
|
end
|
78
76
|
|
79
77
|
helpers do
|
80
|
-
def breakout_navigation(action,
|
78
|
+
def breakout_navigation(action, options = {})
|
81
79
|
_pry_.binding_stack.clear # Clear the binding stack.
|
82
80
|
|
83
81
|
# Break out of the REPL loop and signal tracer
|
84
|
-
throw :breakout_nav, action: action,
|
82
|
+
throw :breakout_nav, action: action, options: options, pry: _pry_
|
85
83
|
end
|
86
84
|
end
|
87
85
|
end
|
data/pry-byebug.gemspec
CHANGED
data/test/breakpoints_test.rb
CHANGED
@@ -52,8 +52,10 @@ module BreakpointSpecs
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def test_shows_breakpoint_hit
|
55
|
-
|
56
|
-
|
55
|
+
result = @output.string
|
56
|
+
result.must_match(@regexp)
|
57
|
+
match = result.match(@regexp)
|
58
|
+
result.must_match(/^ Breakpoint #{match[:id]}\. First hit/)
|
57
59
|
end
|
58
60
|
|
59
61
|
def test_shows_breakpoint_line
|
@@ -70,21 +72,22 @@ class BreakpointsTestCommands < Minitest::Spec
|
|
70
72
|
|
71
73
|
before do
|
72
74
|
Pry.color, Pry.pager, Pry.hooks = false, false, Pry::DEFAULT_HOOKS
|
75
|
+
@input = InputTester.new 'break --delete-all'
|
76
|
+
redirect_pry_io(@input, StringIO.new) do
|
77
|
+
binding.pry # rubocop:disable Lint/Debugger
|
78
|
+
end
|
79
|
+
Object.send :remove_const, :Break1Example if defined? Break1Example
|
80
|
+
Object.send :remove_const, :Break2Example if defined? Break2Example
|
73
81
|
@output = StringIO.new
|
74
82
|
end
|
75
83
|
|
76
84
|
describe 'Set Breakpoints' do
|
77
|
-
before do
|
78
|
-
@input = InputTester.new 'break --delete-all'
|
79
|
-
redirect_pry_io(@input, @output) { load break_first_file }
|
80
|
-
end
|
81
|
-
|
82
85
|
describe 'set by line number' do
|
83
86
|
before do
|
84
|
-
@input = InputTester.new('break
|
87
|
+
@input = InputTester.new('break 6')
|
85
88
|
redirect_pry_io(@input, @output) { load break_first_file }
|
86
|
-
@line =
|
87
|
-
@regexp = / Breakpoint (?<id>\d+): #{break_first_file} @
|
89
|
+
@line = 6
|
90
|
+
@regexp = / Breakpoint (?<id>\d+): #{break_first_file} @ 6 \(Enabled\)/
|
88
91
|
end
|
89
92
|
|
90
93
|
include BreakpointSpecs
|
@@ -94,7 +97,7 @@ class BreakpointsTestCommands < Minitest::Spec
|
|
94
97
|
before do
|
95
98
|
@input = InputTester.new('break Break1Example#a')
|
96
99
|
redirect_pry_io(@input, @output) { load break_first_file }
|
97
|
-
@line =
|
100
|
+
@line = 5
|
98
101
|
@regexp = / Breakpoint (?<id>\d+): Break1Example#a \(Enabled\)/
|
99
102
|
end
|
100
103
|
|
@@ -105,7 +108,7 @@ class BreakpointsTestCommands < Minitest::Spec
|
|
105
108
|
before do
|
106
109
|
@input = InputTester.new('break Break1Example#c!')
|
107
110
|
redirect_pry_io(@input, @output) { load break_first_file }
|
108
|
-
@line =
|
111
|
+
@line = 15
|
109
112
|
@regexp = / Breakpoint (?<id>\d+): Break1Example#c! \(Enabled\)/
|
110
113
|
end
|
111
114
|
|
@@ -116,7 +119,7 @@ class BreakpointsTestCommands < Minitest::Spec
|
|
116
119
|
before do
|
117
120
|
@input = InputTester.new('break #b')
|
118
121
|
redirect_pry_io(@input, @output) { load break_second_file }
|
119
|
-
@line =
|
122
|
+
@line = 7
|
120
123
|
@regexp = / Breakpoint (?<id>\d+): Break2Example#b \(Enabled\)/
|
121
124
|
end
|
122
125
|
|
@@ -126,7 +129,7 @@ class BreakpointsTestCommands < Minitest::Spec
|
|
126
129
|
|
127
130
|
describe 'List breakpoints' do
|
128
131
|
before do
|
129
|
-
@input = InputTester.new('break
|
132
|
+
@input = InputTester.new('break #b', 'breakpoints')
|
130
133
|
redirect_pry_io(@input, @output) { load break_second_file }
|
131
134
|
end
|
132
135
|
|
data/test/examples/break1.rb
CHANGED
data/test/examples/stepping.rb
CHANGED
data/test/frames_test.rb
ADDED
@@ -0,0 +1,58 @@
|
|
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
CHANGED
@@ -14,6 +14,7 @@ class ProcessorTest < Minitest::Spec
|
|
14
14
|
let(:step_file) { test_file('stepping') }
|
15
15
|
|
16
16
|
before do
|
17
|
+
Object.send :remove_const, :SteppingExample if defined? SteppingExample
|
17
18
|
@input = InputTester.new
|
18
19
|
@output = StringIO.new
|
19
20
|
redirect_pry_io(@input, @output) { load step_file }
|
@@ -14,12 +14,13 @@ module SteppingSpecs
|
|
14
14
|
end
|
15
15
|
|
16
16
|
#
|
17
|
-
# Tests for pry-byebug commands.
|
17
|
+
# Tests for pry-byebug stepping commands.
|
18
18
|
#
|
19
|
-
class
|
19
|
+
class SteppingTest < MiniTest::Spec
|
20
20
|
let(:step_file) { test_file('stepping') }
|
21
21
|
|
22
22
|
before do
|
23
|
+
Object.send :remove_const, :SteppingExample if defined? SteppingExample
|
23
24
|
Pry.color, Pry.pager, Pry.hooks = false, false, Pry::DEFAULT_HOOKS
|
24
25
|
@output = StringIO.new
|
25
26
|
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: 3.0
|
4
|
+
version: 3.1.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: 2015-
|
12
|
+
date: 2015-03-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pry
|
@@ -31,14 +31,14 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
34
|
+
version: '4.0'
|
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: '4.0'
|
42
42
|
description: |-
|
43
43
|
Combine 'pry' with 'byebug'. Adds 'step', 'next',
|
44
44
|
'finish', 'continue' and 'break' commands to control execution.
|
@@ -49,6 +49,7 @@ extra_rdoc_files: []
|
|
49
49
|
files:
|
50
50
|
- ".gitignore"
|
51
51
|
- ".rubocop.yml"
|
52
|
+
- ".rubocop_todo.yml"
|
52
53
|
- ".travis.yml"
|
53
54
|
- CHANGELOG.md
|
54
55
|
- Gemfile
|
@@ -64,18 +65,21 @@ files:
|
|
64
65
|
- lib/pry-byebug/version.rb
|
65
66
|
- lib/pry/byebug/breakpoints.rb
|
66
67
|
- lib/pry/commands/breakpoint.rb
|
68
|
+
- lib/pry/commands/frames.rb
|
67
69
|
- lib/pry/commands/stepping.rb
|
68
70
|
- pry-byebug.gemspec
|
69
71
|
- test/base_test.rb
|
70
72
|
- test/breakpoints_test.rb
|
71
|
-
- test/commands_test.rb
|
72
73
|
- test/examples/break1.rb
|
73
74
|
- test/examples/break2.rb
|
74
75
|
- test/examples/deep_stepping.rb
|
76
|
+
- test/examples/frames.rb
|
75
77
|
- test/examples/stepping.rb
|
78
|
+
- test/frames_test.rb
|
76
79
|
- test/processor_test.rb
|
77
80
|
- test/pry_ext_test.rb
|
78
81
|
- test/pry_remote_ext_test.rb
|
82
|
+
- test/stepping_test.rb
|
79
83
|
- test/test_helper.rb
|
80
84
|
homepage: https://github.com/deivid-rodriguez/pry-byebug
|
81
85
|
licenses:
|
@@ -97,19 +101,21 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
101
|
version: '0'
|
98
102
|
requirements: []
|
99
103
|
rubyforge_project:
|
100
|
-
rubygems_version: 2.4.
|
104
|
+
rubygems_version: 2.4.6
|
101
105
|
signing_key:
|
102
106
|
specification_version: 4
|
103
107
|
summary: Fast debugging with Pry.
|
104
108
|
test_files:
|
105
109
|
- test/base_test.rb
|
106
110
|
- test/breakpoints_test.rb
|
107
|
-
- test/commands_test.rb
|
108
111
|
- test/examples/break1.rb
|
109
112
|
- test/examples/break2.rb
|
110
113
|
- test/examples/deep_stepping.rb
|
114
|
+
- test/examples/frames.rb
|
111
115
|
- test/examples/stepping.rb
|
116
|
+
- test/frames_test.rb
|
112
117
|
- test/processor_test.rb
|
113
118
|
- test/pry_ext_test.rb
|
114
119
|
- test/pry_remote_ext_test.rb
|
120
|
+
- test/stepping_test.rb
|
115
121
|
- test/test_helper.rb
|