byebug 8.2.1 → 8.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +261 -94
- data/CONTRIBUTING.md +28 -39
- data/GUIDE.md +55 -65
- data/README.md +14 -24
- data/ext/byebug/context.c +1 -1
- data/ext/byebug/extconf.rb +1 -0
- data/lib/byebug/attacher.rb +1 -1
- data/lib/byebug/commands/catch.rb +1 -1
- data/lib/byebug/commands/display.rb +1 -1
- data/lib/byebug/commands/list.rb +2 -4
- data/lib/byebug/context.rb +2 -2
- data/lib/byebug/core.rb +9 -7
- data/lib/byebug/helpers/frame.rb +1 -1
- data/lib/byebug/interfaces/local_interface.rb +2 -1
- data/lib/byebug/interfaces/test_interface.rb +2 -3
- data/lib/byebug/printers/base.rb +4 -3
- data/lib/byebug/processors/command_processor.rb +1 -1
- data/lib/byebug/processors/script_processor.rb +1 -1
- data/lib/byebug/setting.rb +1 -1
- data/lib/byebug/settings/callstyle.rb +2 -1
- data/lib/byebug/version.rb +2 -1
- metadata +3 -3
data/ext/byebug/context.c
CHANGED
@@ -409,7 +409,7 @@ Context_step_into(int argc, VALUE * argv, VALUE self)
|
|
409
409
|
n_args = rb_scan_args(argc, argv, "11", &steps, &v_frame);
|
410
410
|
|
411
411
|
if (FIX2INT(steps) <= 0)
|
412
|
-
rb_raise(rb_eRuntimeError, "Steps argument
|
412
|
+
rb_raise(rb_eRuntimeError, "Steps argument must be positive.");
|
413
413
|
|
414
414
|
from_frame = n_args == 1 ? 0 : FIX2INT(v_frame);
|
415
415
|
|
data/ext/byebug/extconf.rb
CHANGED
data/lib/byebug/attacher.rb
CHANGED
data/lib/byebug/commands/list.rb
CHANGED
@@ -65,7 +65,7 @@ module Byebug
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def valid_range?(first, last, max)
|
68
|
-
first <= last && (1..max).
|
68
|
+
first <= last && (1..max).cover?(first) && (1..max).cover?(last)
|
69
69
|
end
|
70
70
|
|
71
71
|
#
|
@@ -127,15 +127,13 @@ module Byebug
|
|
127
127
|
|
128
128
|
File.foreach(frame.file).with_index do |line, lineno|
|
129
129
|
break if lineno + 1 > max
|
130
|
-
next unless (min..max).
|
130
|
+
next unless (min..max).cover?(lineno + 1)
|
131
131
|
|
132
132
|
mark = lineno + 1 == frame.line ? '=> ' : ' '
|
133
133
|
puts format("#{mark}%#{max.to_s.size}d: %s", lineno + 1, line)
|
134
134
|
end
|
135
135
|
end
|
136
136
|
|
137
|
-
private
|
138
|
-
|
139
137
|
#
|
140
138
|
# @param range [String] A string with an integer range format
|
141
139
|
#
|
data/lib/byebug/context.rb
CHANGED
data/lib/byebug/core.rb
CHANGED
@@ -47,11 +47,9 @@ module Byebug
|
|
47
47
|
# are debugging, in the directory where you invoke byebug.
|
48
48
|
#
|
49
49
|
def run_init_script
|
50
|
-
|
51
|
-
run_script(home_rc) if File.exist?(home_rc)
|
50
|
+
run_rc_file(ENV['HOME'])
|
52
51
|
|
53
|
-
|
54
|
-
run_script(cwd_rc) if File.exist?(cwd_rc) && cwd_rc != home_rc
|
52
|
+
run_rc_file(Dir.pwd) unless Dir.pwd == ENV['HOME']
|
55
53
|
end
|
56
54
|
|
57
55
|
def self.load_settings
|
@@ -82,11 +80,15 @@ module Byebug
|
|
82
80
|
private
|
83
81
|
|
84
82
|
#
|
85
|
-
# Runs a script file
|
83
|
+
# Runs a initialization script file
|
86
84
|
#
|
87
|
-
def
|
85
|
+
def run_rc_file(base_path)
|
88
86
|
old_interface = Context.interface
|
89
|
-
|
87
|
+
|
88
|
+
rc_file = File.expand_path(File.join(base_path, init_file))
|
89
|
+
return unless File.exist?(rc_file)
|
90
|
+
|
91
|
+
Context.interface = ScriptInterface.new(rc_file)
|
90
92
|
|
91
93
|
ScriptProcessor.new(nil).process_commands
|
92
94
|
ensure
|
data/lib/byebug/helpers/frame.rb
CHANGED
data/lib/byebug/printers/base.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'yaml'
|
2
3
|
|
3
4
|
module Byebug
|
@@ -9,7 +10,7 @@ module Byebug
|
|
9
10
|
class MissedPath < StandardError; end
|
10
11
|
class MissedArgument < StandardError; end
|
11
12
|
|
12
|
-
SEPARATOR = '.'
|
13
|
+
SEPARATOR = '.'.freeze
|
13
14
|
|
14
15
|
def type
|
15
16
|
self.class.name.split('::').last.downcase
|
@@ -51,10 +52,10 @@ module Byebug
|
|
51
52
|
end
|
52
53
|
end
|
53
54
|
|
54
|
-
def array_of_args(collection, &
|
55
|
+
def array_of_args(collection, &_block)
|
55
56
|
collection_with_index = collection.each.with_index
|
56
57
|
collection_with_index.each_with_object([]) do |(item, index), array|
|
57
|
-
args =
|
58
|
+
args = yield item, index
|
58
59
|
array << args if args
|
59
60
|
end
|
60
61
|
end
|
data/lib/byebug/setting.rb
CHANGED
@@ -52,7 +52,7 @@ module Byebug
|
|
52
52
|
def find(shortcut)
|
53
53
|
abbr = shortcut =~ /^no/ ? shortcut[2..-1] : shortcut
|
54
54
|
matches = settings.select do |key, value|
|
55
|
-
value.boolean? ?
|
55
|
+
key =~ (value.boolean? ? /#{abbr}/ : /#{shortcut}/)
|
56
56
|
end
|
57
57
|
matches.size == 1 ? matches.values.first : nil
|
58
58
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'byebug/setting'
|
2
3
|
|
3
4
|
module Byebug
|
@@ -5,7 +6,7 @@ module Byebug
|
|
5
6
|
# Setting to customize the verbosity level for stack frames.
|
6
7
|
#
|
7
8
|
class CallstyleSetting < Setting
|
8
|
-
DEFAULT = 'long'
|
9
|
+
DEFAULT = 'long'.freeze
|
9
10
|
|
10
11
|
def banner
|
11
12
|
'Set how you want method call parameters to be displayed'
|
data/lib/byebug/version.rb
CHANGED
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.
|
4
|
+
version: 8.2.2
|
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:
|
13
|
+
date: 2016-02-01 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.
|
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
|