pry-byebug 1.3.3 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,20 +1,23 @@
1
1
  binding.pry
2
2
 
3
- class BreakExample
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
- v2 = 5 if 1 == 2 ; [1,2,3].map { |a| a.to_f }
11
- c!
13
+ z = 5
14
+ z + c!
12
15
  end
13
16
 
14
17
  def c!
15
18
  z = 4
16
- 5
19
+ z
17
20
  end
18
21
  end
19
22
 
20
- BreakExample.new.a
23
+ Break1Example.new.a
@@ -1,8 +1,11 @@
1
- class BreakExample
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
- BreakExample.new.a
21
+ Break2Example.new.a
@@ -1,23 +1,27 @@
1
1
  binding.pry
2
2
 
3
+ #
4
+ # Toy class for testing steps
5
+ #
3
6
  class SteppingExample
4
- def a
7
+ def method_a
5
8
  z = 2
6
- b
9
+ z + method_b
7
10
  end
8
11
 
9
- def b
10
- v2 = 5 if 1 == 2 ; [1,2,3].map { |a| a.to_f }
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 c
18
+ def method_c
15
19
  z = 4
16
- 5
20
+ z
17
21
  end
18
22
  end
19
23
 
20
- ex = SteppingExample.new.a
24
+ ex = SteppingExample.new.method_a
21
25
  2.times do
22
26
  ex += 1
23
27
  end
@@ -1,6 +1,26 @@
1
1
  require 'test_helper'
2
2
 
3
- class ProcessorTest < MiniTest::Spec
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
- end
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
@@ -1,6 +1,4 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class PryExtTest < MiniTest::Spec
4
-
5
4
  end
6
-
@@ -1,6 +1,4 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class PryRemoteExtTest < MiniTest::Spec
4
-
5
4
  end
6
-
@@ -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
- old_out = Pry.output
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: 1.3.3
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-06-25 00:00:00.000000000 Z
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: '2.7'
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: '2.7'
41
+ version: '3.4'
42
42
  description: |-
43
- Combine 'pry' with 'byebug'. Adds 'step', 'next', and
44
- 'continue' commands to control execution.
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.2.2
98
+ rubygems_version: 2.4.1
98
99
  signing_key:
99
100
  specification_version: 4
100
101
  summary: Fast debugging with Pry.