byebug 8.2.5 → 9.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 727f87204d164208f5106683d269866c4226c411
4
- data.tar.gz: 5ec864cf251f0b0d365cc1a1dd9308d59c41ee90
3
+ metadata.gz: 16e31cc0cae3293a64954196439c341be71e5c7d
4
+ data.tar.gz: 996d91bb3201f6153aadd970d67e26d961bc6c3f
5
5
  SHA512:
6
- metadata.gz: 845f95e29e95071ac483d4580f9ca603a6ec6064f89ddc49747f2f768a76b061739ee3ae26dfc69f90c955facf9104375fa10d5669c717ab7775dc2fb9e5bc28
7
- data.tar.gz: ad29da5042821e9be12e8a1fe693c4d14b11ba3213c4abf8e18abc89c9494a69633fe85936a43bd6d5e349c4d930986715cf4c28562cb0035086d350e71eb27a
6
+ metadata.gz: 7fb01282ca96613f63bc74580c444782b4c5eccf7f14e60b28717e78fb5a94b37fbf764b0f13f6fb1987e65849ffe3714bf2bda0ac68d10c559881c1fec0806f
7
+ data.tar.gz: bba886ccb2e0d8c52364f2d3933483c2b9de52c12f4a9644ec2c02974e9f9b21bea22cb9caa81ec3547aee597f3e59d8b810605ca189cd6fcb3c1a90c4110478
data/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  ## Master (Unreleased)
4
4
 
5
+ ## 9.0.0 - 2016-05-11
6
+
7
+ ## Fixed
8
+
9
+ * `irb` command unintentionally changing $PROGRAM_NAME.
10
+ * `pry` command failing.
11
+ * Unrelated error message when using `pry` command and Pry not installed.
12
+ * Interrupting program execution from remote control interface (#239, thanks
13
+ @izaera).
14
+
15
+ ### Removed
16
+
17
+ * Official Ruby 2.0.0 support. `var local` no longer works in Ruby 2.0. The
18
+ rest of the commands should still work as before, but `byebug` is no longer
19
+ tested against this version so they might start breaking in the
20
+ future.
21
+
5
22
  ## 8.2.5 - 2016-04-27
6
23
 
7
24
  ### Fixed
data/GUIDE.md CHANGED
@@ -1600,7 +1600,7 @@ not be printed but they won't be forgotten either, so you can toggle them again
1600
1600
  later. To do that, use `disable display` or `enable display` followed by the
1601
1601
  expression number.
1602
1602
 
1603
- ### Evaluation of expressions: display
1603
+ ### Evaluation of expressions: irb, pry
1604
1604
 
1605
1605
  To examine and change data in your script you can just evaluate any Ruby code
1606
1606
  from `byebug`'s prompt. Any input that is not recognized as a command will be
@@ -1631,23 +1631,9 @@ $ byebug triangle.rb
1631
1631
  9:
1632
1632
  10: if __FILE__ == $0
1633
1633
  (byebug) irb
1634
- 2.0.0-p247 :001 > (0..6).inject{|sum, i| sum +=i}
1634
+ irb(main):001:0> (0..6).inject { |sum, i| sum += i }
1635
1635
  => 21
1636
- 2.0.0-p247 :002 > exit
1637
- /home/davidr/Proyectos/byebug/old_doc/triangle.rb @ 2
1638
- def triangle(n)
1639
- (byebug) list # same line range as before going into irb
1640
- [1, 10] in /path/to/triangle.rb
1641
- 1: # Compute the n'th triangle number, the hard way: triangle(n) == (n*(n+1))/2
1642
- => 2: def triangle(n)
1643
- 3: tri = 0
1644
- 4: 0.upto(n) do |i|
1645
- 5: tri += i
1646
- 6: end
1647
- 7: tri
1648
- 8: end
1649
- 9:
1650
- 10: if __FILE__ == $0
1636
+ irb(main):002:0> exit
1651
1637
  (byebug)
1652
1638
  ```
1653
1639
 
data/ext/byebug/byebug.c CHANGED
@@ -37,9 +37,9 @@ Breakpoints(VALUE self)
37
37
 
38
38
  /*
39
39
  * call-seq:
40
- * Byebug.catchpoints -> array
40
+ * Byebug.catchpoints -> hash
41
41
  *
42
- * Returns an array of catchpoints.
42
+ * Returns the catchpoints hash.
43
43
  */
44
44
  static VALUE
45
45
  Catchpoints(VALUE self)
@@ -352,7 +352,7 @@ return_event(VALUE trace_point, void *data)
352
352
  {
353
353
  file = rb_tracearg_path(trace_arg);
354
354
  /*
355
- * TODO: Sometimes the TracePoint API gives some return events without
355
+ * @todo Sometimes the TracePoint API gives some return events without
356
356
  * file:line information, so we need to guard for nil until we know what's
357
357
  * going on. This happens, for example, with active_support core extensions:
358
358
  *
@@ -841,7 +841,7 @@ Set_post_mortem(VALUE self, VALUE value)
841
841
  * call-seq:
842
842
  * Byebug.add_catchpoint(exception) -> exception
843
843
  *
844
- * Adds a new exception to the catchpoints array.
844
+ * Adds a new exception to the catchpoints hash.
845
845
  */
846
846
  static VALUE
847
847
  Add_catchpoint(VALUE self, VALUE value)
data/ext/byebug/byebug.h CHANGED
@@ -121,9 +121,6 @@ extern VALUE context_backtrace_set(const rb_debug_inspector_t * inspector,
121
121
 
122
122
  /* functions from breakpoint.c */
123
123
  extern void Init_breakpoint(VALUE mByebug);
124
- extern VALUE catchpoint_hit_count(VALUE catchpoints, VALUE exception,
125
- VALUE * exception_name);
126
-
127
124
  extern VALUE find_breakpoint_by_pos(VALUE breakpoints, VALUE source, VALUE pos,
128
125
  VALUE bind);
129
126
 
@@ -35,7 +35,7 @@ module Byebug
35
35
 
36
36
  cmd = line ? "#{editor} +#{line} #{file}" : "#{editor} #{file}"
37
37
 
38
- system(cmd)
38
+ Kernel.system(cmd)
39
39
  end
40
40
 
41
41
  private
@@ -25,12 +25,13 @@ module Byebug
25
25
  end
26
26
 
27
27
  def execute
28
- unless processor.interface.is_a?(LocalInterface)
28
+ unless processor.interface.instance_of?(LocalInterface)
29
29
  return errmsg(pr('base.errors.only_local'))
30
30
  end
31
31
 
32
- # IRB tries to parse ARGV so we must clear it. See issue 197
33
- with_clean_argv { IRB.start(__FILE__) }
32
+ # @todo IRB tries to parse ARGV so we must clear it (see #197). Add a
33
+ # test case for it so we can remove this comment.
34
+ with_clean_argv { IRB.start }
34
35
  end
35
36
 
36
37
  private
@@ -25,17 +25,17 @@ module Byebug
25
25
  end
26
26
 
27
27
  def execute
28
- unless processor.interface.is_a?(LocalInterface)
28
+ unless processor.interface.instance_of?(LocalInterface)
29
29
  return errmsg(pr('base.errors.only_local'))
30
30
  end
31
31
 
32
32
  begin
33
33
  require 'pry'
34
34
  rescue LoadError
35
- errmsg(pr('pry.errors.not_installed'))
35
+ return errmsg(pr('pry.errors.not_installed'))
36
36
  end
37
37
 
38
- context.binding.pry
38
+ Pry.start(context.frame._binding)
39
39
  end
40
40
  end
41
41
  end
@@ -39,7 +39,7 @@ module Byebug
39
39
  argv += (@match[:args] ? @match[:args].shellsplit : $ARGV.compact)
40
40
 
41
41
  puts pr('restart.success', cmd: argv.shelljoin)
42
- exec(*argv)
42
+ Kernel.exec(*argv)
43
43
  end
44
44
  end
45
45
  end
data/lib/byebug/frame.rb CHANGED
@@ -47,13 +47,16 @@ module Byebug
47
47
  #
48
48
  # Gets local variables for the frame.
49
49
  #
50
- # TODO: Use brand new local_variable_get, local_variable_set and
51
- # local_variable defined for rubies >= 2.1
50
+ # @todo Use `Binding#local_variables` directly once we drop 2.1 support
51
+ # since it's a public method since ruby 2.2
52
52
  #
53
53
  def locals
54
54
  return [] unless _binding
55
55
 
56
- _binding.eval('local_variables.inject({}){|h, v| h[v] = eval(v.to_s); h}')
56
+ _binding.eval('local_variables').each_with_object({}) do |e, a|
57
+ a[e] = _binding.local_variable_get(e)
58
+ a
59
+ end
57
60
  end
58
61
 
59
62
  #
@@ -9,7 +9,7 @@ module Byebug
9
9
  #
10
10
  # If either +min+ or +max+ is nil, that value has no bound.
11
11
  #
12
- # TODO: Remove the `cmd` parameter. It has nothing to do with the method's
12
+ # @todo Remove the `cmd` parameter. It has nothing to do with the method's
13
13
  # purpose.
14
14
  #
15
15
  def get_int(str, cmd, min = nil, max = nil)
@@ -28,10 +28,12 @@ module Byebug
28
28
  def context_from_thread(thnum)
29
29
  ctx = Byebug.contexts.find { |c| c.thnum.to_s == thnum }
30
30
 
31
- err = case
32
- when ctx.nil? then pr('thread.errors.no_thread')
33
- when ctx == context then pr('thread.errors.current_thread')
34
- when ctx.ignored? then pr('thread.errors.ignored', arg: thnum)
31
+ err = if ctx.nil?
32
+ pr('thread.errors.no_thread')
33
+ elsif ctx == context
34
+ pr('thread.errors.current_thread')
35
+ elsif ctx.ignored?
36
+ pr('thread.errors.ignored', arg: thnum)
35
37
  end
36
38
 
37
39
  [ctx, err]
@@ -39,7 +41,7 @@ module Byebug
39
41
 
40
42
  private
41
43
 
42
- # TODO: Check whether it is Byebug.current_context or context
44
+ # @todo Check whether it is Byebug.current_context or context
43
45
  def location(ctx)
44
46
  return context.location if ctx == Byebug.current_context
45
47
 
data/lib/byebug/remote.rb CHANGED
@@ -1,9 +1,10 @@
1
1
  require 'socket'
2
+ require 'byebug/processors/control_processor'
2
3
 
3
4
  #
4
5
  # Remote debugging functionality.
5
6
  #
6
- # TODO: Refactor & add tests
7
+ # @todo Refactor & add tests
7
8
  #
8
9
  module Byebug
9
10
  # Port number used for remote debugging
@@ -58,7 +58,7 @@ module Byebug
58
58
  end
59
59
 
60
60
  #
61
- # TODO: DRY this up. Very similar code exists in the CommandList class
61
+ # @todo DRY this up. Very similar code exists in the CommandList class
62
62
  #
63
63
  def help_all
64
64
  output = " List of supported settings:\n\n"
@@ -3,5 +3,5 @@
3
3
  # Reopen main module to define the library version
4
4
  #
5
5
  module Byebug
6
- VERSION = '8.2.5'.freeze
6
+ VERSION = '9.0.0'.freeze
7
7
  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: 8.2.5
4
+ version: 9.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: 2016-04-27 00:00:00.000000000 Z
13
+ date: 2016-05-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  version: '0'
190
190
  requirements: []
191
191
  rubyforge_project:
192
- rubygems_version: 2.6.3
192
+ rubygems_version: 2.5.1
193
193
  signing_key:
194
194
  specification_version: 4
195
195
  summary: Ruby 2.0 fast debugger - base + CLI