byebug 6.0.0 → 6.0.1

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: f0c3c3868ab03af89e252040738d248a93ee7fd5
4
- data.tar.gz: 86c48afc3df76c6ad06f71e4f187cf7ebfb4d753
3
+ metadata.gz: cbe8d8d298e3c0b99567a1f38024883979f90910
4
+ data.tar.gz: 2b39f4c8cd9d970ae1e2d2c29ed4462cf35d322b
5
5
  SHA512:
6
- metadata.gz: f1afe8ff550a182da17c136b3a49030f8370974e3c9b5e818da6f8c5d3c6e4fbe78731ee1840d848e7fbac0baa0b87ea031df44f4c316f69c6ac162bcd523187
7
- data.tar.gz: 4c1abe7a5407b9483ebdc7f7c14ac2f142434b699566a06127759593917b466b8986e4cff3b583206a5bd72ac56d9fc38c1dff6ff4b9421ca246885b251f7d74
6
+ metadata.gz: e8450631530abd699cf86afdfe4787676aa3e4c405c20fadb1acc455dff420b3afbfda3d2e4cab6d0f6a2ae6306e01d8f76b48330efcb69fe8f4182a9bbb5d82
7
+ data.tar.gz: b992d11ab40ad0641be835e4ecc3b2643fc24d88a19fba43d5f7aa95f2b234011506d9328e6d7e0cad68dbb9e9f906e78a646aa252251ff73b7a1a2c30e94d9a
@@ -1,3 +1,8 @@
1
+ ## 6.0.1 - 2015-08-19
2
+ ### Fixed
3
+ * Bug in evaluation where the user would lose the command prompt when entering
4
+ an expression with a syntax error.
5
+
1
6
  ## 6.0.0 - 2015-08-17
2
7
  ### Removed
3
8
  * `autoeval` setting. I haven't heard of anyone setting it to false.
data/README.md CHANGED
@@ -53,9 +53,8 @@ Windows [![Vey][vey]][vey_url]
53
53
  [debugger][].
54
54
 
55
55
  * Recommended:
56
- - MRI 2.0.0-p576 or higher.
57
- - MRI 2.1.3 or higher.
58
- - MRI 2.2.1 or higher.
56
+ - MRI 2.1.7 or higher.
57
+ - MRI 2.2.3 or higher.
59
58
 
60
59
 
61
60
  ## Install
@@ -45,6 +45,8 @@ module Byebug
45
45
 
46
46
  errmsg(pr('break.errors.expression', expr: @match[2]))
47
47
  b.enabled = false
48
+ rescue => e
49
+ errmsg(e.message)
48
50
  end
49
51
 
50
52
  private
@@ -70,7 +72,7 @@ module Byebug
70
72
  end
71
73
 
72
74
  def target_object(str)
73
- k = warning_eval(str)
75
+ k = error_eval(str)
74
76
 
75
77
  k && k.is_a?(Module) ? k.name : str
76
78
  rescue
@@ -56,7 +56,7 @@ module Byebug
56
56
  end
57
57
 
58
58
  def eval_expr(expression)
59
- thread_safe_eval(expression).inspect
59
+ error_eval(expression).inspect
60
60
  rescue
61
61
  '(undefined)'
62
62
  end
@@ -35,6 +35,8 @@ module Byebug
35
35
  return help_for(@match[1], command) unless @match[2]
36
36
 
37
37
  help_for(@match[2], subcommand)
38
+ rescue => e
39
+ errmsg(e.message)
38
40
  end
39
41
 
40
42
  private
@@ -14,7 +14,7 @@ module Byebug
14
14
  self.allow_in_post_mortem = true
15
15
 
16
16
  def self.regexp
17
- /^\s* u(?:p)? (?:\s+(\S+))? \s*$/x
17
+ /^\s* up (?:\s+(\S+))? \s*$/x
18
18
  end
19
19
 
20
20
  def self.description
@@ -19,8 +19,6 @@ module Byebug
19
19
  # @param expression [String] Expression to evaluate
20
20
  #
21
21
  def single_thread_eval(expression)
22
- return error_eval(expression) if Setting[:stack_on_error]
23
-
24
22
  warning_eval(expression)
25
23
  end
26
24
 
@@ -29,9 +27,7 @@ module Byebug
29
27
  # returning nil in an error happens.
30
28
  #
31
29
  def silent_eval(str, binding = frame._binding)
32
- binding.eval(str)
33
- rescue StandardError, ScriptError
34
- nil
30
+ safe_eval(str, binding) { |_e| nil }
35
31
  end
36
32
 
37
33
  #
@@ -39,7 +35,7 @@ module Byebug
39
35
  # handling the errors at an error level.
40
36
  #
41
37
  def error_eval(str, binding = frame._binding)
42
- safe_eval(str, binding) { |e| error_msg(e) }
38
+ safe_eval(str, binding) { |e| fail(e, msg(e)) }
43
39
  end
44
40
 
45
41
  #
@@ -47,7 +43,7 @@ module Byebug
47
43
  # handling the errors at a warning level.
48
44
  #
49
45
  def warning_eval(str, binding = frame._binding)
50
- safe_eval(str, binding) { |e| warning_msg(e) }
46
+ safe_eval(str, binding) { |e| errmsg(msg(e)) }
51
47
  end
52
48
 
53
49
  private
@@ -55,19 +51,25 @@ module Byebug
55
51
  def safe_eval(str, binding)
56
52
  binding.eval(str)
57
53
  rescue StandardError, ScriptError => e
58
- raise(e, yield(e))
54
+ yield(e)
55
+ end
56
+
57
+ def msg(e)
58
+ msg = Setting[:stack_on_error] ? error_msg(e) : warning_msg(e)
59
+
60
+ pr('eval.exception', text_message: msg)
59
61
  end
60
62
 
61
63
  def error_msg(e)
62
64
  at = e.backtrace
63
- locations = ["#{at.shift}: #{e.class} Exception(#{e.message})"]
64
- locations += at.map { |path| "\tfrom #{path}" }
65
65
 
66
- pr('eval.exception', text_message: locations.join("\n"))
66
+ locations = ["#{at.shift}: #{warning_msg(e)}"]
67
+ locations += at.map { |path| "\tfrom #{path}" }
68
+ locations.join("\n")
67
69
  end
68
70
 
69
71
  def warning_msg(e)
70
- pr('eval.exception', text_message: "#{e.class} Exception: #{e.message}")
72
+ "#{e.class} Exception: #{e.message}"
71
73
  end
72
74
 
73
75
  #
@@ -156,8 +156,6 @@ module Byebug
156
156
  return command.new(self, input).execute if command
157
157
 
158
158
  puts thread_safe_eval(input)
159
- rescue => e
160
- errmsg(e)
161
159
  end
162
160
  end
163
161
  end
@@ -25,6 +25,8 @@ module Byebug
25
25
  fail CommandNotFound.new(@match[1], self.class) unless subcmd
26
26
 
27
27
  subcmd.new(processor, arguments).execute
28
+ rescue => e
29
+ errmsg(e.message)
28
30
  end
29
31
 
30
32
  #
@@ -2,5 +2,5 @@
2
2
  # Reopen main module to define the library version
3
3
  #
4
4
  module Byebug
5
- VERSION = '6.0.0'
5
+ VERSION = '6.0.1'
6
6
  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: 6.0.0
4
+ version: 6.0.1
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-17 00:00:00.000000000 Z
13
+ date: 2015-08-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -152,7 +152,6 @@ files:
152
152
  - lib/byebug/remote.rb
153
153
  - lib/byebug/runner.rb
154
154
  - lib/byebug/setting.rb
155
- - lib/byebug/settings/autoeval.rb
156
155
  - lib/byebug/settings/autoirb.rb
157
156
  - lib/byebug/settings/autolist.rb
158
157
  - lib/byebug/settings/autosave.rb
@@ -189,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
188
  version: '0'
190
189
  requirements: []
191
190
  rubyforge_project:
192
- rubygems_version: 2.4.5
191
+ rubygems_version: 2.4.5.1
193
192
  signing_key:
194
193
  specification_version: 4
195
194
  summary: Ruby 2.0 fast debugger - base + CLI
@@ -1,14 +0,0 @@
1
- require 'byebug/setting'
2
-
3
- module Byebug
4
- #
5
- # Setting for automatic evaluation of unknown commands.
6
- #
7
- class AutoevalSetting < Setting
8
- DEFAULT = true
9
-
10
- def banner
11
- 'Automatically evaluate unrecognized commands'
12
- end
13
- end
14
- end