byebug 3.1.1 → 3.1.2
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/bin/byebug +10 -6
- data/lib/byebug/helper.rb +7 -4
- data/lib/byebug/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 960dc1ecb2fe9ff5b35966884c7cee07438ea3c5
|
4
|
+
data.tar.gz: 081117a82d94544eaa12479415886bb043e3835c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8f0ff414f1341bc137b5a08e1091bbc27e315cffee95f65a235e008973156d830c3fccb8441d6cc85357312d1e18405cc4fcb30c1068d30f0131df55e556d22
|
7
|
+
data.tar.gz: c5034ade9a0708f284fc9ea0f4c32d27643052109acdcd9783987b4e7ff2009ee10b39d24f3382d96e0d322b63ed2ca8da49f37d7d6be1be1fb305f43fd99d06
|
data/CHANGELOG.md
CHANGED
data/bin/byebug
CHANGED
@@ -72,17 +72,21 @@ def debug_program(options)
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
#
|
76
|
-
#
|
75
|
+
#
|
76
|
+
# Do a shell-like path lookup for prog_script and return the results. If we
|
77
|
+
# can't find anything return prog_script.
|
78
|
+
#
|
77
79
|
def whence_file(prog_script)
|
78
80
|
if prog_script.index(File::SEPARATOR)
|
79
81
|
# Don't search since this name has path separator components
|
80
82
|
return prog_script
|
81
83
|
end
|
84
|
+
|
82
85
|
for dirname in ENV['PATH'].split(File::PATH_SEPARATOR) do
|
83
86
|
prog_script_try = File.join(dirname, prog_script)
|
84
87
|
return prog_script_try if File.exist?(prog_script_try)
|
85
88
|
end
|
89
|
+
|
86
90
|
# Failure
|
87
91
|
return prog_script
|
88
92
|
end
|
@@ -210,7 +214,7 @@ if ARGV.empty?
|
|
210
214
|
exit(-1)
|
211
215
|
end
|
212
216
|
|
213
|
-
#
|
217
|
+
# Save debugged program
|
214
218
|
prog_script = ARGV.shift
|
215
219
|
prog_script = whence_file(prog_script) unless File.exist?(prog_script)
|
216
220
|
Byebug::PROG_SCRIPT = File.expand_path prog_script
|
@@ -218,11 +222,11 @@ Byebug::PROG_SCRIPT = File.expand_path prog_script
|
|
218
222
|
# Set up trace hook for byebug
|
219
223
|
Byebug.start
|
220
224
|
|
221
|
-
Byebug.setting[:post_mortem] = options.post_mortem
|
222
|
-
|
223
225
|
# load initrc script (e.g. .byebugrc)
|
224
226
|
Byebug.run_init_script(StringIO.new) unless options.nx
|
225
227
|
|
228
|
+
Byebug::Setting[:post_mortem] = options.post_mortem
|
229
|
+
|
226
230
|
# run restore-settings startup script if specified
|
227
231
|
if options.restart_script
|
228
232
|
require 'fileutils'
|
@@ -236,7 +240,7 @@ if options.script
|
|
236
240
|
end
|
237
241
|
|
238
242
|
options.stop = false if options.tracing
|
239
|
-
Byebug
|
243
|
+
Byebug::Setting[:linetrace] = options.tracing
|
240
244
|
|
241
245
|
loop do
|
242
246
|
debug_program(options)
|
data/lib/byebug/helper.rb
CHANGED
@@ -2,9 +2,10 @@ module Byebug
|
|
2
2
|
module ParseFunctions
|
3
3
|
Position_regexp = '(?:(\d+)|(.+?)[:.#]([^.:\s]+))'
|
4
4
|
|
5
|
-
#
|
6
|
-
#
|
7
|
-
# value has no bound.
|
5
|
+
#
|
6
|
+
# Parse 'str' of command 'cmd' as an integer between min and max. If either
|
7
|
+
# min or max is nil, that value has no bound.
|
8
|
+
#
|
8
9
|
def get_int(str, cmd, min = nil, max = nil, default = 1)
|
9
10
|
unless str
|
10
11
|
return default if default
|
@@ -28,7 +29,9 @@ module Byebug
|
|
28
29
|
end
|
29
30
|
end
|
30
31
|
|
31
|
-
#
|
32
|
+
#
|
33
|
+
# Returns true if code is syntactically correct for Ruby.
|
34
|
+
#
|
32
35
|
def syntax_valid?(code)
|
33
36
|
eval("BEGIN {return true}\n#{code}", nil, '', 0)
|
34
37
|
rescue SyntaxError
|
data/lib/byebug/version.rb
CHANGED