byebug 2.7.0 → 3.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.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -6
  3. data/.travis.yml +1 -0
  4. data/CHANGELOG.md +23 -0
  5. data/Gemfile +9 -0
  6. data/README.md +35 -32
  7. data/Rakefile +1 -3
  8. data/byebug.gemspec +0 -6
  9. data/ext/byebug/byebug.c +64 -51
  10. data/ext/byebug/byebug.h +12 -13
  11. data/ext/byebug/context.c +28 -43
  12. data/ext/byebug/extconf.rb +6 -6
  13. data/lib/byebug.rb +34 -38
  14. data/lib/byebug/command.rb +4 -2
  15. data/lib/byebug/commands/continue.rb +0 -1
  16. data/lib/byebug/commands/control.rb +0 -1
  17. data/lib/byebug/commands/edit.rb +1 -1
  18. data/lib/byebug/commands/finish.rb +10 -16
  19. data/lib/byebug/commands/help.rb +1 -1
  20. data/lib/byebug/commands/kill.rb +1 -1
  21. data/lib/byebug/commands/quit.rb +1 -1
  22. data/lib/byebug/commands/repl.rb +3 -3
  23. data/lib/byebug/commands/set.rb +24 -39
  24. data/lib/byebug/commands/show.rb +39 -112
  25. data/lib/byebug/commands/stepping.rb +0 -2
  26. data/lib/byebug/commands/threads.rb +0 -5
  27. data/lib/byebug/commands/trace.rb +1 -1
  28. data/lib/byebug/commands/variables.rb +1 -1
  29. data/lib/byebug/context.rb +8 -12
  30. data/lib/byebug/helper.rb +1 -1
  31. data/lib/byebug/history.rb +46 -0
  32. data/lib/byebug/interface.rb +5 -5
  33. data/lib/byebug/interfaces/local_interface.rb +11 -62
  34. data/lib/byebug/interfaces/remote_interface.rb +6 -22
  35. data/lib/byebug/interfaces/script_interface.rb +2 -17
  36. data/lib/byebug/processor.rb +4 -4
  37. data/lib/byebug/{command_processor.rb → processors/command_processor.rb} +7 -14
  38. data/lib/byebug/{control_command_processor.rb → processors/control_command_processor.rb} +3 -7
  39. data/lib/byebug/version.rb +1 -1
  40. data/test/edit_test.rb +6 -6
  41. data/test/examples/breakpoint_deep.rb +1 -1
  42. data/test/finish_test.rb +6 -6
  43. data/test/help_test.rb +1 -1
  44. data/test/info_test.rb +0 -1
  45. data/test/kill_test.rb +2 -2
  46. data/test/post_mortem_test.rb +35 -219
  47. data/test/quit_test.rb +2 -2
  48. data/test/restart_test.rb +12 -33
  49. data/test/set_test.rb +80 -107
  50. data/test/show_test.rb +42 -77
  51. data/test/stepping_test.rb +1 -1
  52. data/test/support/test_dsl.rb +4 -25
  53. data/test/support/test_interface.rb +40 -48
  54. data/test/test_helper.rb +1 -3
  55. data/test/timeout_test.rb +9 -0
  56. metadata +8 -75
@@ -5,7 +5,7 @@ class SteppingExample
5
5
  end
6
6
 
7
7
  def self.b(num)
8
- v2 = 5 if 1 == num ; [1, 2, v2].map { |a| a.to_f }
8
+ v2 = 5 if 1 == num ; [1, 2, v2].map { |t| t.to_f }
9
9
  c(num)
10
10
  end
11
11
 
@@ -4,7 +4,7 @@ module TestDsl
4
4
  include TestDsl
5
5
 
6
6
  def setup
7
- Byebug.handler = Byebug::CommandProcessor.new(TestInterface.new)
7
+ Byebug.handler = Byebug::CommandProcessor.new(Byebug::TestInterface.new)
8
8
  Byebug.tracing = false
9
9
  Byebug.breakpoints.clear if Byebug.breakpoints
10
10
  end
@@ -92,34 +92,13 @@ module TestDsl
92
92
  # debug_file('/path/to/ex2.rb') { state.line.must_equal 4 }
93
93
  #
94
94
  def debug_file(filename, options = {}, &block)
95
- is_test_block_called = false
96
- exception = nil
97
95
  Byebug.stubs(:run_init_script)
98
- if block
99
- interface.test_block = lambda do
100
- is_test_block_called = true
101
- # We need to store exception and reraise it after completing debugging,
102
- # because Byebug will swallow any exceptions, so e.g. our failed
103
- # assertions will be ignored
104
- begin
105
- block.call
106
- rescue Exception => e
107
- exception = e
108
- end
109
- end
110
- end
96
+ interface.test_block = block
111
97
  begin
112
98
  load fullpath(filename)
113
- rescue Exception => e
114
- if options[:rescue]
115
- interface.test_block.call if interface.test_block
116
- else
117
- raise e
118
- end
99
+ ensure
100
+ interface.test_block.call if interface.test_block
119
101
  end
120
-
121
- flunk "Test block was provided, but not called" if block && !is_test_block_called
122
- raise exception if exception
123
102
  end
124
103
 
125
104
  #
@@ -1,59 +1,51 @@
1
- class TestInterface < Byebug::Interface
2
- attr_reader :input_queue, :output_queue, :error_queue, :confirm_queue
3
-
4
- attr_accessor :command_queue, :histfile, :history_length, :history_save
5
- attr_accessor :readline_support, :restart_file, :test_block
6
-
7
- def initialize
8
- @input_queue = []
9
- @output_queue = []
10
- @error_queue = []
11
- @confirm_queue = []
12
- @command_queue = []
13
- @readline_support = false
14
- end
1
+ require 'byebug/history'
15
2
 
16
- def errmsg(*args)
17
- @error_queue << format(*args)
18
- end
3
+ module Byebug
4
+ class TestInterface < Interface
5
+ attr_reader :input_queue, :output_queue, :error_queue, :confirm_queue, :history
19
6
 
20
- def read_command(*args)
21
- if @input_queue.empty?
22
- if test_block
23
- test_block.call
24
- self.test_block = nil
25
- end
26
- else
27
- result = @input_queue.shift
28
- result.is_a?(Proc) ? result.call : result
7
+ attr_accessor :test_block
8
+
9
+ def initialize
10
+ @input_queue, @output_queue, @error_queue = [], [], []
11
+ @confirm_queue, @command_queue, @history = [], [], Byebug::History.new
29
12
  end
30
- end
31
13
 
32
- def print(*args)
33
- @output_queue << format(*args)
34
- end
14
+ def errmsg(*args)
15
+ @error_queue << format(*args)
16
+ end
35
17
 
36
- def confirm(message)
37
- @confirm_queue << message
38
- read_command message
39
- end
18
+ def read_command(*args)
19
+ if @input_queue.empty?
20
+ if test_block
21
+ test_block.call
22
+ self.test_block = nil
23
+ end
24
+ else
25
+ result = @input_queue.shift
26
+ result.is_a?(Proc) ? result.call : result
27
+ end
28
+ end
40
29
 
41
- def readline_support?
42
- @readline_support
43
- end
30
+ def print(*args)
31
+ @output_queue << format(*args)
32
+ end
44
33
 
45
- def finalize
46
- end
34
+ def confirm(message)
35
+ @confirm_queue << message
36
+ read_command message
37
+ end
47
38
 
48
- def close
49
- end
39
+ def close
40
+ end
50
41
 
51
- def inspect
52
- [
53
- "input_queue: #{input_queue.inspect}",
54
- "output_queue: #{output_queue.inspect}",
55
- "error_queue: #{error_queue.inspect}",
56
- "confirm_queue: #{confirm_queue.inspect}"
57
- ].join("\n")
42
+ def inspect
43
+ [
44
+ "input_queue: #{input_queue.inspect}",
45
+ "output_queue: #{output_queue.inspect}",
46
+ "error_queue: #{error_queue.inspect}",
47
+ "confirm_queue: #{confirm_queue.inspect}"
48
+ ].join("\n")
49
+ end
58
50
  end
59
51
  end
@@ -40,7 +40,5 @@ argv = ARGV.select do |argument|
40
40
  end
41
41
  end
42
42
 
43
- ARGV.replace argv
44
-
45
43
  # Run the tests
46
- Minitest.run
44
+ Minitest.run argv
@@ -0,0 +1,9 @@
1
+ class TestTimeout < MiniTest::Spec
2
+
3
+ it 'call to "Timeout::timeout" after "Byebug.start" does not raise' do
4
+ Byebug.start do
5
+ Timeout::timeout(60) {}
6
+ end
7
+ end
8
+
9
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: byebug
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Rodriguez
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-02-24 00:00:00.000000000 Z
13
+ date: 2014-04-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: columnize
@@ -40,76 +40,6 @@ dependencies:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
42
  version: '1.2'
43
- - !ruby/object:Gem::Dependency
44
- name: rake
45
- requirement: !ruby/object:Gem::Requirement
46
- requirements:
47
- - - "~>"
48
- - !ruby/object:Gem::Version
49
- version: '10.1'
50
- type: :development
51
- prerelease: false
52
- version_requirements: !ruby/object:Gem::Requirement
53
- requirements:
54
- - - "~>"
55
- - !ruby/object:Gem::Version
56
- version: '10.1'
57
- - !ruby/object:Gem::Dependency
58
- name: rake-compiler
59
- requirement: !ruby/object:Gem::Requirement
60
- requirements:
61
- - - "~>"
62
- - !ruby/object:Gem::Version
63
- version: '0.9'
64
- type: :development
65
- prerelease: false
66
- version_requirements: !ruby/object:Gem::Requirement
67
- requirements:
68
- - - "~>"
69
- - !ruby/object:Gem::Version
70
- version: '0.9'
71
- - !ruby/object:Gem::Dependency
72
- name: mocha
73
- requirement: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - "~>"
76
- - !ruby/object:Gem::Version
77
- version: '1.0'
78
- type: :development
79
- prerelease: false
80
- version_requirements: !ruby/object:Gem::Requirement
81
- requirements:
82
- - - "~>"
83
- - !ruby/object:Gem::Version
84
- version: '1.0'
85
- - !ruby/object:Gem::Dependency
86
- name: minitest
87
- requirement: !ruby/object:Gem::Requirement
88
- requirements:
89
- - - "~>"
90
- - !ruby/object:Gem::Version
91
- version: '5.2'
92
- type: :development
93
- prerelease: false
94
- version_requirements: !ruby/object:Gem::Requirement
95
- requirements:
96
- - - "~>"
97
- - !ruby/object:Gem::Version
98
- version: '5.2'
99
- - !ruby/object:Gem::Dependency
100
- name: coveralls
101
- requirement: !ruby/object:Gem::Requirement
102
- requirements:
103
- - - "~>"
104
- - !ruby/object:Gem::Version
105
- version: '0.7'
106
- type: :development
107
- prerelease: false
108
- version_requirements: !ruby/object:Gem::Requirement
109
- requirements:
110
- - - "~>"
111
- - !ruby/object:Gem::Version
112
- version: '0.7'
113
43
  description: |-
114
44
  Byebug is a Ruby 2 debugger. It's implemented using the
115
45
  Ruby 2 TracePoint C API for execution control and the Debug Inspector C API
@@ -145,7 +75,6 @@ files:
145
75
  - ext/byebug/threads.c
146
76
  - lib/byebug.rb
147
77
  - lib/byebug/command.rb
148
- - lib/byebug/command_processor.rb
149
78
  - lib/byebug/commands/breakpoints.rb
150
79
  - lib/byebug/commands/catchpoint.rb
151
80
  - lib/byebug/commands/condition.rb
@@ -175,13 +104,15 @@ files:
175
104
  - lib/byebug/commands/trace.rb
176
105
  - lib/byebug/commands/variables.rb
177
106
  - lib/byebug/context.rb
178
- - lib/byebug/control_command_processor.rb
179
107
  - lib/byebug/helper.rb
108
+ - lib/byebug/history.rb
180
109
  - lib/byebug/interface.rb
181
110
  - lib/byebug/interfaces/local_interface.rb
182
111
  - lib/byebug/interfaces/remote_interface.rb
183
112
  - lib/byebug/interfaces/script_interface.rb
184
113
  - lib/byebug/processor.rb
114
+ - lib/byebug/processors/command_processor.rb
115
+ - lib/byebug/processors/control_command_processor.rb
185
116
  - lib/byebug/remote.rb
186
117
  - lib/byebug/version.rb
187
118
  - test/breakpoints_test.rb
@@ -255,6 +186,7 @@ files:
255
186
  - test/support/test_interface.rb
256
187
  - test/test_helper.rb
257
188
  - test/thread_test.rb
189
+ - test/timeout_test.rb
258
190
  - test/trace_test.rb
259
191
  - test/variables_test.rb
260
192
  homepage: http://github.com/deivid-rodriguez/byebug
@@ -277,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
277
209
  version: '0'
278
210
  requirements: []
279
211
  rubyforge_project:
280
- rubygems_version: 2.2.1
212
+ rubygems_version: 2.2.2
281
213
  signing_key:
282
214
  specification_version: 4
283
215
  summary: Ruby 2.0 fast debugger - base + cli
@@ -353,5 +285,6 @@ test_files:
353
285
  - test/support/test_interface.rb
354
286
  - test/test_helper.rb
355
287
  - test/thread_test.rb
288
+ - test/timeout_test.rb
356
289
  - test/trace_test.rb
357
290
  - test/variables_test.rb