byebug 6.0.1 → 6.0.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 +5 -0
- data/lib/byebug/commands/break.rb +0 -2
- data/lib/byebug/commands/help.rb +0 -2
- data/lib/byebug/commands/history.rb +1 -1
- data/lib/byebug/commands/list.rb +5 -5
- data/lib/byebug/helpers/parse.rb +3 -4
- data/lib/byebug/helpers/thread.rb +25 -21
- data/lib/byebug/processors/command_processor.rb +2 -0
- data/lib/byebug/subcommands.rb +4 -5
- data/lib/byebug/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bd941f093c6a49a371dfefe4cb06d9285eb5154
|
4
|
+
data.tar.gz: cc056395c95ece29b62647a4875d759ac18708c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 092d68626a8dc9190494a66d84405c5e36b709e1ca2548eb4b76e7b949aa1605548e3cc7a19aeb5988cc1480adfc21619f5603dce31471020ef2c04c83c287e7
|
7
|
+
data.tar.gz: e6d15db6847705de02000c299a1ca7be98d63e4f15ac306348a82d19d9667f90451c01dbee66c12744d4166f558bffbb1cf9f3ac7f46861b3cbde8257cda2576
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 6.0.2 - 2015-08-20
|
2
|
+
### Fixed
|
3
|
+
* The user should always be given back a prompt unless (s)he explicitly states
|
4
|
+
the opposite. This provides a more general fix to the bug resolved in 6.0.1.
|
5
|
+
|
1
6
|
## 6.0.1 - 2015-08-19
|
2
7
|
### Fixed
|
3
8
|
* Bug in evaluation where the user would lose the command prompt when entering
|
data/lib/byebug/commands/help.rb
CHANGED
@@ -30,7 +30,7 @@ module Byebug
|
|
30
30
|
history = processor.interface.history
|
31
31
|
|
32
32
|
if @match[:num_cmds]
|
33
|
-
size, = get_int(@match[:num_cmds], 'history', 1, history.size)
|
33
|
+
size, err = get_int(@match[:num_cmds], 'history', 1, history.size)
|
34
34
|
return errmsg(err) unless size
|
35
35
|
end
|
36
36
|
|
data/lib/byebug/commands/list.rb
CHANGED
@@ -36,11 +36,11 @@ module Byebug
|
|
36
36
|
|
37
37
|
def execute
|
38
38
|
msg = "No sourcefile available for #{frame.file}"
|
39
|
-
|
39
|
+
fail(msg) unless File.exist?(frame.file)
|
40
40
|
|
41
41
|
max_lines = n_lines(frame.file)
|
42
42
|
b, e = range(@match[2], max_lines)
|
43
|
-
|
43
|
+
fail('Invalid line range') unless valid_range?(b, e, max_lines)
|
44
44
|
|
45
45
|
display_lines(b, e)
|
46
46
|
|
@@ -85,11 +85,11 @@ module Byebug
|
|
85
85
|
|
86
86
|
def parse_range(input, size, max_line)
|
87
87
|
first, err = get_int(lower_bound(input), 'List', 1, max_line)
|
88
|
-
|
88
|
+
fail(err) unless first
|
89
89
|
|
90
90
|
if upper_bound(input)
|
91
|
-
last, = get_int(upper_bound(input), 'List', 1, max_line)
|
92
|
-
|
91
|
+
last, err = get_int(upper_bound(input), 'List', 1, max_line)
|
92
|
+
fail(err) unless last
|
93
93
|
|
94
94
|
last = amend(last, max_line)
|
95
95
|
else
|
data/lib/byebug/helpers/parse.rb
CHANGED
@@ -14,17 +14,16 @@ module Byebug
|
|
14
14
|
#
|
15
15
|
def get_int(str, cmd, min = nil, max = nil)
|
16
16
|
if str !~ /\A-?[0-9]+\z/
|
17
|
-
|
18
|
-
return nil, errmsg(err)
|
17
|
+
return nil, pr('parse.errors.int.not_number', cmd: cmd, str: str)
|
19
18
|
end
|
20
19
|
|
21
20
|
int = str.to_i
|
22
21
|
if min && int < min
|
23
22
|
err = pr('parse.errors.int.too_low', cmd: cmd, str: str, min: min)
|
24
|
-
return
|
23
|
+
return nil, err
|
25
24
|
elsif max && int > max
|
26
25
|
err = pr('parse.errors.int.too_high', cmd: cmd, str: str, max: max)
|
27
|
-
return
|
26
|
+
return nil, err
|
28
27
|
end
|
29
28
|
|
30
29
|
int
|
@@ -9,30 +9,12 @@ module Byebug
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def thread_arguments(ctx)
|
12
|
-
status_flag = if ctx.suspended?
|
13
|
-
'$'
|
14
|
-
else
|
15
|
-
current_thread?(ctx) ? '+' : ' '
|
16
|
-
end
|
17
|
-
|
18
|
-
debug_flag = ctx.ignored? ? '!' : ' '
|
19
|
-
|
20
|
-
# Check whether it is Byebug.current_context or context
|
21
|
-
if ctx == Byebug.current_context
|
22
|
-
file_line = context.location
|
23
|
-
else
|
24
|
-
backtrace = ctx.thread.backtrace_locations
|
25
|
-
if backtrace && backtrace[0]
|
26
|
-
file_line = "#{backtrace[0].path}:#{backtrace[0].lineno}"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
12
|
{
|
31
|
-
status_flag: status_flag,
|
32
|
-
debug_flag: debug_flag,
|
13
|
+
status_flag: status_flag(ctx),
|
14
|
+
debug_flag: debug_flag(ctx),
|
33
15
|
id: ctx.thnum,
|
34
16
|
thread: ctx.thread.inspect,
|
35
|
-
file_line:
|
17
|
+
file_line: location(ctx),
|
36
18
|
pid: Process.pid,
|
37
19
|
status: ctx.thread.status,
|
38
20
|
current: current_thread?(ctx)
|
@@ -54,6 +36,28 @@ module Byebug
|
|
54
36
|
|
55
37
|
[ctx, err]
|
56
38
|
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
# TODO: Check whether it is Byebug.current_context or context
|
43
|
+
def location(ctx)
|
44
|
+
return context.location if ctx == Byebug.current_context
|
45
|
+
|
46
|
+
backtrace = ctx.thread.backtrace_locations
|
47
|
+
return '' unless backtrace && backtrace[0]
|
48
|
+
|
49
|
+
"#{backtrace[0].path}:#{backtrace[0].lineno}"
|
50
|
+
end
|
51
|
+
|
52
|
+
def status_flag(ctx)
|
53
|
+
return '$' if ctx.suspended?
|
54
|
+
|
55
|
+
current_thread?(ctx) ? '+' : ' '
|
56
|
+
end
|
57
|
+
|
58
|
+
def debug_flag(ctx)
|
59
|
+
ctx.ignored? ? '!' : ' '
|
60
|
+
end
|
57
61
|
end
|
58
62
|
end
|
59
63
|
end
|
data/lib/byebug/subcommands.rb
CHANGED
@@ -19,14 +19,13 @@ module Byebug
|
|
19
19
|
# Delegates to subcommands or prints help if no subcommand specified.
|
20
20
|
#
|
21
21
|
def execute
|
22
|
-
|
22
|
+
subcmd_name = @match[1]
|
23
|
+
return puts(help) unless subcmd_name
|
23
24
|
|
24
|
-
subcmd = subcommand_list.match(
|
25
|
-
fail CommandNotFound.new(
|
25
|
+
subcmd = subcommand_list.match(subcmd_name)
|
26
|
+
fail CommandNotFound.new(subcmd_name, self.class) unless subcmd
|
26
27
|
|
27
28
|
subcmd.new(processor, arguments).execute
|
28
|
-
rescue => e
|
29
|
-
errmsg(e.message)
|
30
29
|
end
|
31
30
|
|
32
31
|
#
|
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: 6.0.
|
4
|
+
version: 6.0.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: 2015-08-
|
13
|
+
date: 2015-08-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|