pry-byebug 1.0.0 → 1.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c079446464cffea15a38fd173ef57ef076bf9002
4
- data.tar.gz: 38c27e09ca3c57a6a1e322e49589a47e0316d301
3
+ metadata.gz: e1e394709d63ed2099ec627d75981a29885c9641
4
+ data.tar.gz: 1a79cdd78a21fde30ff264adcbeeec8c96af877c
5
5
  SHA512:
6
- metadata.gz: 3750ce1963ae9660c470a81afbea8864e3cb79297278816468c2fadf779f968c7033f49da92aa7e67863c95215dd0c0952067ac4d1680df9bbd221e1de603cd9
7
- data.tar.gz: 27c62f7240695a1596a0c508211529f577ac6f9c6dcd6b5e91ab66132525c3e5d6a2e710b954b6f12c7ac28288b59ec8dbf9a38f3a36780f2c7a68933837996c
6
+ metadata.gz: 083288cd0f862524132bda50de9ac708ee173e39718bb0594ca176c043cfc49cd35eca27c8ed69b67d3ad70c5d5a3d2ff10e99ffd89c77f4ba509beb2ee7e0ff
7
+ data.tar.gz: 3c0224f0d2895b5f60745ef89d672fc0cc11ac260ddb19ce81ac139f5c9146d3b8615d1ddb9a6610150a01225e832884f541ce91fd77f7720828a9e85fc9db22
data/.gitignore CHANGED
@@ -1,18 +1,17 @@
1
- *.gem
2
- *.rbc
1
+ tmp
2
+ pkg
3
+ doc
4
+
3
5
  .bundle
4
6
  .config
5
7
  .yardoc
6
8
  .gdb_history
9
+ .ruby-gemset
10
+ .ruby-version
11
+
7
12
  Gemfile.lock
8
13
  InstalledFiles
9
14
  _yardoc
10
15
  coverage
11
- doc/
12
16
  lib/bundler/man
13
- pkg
14
17
  rdoc
15
- spec/reports
16
- test/tmp
17
- test/version_tmp
18
- tmp
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ rvm:
2
+ - 2.0.0
3
+ - ruby-head
4
+ matrix:
5
+ allow_failures:
6
+ - rvm: ruby-head
data/CHANGELOG.md CHANGED
@@ -1,7 +1,22 @@
1
- ## 1.0.0 (2013-05-07)
1
+ ## 1.1.1 (2013-02-07)
2
+
3
+ * Adds some initial tests to the test suite
4
+ * Fixes bug when doing "step n" or "next n" where n > 1 right after binding.pry
5
+
6
+
7
+ ## 1.1.0 (2013-06-06)
8
+
9
+ * Adds a test suite (thanks @teeparham!)
10
+ * Uses byebug ~> 1.4.0
11
+ * Uses s, n, f and c aliases by default (thanks @jgakos!)
12
+
13
+
14
+ ## 1.0.0, 1.0.1 (2013-05-07)
2
15
 
3
16
  * Forked from [pry-debugger](https://github.com/nixme/pry-debugger) to support
4
17
  byebug
18
+ * Dropped pry-remote support
19
+
5
20
 
6
21
  ## 0.2.2 (2013-03-07)
7
22
 
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source 'http://rubygems.org'
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
- pry-byebug
1
+ pry-byebug [![Gem Version][1]][2] [![Build Status][3]][4]
2
2
  ============
3
3
 
4
4
  _Fast execution control in Pry_
5
5
 
6
- Adds **step**, **next**, **finish**, and **continue** commands and
6
+ Adds **step**, **next**, **finish** and **continue** commands and
7
7
  **breakpoints** to [Pry][pry] using [byebug][byebug].
8
8
 
9
9
  To use, invoke pry normally. No need to start your script or app differently.
@@ -19,17 +19,33 @@ For a complete debugging environment, add
19
19
  [pry-stack_explorer][pry-stack_explorer] for call-stack frame navigation.
20
20
 
21
21
 
22
+ ## Installation
23
+
24
+ Drop
25
+
26
+ ```ruby
27
+ gem 'pry-byebug'
28
+ ```
29
+
30
+ in your Gemfile and run
31
+
32
+ bundle install
33
+
34
+ _Make sure you include the gem globally or inside the `:test` group if you plan
35
+ to use it to debug your tests!_
36
+
37
+
22
38
  ## Execution Commands
23
39
 
24
40
  **step:** Step execution into the next line or method. Takes an optional numeric
25
- argument to step multiple times.
41
+ argument to step multiple times. Aliased to `s`
26
42
 
27
43
  **next:** Step over to the next line within the same frame. Also takes an
28
- optional numeric argument to step multiple lines.
44
+ optional numeric argument to step multiple lines. Aliased to `n`
29
45
 
30
- **finish:** Execute until current stack frame returns.
46
+ **finish:** Execute until current stack frame returns. Aliased to `f`
31
47
 
32
- **continue:** Continue program execution and end the Pry session.
48
+ **continue:** Continue program execution and end the Pry session. Aliased to `c`
33
49
 
34
50
 
35
51
  ## Breakpoints
@@ -68,59 +84,12 @@ the source code around each breakpoint.
68
84
 
69
85
  ## Caveats
70
86
 
71
- **pry-byebug** is not yet thread-safe, so only use in single-threaded
72
- environments.
73
-
74
- Only supports MRI 1.9.2 and 1.9.3. For a pure ruby approach not reliant on
75
- [byebug][byebug], check out [pry-nav][pry-nav]. Note: *pry-nav* and
76
- *pry-byebug* cannot be loaded together.
77
-
78
-
79
- ## Remote debugging
80
-
81
- Support for [pry-remote][pry-remote] (>= 0.1.4) is also included. Requires
82
- explicity requiring *pry-byebug*, not just relying on pry's plugin loader.
83
-
84
- Want to debug a Rails app running inside [foreman][foreman]? Add to your
85
- Gemfile:
86
-
87
- ```ruby
88
- gem 'pry'
89
- gem 'pry-remote'
90
- gem 'pry-stack_explorer'
91
- gem 'pry-byebug'
92
- ```
93
-
94
- Then add `binding.remote_pry` where you want to pause:
95
-
96
- ```ruby
97
- class UsersController < ApplicationController
98
- def index
99
- binding.remote_pry
100
- ...
101
- end
102
- end
103
- ```
104
-
105
- Load a page that triggers the code. Connect to the session:
106
-
107
- ```
108
- $ bundle exec pry-remote
109
- ```
110
-
111
- Using Pry with Rails? Check out [Jazz Hands][jazz_hands].
87
+ Only supports MRI 2.0.0 or newer.
112
88
 
113
89
 
114
90
  ## Tips
115
91
 
116
- Stepping through code often? Add the following shortcuts to `~/.pryrc`:
117
-
118
- ```ruby
119
- Pry.commands.alias_command 'c', 'continue'
120
- Pry.commands.alias_command 's', 'step'
121
- Pry.commands.alias_command 'n', 'next'
122
- Pry.commands.alias_command 'f', 'finish'
123
- ```
92
+ Using Pry with Rails? Check out [Jazz Hands][jazz_hands].
124
93
 
125
94
 
126
95
  ## Contributors
@@ -135,15 +104,15 @@ Pry.commands.alias_command 'f', 'finish'
135
104
  Patches and bug reports are welcome. Just send a [pull request][pullrequests] or
136
105
  file an [issue][issues]. [Project changelog][changelog].
137
106
 
138
-
139
-
140
107
  [pry]: http://pry.github.com
141
- [byebug]: https://github.com/deivid-rodriguez/byebug
108
+ [byebug]: https://github.com/deivid-rodriguez/byebug
142
109
  [pry-stack_explorer]: https://github.com/pry/pry-stack_explorer
143
- [pry-nav]: https://github.com/nixme/pry-nav
144
- [pry-remote]: https://github.com/Mon-Ouie/pry-remote
145
- [foreman]: https://github.com/ddollar/foreman
146
110
  [jazz_hands]: https://github.com/nixme/jazz_hands
147
- [pullrequests]: https://github.com/nixme/pry-byebug/pulls
148
- [issues]: https://github.com/nixme/pry-byebug/issues
149
- [changelog]: https://github.com/nixme/pry-byebug/blob/master/CHANGELOG.md
111
+ [pullrequests]: https://github.com/deivid-rodriguez/pry-byebug/pulls
112
+ [issues]: https://github.com/deivid-rodriguez/pry-byebug/issues
113
+ [changelog]: https://github.com/deivid-rodriguez/pry-byebug/blob/master/CHANGELOG.md
114
+ [pry-nav]: https://github.com/nixme/pry-nav
115
+ [1]: https://badge.fury.io/rb/pry-byebug.png
116
+ [2]: http://badge.fury.io/rb/pry-byebug
117
+ [3]: https://secure.travis-ci.org/deivid-rodriguez/pry-byebug.png
118
+ [4]: http://travis-ci.org/deivid-rodriguez/pry-byebug
data/Rakefile CHANGED
@@ -1 +1,10 @@
1
1
  require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
+
4
+ desc 'Run tests'
5
+ Rake::TestTask.new(:test) do |t|
6
+ t.libs << 'test'
7
+ t.pattern = 'test/**/*_test.rb'
8
+ end
9
+
10
+ task default: :test
@@ -8,6 +8,7 @@ module PryByebug
8
8
 
9
9
  banner <<-BANNER
10
10
  Usage: step [TIMES]
11
+ Aliases: s
11
12
 
12
13
  Step execution forward. By default, moves a single step.
13
14
 
@@ -22,13 +23,14 @@ module PryByebug
22
23
  breakout_navigation :step, args.first
23
24
  end
24
25
  end
25
-
26
+ alias_command 's', 'step'
26
27
 
27
28
  create_command 'next' do
28
29
  description 'Execute the next line within the current stack frame.'
29
30
 
30
31
  banner <<-BANNER
31
32
  Usage: next [LINES]
33
+ Aliases: n
32
34
 
33
35
  Step over within the same frame. By default, moves forward a single
34
36
  line.
@@ -44,27 +46,37 @@ module PryByebug
44
46
  breakout_navigation :next, args.first
45
47
  end
46
48
  end
47
-
49
+ alias_command 'n', 'next'
48
50
 
49
51
  create_command 'finish' do
50
52
  description 'Execute until current stack frame returns.'
51
53
 
54
+ banner <<-BANNER
55
+ Usage: finish
56
+ Aliases: f
57
+ BANNER
58
+
52
59
  def process
53
60
  check_file_context
54
61
  breakout_navigation :finish
55
62
  end
56
63
  end
57
-
64
+ alias_command 'f', 'finish'
58
65
 
59
66
  create_command 'continue' do
60
67
  description 'Continue program execution and end the Pry session.'
61
68
 
69
+ banner <<-BANNER
70
+ Usage: continue
71
+ Aliases: c
72
+ BANNER
73
+
62
74
  def process
63
75
  check_file_context
64
76
  run 'exit-all'
65
77
  end
66
78
  end
67
-
79
+ alias_command 'c', 'continue'
68
80
 
69
81
  create_command 'break' do
70
82
  description 'Set or edit a breakpoint.'
@@ -202,12 +214,11 @@ module PryByebug
202
214
  end
203
215
  alias_command 'breaks', 'breakpoints'
204
216
 
205
-
206
217
  helpers do
207
218
  def breakout_navigation(action, times = nil)
208
- _pry_.binding_stack.clear # Clear the binding stack.
209
- throw :breakout_nav, { # Break out of the REPL loop and
210
- :action => action, # signal the tracer.
219
+ _pry_.binding_stack.clear # Clear the binding stack.
220
+ throw :breakout_nav, { # Break out of the REPL loop and signal tracer
221
+ :action => action,
211
222
  :times => times,
212
223
  :pry => _pry_
213
224
  }
@@ -14,6 +14,7 @@ module PryByebug
14
14
  # Wrap a Pry REPL to catch navigational commands and act on them.
15
15
  def run(initial = true, &block)
16
16
  return_value = nil
17
+
17
18
  command = catch(:breakout_nav) do # Throws from PryByebug::Commands
18
19
  return_value = yield
19
20
  {} # Nothing thrown == no navigational command
@@ -31,18 +32,16 @@ module PryByebug
31
32
  # inside Byebug. If we step normally, it'll stop inside this
32
33
  # Processor. So jump out and stop at the above frame, then step/next
33
34
  # from our callback.
34
- finish
35
35
  @delayed[command[:action]] = times
36
- end
37
-
38
- if :next == command[:action]
36
+ step_out 2
37
+ elsif :next == command[:action]
39
38
  step_over times
40
39
 
41
40
  elsif :step == command[:action]
42
- step times
41
+ step_into times
43
42
 
44
43
  elsif :finish == command[:action]
45
- finish
44
+ step_out
46
45
  end
47
46
  else
48
47
  stop
@@ -64,31 +63,24 @@ module PryByebug
64
63
  end
65
64
  end
66
65
 
67
-
68
66
  # --- Callbacks from byebug C extension ---
69
-
70
67
  def at_line(context, file, line)
71
- # If stopped for a breakpoint or catchpoint, can't play any delayed steps
72
- # as they'll move away from the interruption point. (Unsure if scenario is
73
- # possible, but just keeping assertions in check.)
74
- p "Stop_reason: #{context.stop_reason}"
75
- @delayed = Hash.new(0) unless :step == context.stop_reason
68
+ # If any delayed nexts/steps, do 'em.
69
+ if @delayed[:next] > 1
70
+ step_over @delayed[:next] - 1
76
71
 
77
- if @delayed[:next] > 0 # If any delayed nexts/steps, do 'em.
78
- step_over @delayed[:next]
79
- @delayed = Hash.new(0)
72
+ elsif @delayed[:step] > 1
73
+ step_into @delayed[:step] - 1
80
74
 
81
- elsif @delayed[:step] > 0
82
- step @delayed[:step]
83
- @delayed = Hash.new(0)
75
+ elsif @delayed[:finish] > 1
76
+ step_out @delayed[:finish] - 1
84
77
 
85
- elsif @delayed[:finish] > 0
86
- finish
87
- @delayed = Hash.new(0)
88
-
89
- else # Otherwise, resume the pry session at the stopped line.
78
+ # Otherwise, resume the pry session at the stopped line.
79
+ else
90
80
  resume_pry context
91
81
  end
82
+
83
+ @delayed = Hash.new(0)
92
84
  end
93
85
 
94
86
  # Called when a breakpoint is triggered. Note: `at_line`` is called
@@ -100,7 +92,7 @@ module PryByebug
100
92
  "Hit #{breakpoint.hit_count} times." )
101
93
  if (expr = breakpoint.expr)
102
94
  @pry.output.print Pry::Helpers::Text.bold("Condition: ")
103
- @pry.output.puts expr
95
+ @pry.output.puts expr
104
96
  end
105
97
  end
106
98
 
@@ -108,42 +100,40 @@ module PryByebug
108
100
  # TODO
109
101
  end
110
102
 
103
+ private
111
104
 
112
- private
113
-
114
- # Resume an existing Pry REPL at the paused point. Binding extracted from
115
- # the Byebug::Context.
116
- def resume_pry(context)
117
- new_binding = context.frame_binding(0)
118
- Byebug.stop unless @always_enabled
105
+ # Resume an existing Pry REPL at the paused point.
106
+ # Binding extracted from Byebug::Context
107
+ def resume_pry(context)
108
+ new_binding = context.frame_binding(0)
109
+ Byebug.stop unless @always_enabled
119
110
 
120
- @pry.binding_stack.clear
121
- run(false) do
122
- @pry.repl new_binding
111
+ run(false) do
112
+ @pry.repl new_binding
113
+ end
123
114
  end
124
- end
125
115
 
126
- # Move execution forward.
127
- def step(times)
128
- Byebug.context.step_into times
129
- end
116
+ # Move execution forward.
117
+ def step_into(times)
118
+ Byebug.context.step_into times
119
+ end
130
120
 
131
- # Move execution forward a number of lines in the same frame.
132
- def step_over(lines)
133
- Byebug.context.step_over lines, 0
134
- end
121
+ # Move execution forward a number of lines in the same frame.
122
+ def step_over(lines)
123
+ Byebug.context.step_over lines, 0
124
+ end
135
125
 
136
- # Execute until specified frame returns.
137
- def finish(frame = 0)
138
- Byebug.context.step_out frame
139
- end
126
+ # Execute until specified frame returns.
127
+ def step_out(frame = 0)
128
+ Byebug.context.step_out frame
129
+ end
140
130
 
141
- # Cleanup when debugging is stopped and execution continues.
142
- def stop
143
- Byebug.stop if !@always_enabled && Byebug.started?
144
- if PryByebug.current_remote_server # Cleanup DRb remote if running
145
- PryByebug.current_remote_server.teardown
131
+ # Cleanup when debugging is stopped and execution continues.
132
+ def stop
133
+ Byebug.stop if !@always_enabled && Byebug.started?
134
+ if PryByebug.current_remote_server # Cleanup DRb remote if running
135
+ PryByebug.current_remote_server.teardown
136
+ end
146
137
  end
147
- end
148
138
  end
149
139
  end
@@ -9,7 +9,7 @@ class << Pry
9
9
  @processor ||= PryByebug::Processor.new
10
10
 
11
11
  if target.is_a?(Binding) && PryByebug.check_file_context(target)
12
- # Wrap the processer around the usual Pry.start to catch navigation
12
+ # Wrap the processor around the usual Pry.start to catch navigation
13
13
  # commands.
14
14
  @processor.run(true) do
15
15
  start_without_pry_byebug(target, options)
@@ -1,3 +1,3 @@
1
1
  module PryByebug
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.1'
3
3
  end
data/pry-byebug.gemspec CHANGED
@@ -1,25 +1,27 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- require File.expand_path('../lib/pry-byebug/version', __FILE__)
1
+ require File.dirname(__FILE__) + '/lib/pry-byebug/version'
4
2
 
5
3
  Gem::Specification.new do |gem|
6
4
  gem.name = 'pry-byebug'
7
5
  gem.version = PryByebug::VERSION
8
- gem.author = 'Gopal Patel'
9
- gem.email = 'nixme@stillhope.com'
6
+ gem.authors = ['David Rodríguez', 'Gopal Patel']
7
+ gem.email = 'deivid.rodriguez@gmail.com'
10
8
  gem.license = 'MIT'
11
9
  gem.homepage = 'https://github.com/deivid-rodriguez/pry-byebug'
12
10
  gem.summary = 'Fast debugging with Pry.'
13
- gem.description = "Combine 'pry' with 'byebug'. Adds 'step', 'next', and " \
14
- "'continue' commands to control execution."
15
- gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
11
+ gem.description = %q{Combine 'pry' with 'byebug'. Adds 'step', 'next', and
12
+ 'continue' commands to control execution.}
13
+
16
14
  gem.files = `git ls-files`.split("\n")
17
- gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
- gem.require_paths = ["lib"]
15
+ gem.test_files = `git ls-files -- test/*`.split("\n")
16
+ gem.require_paths = ['lib']
19
17
 
20
18
  # Dependencies
21
19
  gem.required_ruby_version = '>= 2.0.0'
22
- gem.add_runtime_dependency 'pry', '>= 0.9.10'
23
- gem.add_runtime_dependency 'byebug', '~> 1.1.1'
20
+
21
+ gem.add_runtime_dependency 'pry', '~> 0.9.12'
22
+ gem.add_runtime_dependency 'byebug', '~> 1.5.0'
23
+
24
24
  gem.add_development_dependency 'bundler', '~> 1.3.5'
25
+ gem.add_development_dependency 'rake', '~> 10.1.0'
26
+ gem.add_development_dependency 'mocha', '~> 0.14.0'
25
27
  end
data/test/base_test.rb ADDED
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+
3
+ class BaseTest < MiniTest::Spec
4
+ def test_main_file_context
5
+ Pry.stubs eval_path: "<main>"
6
+ assert PryByebug.check_file_context(TOPLEVEL_BINDING)
7
+ end
8
+
9
+ def test_other_file_context
10
+ Pry.stubs eval_path: "something"
11
+ refute PryByebug.check_file_context(TOPLEVEL_BINDING)
12
+ end
13
+ end
14
+
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+
3
+ class BreakpointsTest < MiniTest::Spec
4
+
5
+ def test_add_raises_argument_error
6
+ Pry.stubs eval_path: "something"
7
+ File.stubs :exist?
8
+ assert_raises(ArgumentError) do
9
+ PryByebug::Breakpoints.add("file", 1)
10
+ end
11
+ end
12
+
13
+ end
14
+
@@ -0,0 +1,72 @@
1
+ require 'test_helper'
2
+
3
+ class CommandsTest < MiniTest::Spec
4
+ let(:step_file) do
5
+ (Pathname.new(__FILE__) + "../examples/stepping.rb").cleanpath.to_s
6
+ end
7
+
8
+ before do
9
+ Pry.color = false
10
+ Pry.pager = false
11
+ Pry.hooks = Pry::DEFAULT_HOOKS
12
+ @output = StringIO.new
13
+ end
14
+
15
+ describe 'Step Command' do
16
+ describe 'single step' do
17
+ before do
18
+ @input = InputTester.new('step')
19
+ redirect_pry_io(@input, @output) do
20
+ load step_file
21
+ end
22
+ end
23
+
24
+ it 'shows current line' do
25
+ @output.string.must_match /\=> 3:/
26
+ end
27
+ end
28
+
29
+ describe 'multiple step' do
30
+ before do
31
+ @input = InputTester.new('step 2')
32
+ redirect_pry_io(@input, @output) do
33
+ load step_file
34
+ end
35
+ end
36
+
37
+ it 'shows current line' do
38
+ @output.string.must_match /\=> 4:/
39
+ end
40
+ end
41
+ end
42
+
43
+ describe 'Next Command' do
44
+ describe 'single step' do
45
+ before do
46
+ @input = InputTester.new('next')
47
+ redirect_pry_io(@input, @output) do
48
+ load step_file
49
+ end
50
+ end
51
+
52
+ it 'shows current line' do
53
+ @output.string.must_match /\=> 3:/
54
+ end
55
+ end
56
+
57
+ describe 'multiple step' do
58
+ before do
59
+ @input = InputTester.new('next 2')
60
+ redirect_pry_io(@input, @output) do
61
+ load step_file
62
+ end
63
+ end
64
+
65
+ it 'shows current line' do
66
+ @output.string.must_match /\=> 20:/
67
+ end
68
+ end
69
+ end
70
+
71
+ end
72
+
@@ -0,0 +1,25 @@
1
+ binding.pry
2
+
3
+ class SteppingExample
4
+ def a
5
+ z = 2
6
+ b
7
+ end
8
+
9
+ def b
10
+ v2 = 5 if 1 == 2 ; [1,2,3].map { |a| a.to_f }
11
+ c
12
+ end
13
+
14
+ def c
15
+ z = 4
16
+ 5
17
+ end
18
+ end
19
+
20
+ ex = SteppingExample.new.a
21
+ 2.times do
22
+ ex += 1
23
+ end
24
+
25
+ ex
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ class ProcessorTest < MiniTest::Spec
4
+
5
+ end
6
+
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ class PryExtTest < MiniTest::Spec
4
+
5
+ end
6
+
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ class PryRemoteExtTest < MiniTest::Spec
4
+
5
+ end
6
+
@@ -0,0 +1,34 @@
1
+ require 'pry/test/helper'
2
+ require 'minitest/autorun'
3
+ require 'pry-byebug'
4
+ require 'mocha/setup'
5
+
6
+ # Set I/O streams. Out defaults to an anonymous StringIO.
7
+ def redirect_pry_io(new_in, new_out = StringIO.new)
8
+ old_in = Pry.input
9
+ old_out = Pry.output
10
+
11
+ Pry.input = new_in
12
+ Pry.output = new_out
13
+ begin
14
+ yield
15
+ ensure
16
+ Pry.input = old_in
17
+ Pry.output = old_out
18
+ end
19
+ end
20
+
21
+ class InputTester
22
+ def initialize(*actions)
23
+ @orig_actions = actions.dup
24
+ @actions = actions
25
+ end
26
+
27
+ def readline(*)
28
+ @actions.shift
29
+ end
30
+
31
+ def rewind
32
+ @actions = @orig_actions.dup
33
+ end
34
+ end
metadata CHANGED
@@ -1,43 +1,44 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-byebug
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
+ - David Rodríguez
7
8
  - Gopal Patel
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-05-07 00:00:00.000000000 Z
12
+ date: 2013-07-02 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: pry
15
16
  requirement: !ruby/object:Gem::Requirement
16
17
  requirements:
17
- - - '>='
18
+ - - ~>
18
19
  - !ruby/object:Gem::Version
19
- version: 0.9.10
20
+ version: 0.9.12
20
21
  type: :runtime
21
22
  prerelease: false
22
23
  version_requirements: !ruby/object:Gem::Requirement
23
24
  requirements:
24
- - - '>='
25
+ - - ~>
25
26
  - !ruby/object:Gem::Version
26
- version: 0.9.10
27
+ version: 0.9.12
27
28
  - !ruby/object:Gem::Dependency
28
29
  name: byebug
29
30
  requirement: !ruby/object:Gem::Requirement
30
31
  requirements:
31
32
  - - ~>
32
33
  - !ruby/object:Gem::Version
33
- version: 1.1.1
34
+ version: 1.5.0
34
35
  type: :runtime
35
36
  prerelease: false
36
37
  version_requirements: !ruby/object:Gem::Requirement
37
38
  requirements:
38
39
  - - ~>
39
40
  - !ruby/object:Gem::Version
40
- version: 1.1.1
41
+ version: 1.5.0
41
42
  - !ruby/object:Gem::Dependency
42
43
  name: bundler
43
44
  requirement: !ruby/object:Gem::Requirement
@@ -52,15 +53,45 @@ dependencies:
52
53
  - - ~>
53
54
  - !ruby/object:Gem::Version
54
55
  version: 1.3.5
55
- description: Combine 'pry' with 'byebug'. Adds 'step', 'next', and 'continue' commands
56
- to control execution.
57
- email: nixme@stillhope.com
56
+ - !ruby/object:Gem::Dependency
57
+ name: rake
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ~>
61
+ - !ruby/object:Gem::Version
62
+ version: 10.1.0
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 10.1.0
70
+ - !ruby/object:Gem::Dependency
71
+ name: mocha
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ~>
75
+ - !ruby/object:Gem::Version
76
+ version: 0.14.0
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ~>
82
+ - !ruby/object:Gem::Version
83
+ version: 0.14.0
84
+ description: |-
85
+ Combine 'pry' with 'byebug'. Adds 'step', 'next', and
86
+ 'continue' commands to control execution.
87
+ email: deivid.rodriguez@gmail.com
58
88
  executables: []
59
89
  extensions: []
60
90
  extra_rdoc_files: []
61
91
  files:
62
92
  - .gitignore
63
93
  - .ruby-gemset
94
+ - .travis.yml
64
95
  - CHANGELOG.md
65
96
  - Gemfile
66
97
  - LICENSE
@@ -75,6 +106,14 @@ files:
75
106
  - lib/pry-byebug/pry_remote_ext.rb
76
107
  - lib/pry-byebug/version.rb
77
108
  - pry-byebug.gemspec
109
+ - test/base_test.rb
110
+ - test/breakpoints_test.rb
111
+ - test/commands_test.rb
112
+ - test/examples/stepping.rb
113
+ - test/processor_test.rb
114
+ - test/pry_ext_test.rb
115
+ - test/pry_remote_ext_test.rb
116
+ - test/test_helper.rb
78
117
  homepage: https://github.com/deivid-rodriguez/pry-byebug
79
118
  licenses:
80
119
  - MIT
@@ -99,4 +138,12 @@ rubygems_version: 2.0.3
99
138
  signing_key:
100
139
  specification_version: 4
101
140
  summary: Fast debugging with Pry.
102
- test_files: []
141
+ test_files:
142
+ - test/base_test.rb
143
+ - test/breakpoints_test.rb
144
+ - test/commands_test.rb
145
+ - test/examples/stepping.rb
146
+ - test/processor_test.rb
147
+ - test/pry_ext_test.rb
148
+ - test/pry_remote_ext_test.rb
149
+ - test/test_helper.rb