byebug 8.2.1 → 8.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 can't be negative.");
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
 
@@ -14,6 +14,7 @@ makefile_config['CFLAGS'] << ' -gdwarf-2 -g3 -O0' if ENV['debug']
14
14
 
15
15
  if makefile_config['CC'] =~ /clang/
16
16
  makefile_config['CFLAGS'] << ' -Wno-unknown-warning-option'
17
+ makefile_config['CFLAGS'] << ' -Wno-ignored-attributes'
17
18
  end
18
19
 
19
20
  dir_config('ruby')
@@ -30,5 +30,5 @@ module Kernel
30
30
  Byebug.attach
31
31
  end
32
32
 
33
- alias_method :debugger, :byebug
33
+ alias debugger byebug
34
34
  end
@@ -55,7 +55,7 @@ module Byebug
55
55
  end
56
56
 
57
57
  def add(exception)
58
- if warning_eval("#{exception.is_a?(Class)}")
58
+ if warning_eval(exception.is_a?(Class).to_s)
59
59
  errmsg pr('catch.errors.not_class', class: exception)
60
60
  end
61
61
 
@@ -19,7 +19,7 @@ module Byebug
19
19
  <<-EOD
20
20
  disp[lay][ <expression>]
21
21
 
22
- #{short_descripton}
22
+ #{short_description}
23
23
 
24
24
  If <expression> specified, adds <expression> into display expression
25
25
  list. Otherwise, it lists all expressions.
@@ -65,7 +65,7 @@ module Byebug
65
65
  end
66
66
 
67
67
  def valid_range?(first, last, max)
68
- first <= last && (1..max).include?(first) && (1..max).include?(last)
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).include?(lineno + 1)
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
  #
@@ -78,8 +78,8 @@ module Byebug
78
78
  return 0 unless backtrace
79
79
 
80
80
  backtrace.drop_while { |l| ignored_file?(l.first.path) }
81
- .take_while { |l| !ignored_file?(l.first.path) }
82
- .size
81
+ .take_while { |l| !ignored_file?(l.first.path) }
82
+ .size
83
83
  end
84
84
 
85
85
  def interrupt
@@ -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
- home_rc = File.expand_path(File.join(ENV['HOME'].to_s, init_file))
51
- run_script(home_rc) if File.exist?(home_rc)
50
+ run_rc_file(ENV['HOME'])
52
51
 
53
- cwd_rc = File.expand_path(File.join('.', init_file))
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 run_script(file, verbose = false)
85
+ def run_rc_file(base_path)
88
86
  old_interface = Context.interface
89
- Context.interface = ScriptInterface.new(file, verbose)
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
@@ -43,7 +43,7 @@ module Byebug
43
43
  end
44
44
 
45
45
  def out_of_bounds?(pos)
46
- !(0...context.stack_size).include?(pos)
46
+ !(0...context.stack_size).cover?(pos)
47
47
  end
48
48
 
49
49
  def frame_err(msg)
@@ -1,9 +1,10 @@
1
+ # frozen_string_literal: true
1
2
  module Byebug
2
3
  #
3
4
  # Interface class for standard byebug use.
4
5
  #
5
6
  class LocalInterface < Interface
6
- EOF_ALIAS = 'continue'
7
+ EOF_ALIAS = 'continue'.freeze
7
8
 
8
9
  def initialize
9
10
  super()
@@ -7,9 +7,8 @@ module Byebug
7
7
 
8
8
  def initialize
9
9
  super()
10
- @input = []
11
- @output = []
12
- @error = []
10
+
11
+ clear
13
12
  end
14
13
 
15
14
  def errmsg(message)
@@ -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, &block)
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 = block.call(item, index)
58
+ args = yield item, index
58
59
  array << args if args
59
60
  end
60
61
  end
@@ -43,7 +43,7 @@ module Byebug
43
43
 
44
44
  def_delegators :interface, :errmsg, :puts, :confirm
45
45
 
46
- def_delegators Byebug, :commands
46
+ def_delegators :Byebug, :commands
47
47
 
48
48
  #
49
49
  # Available commands
@@ -17,7 +17,7 @@ module Byebug
17
17
  command = command_list.match(input)
18
18
 
19
19
  if command
20
- command.new(self).execute
20
+ command.new(self, input).execute
21
21
  else
22
22
  errmsg('Unknown command')
23
23
  end
@@ -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? ? key =~ /#{abbr}/ : key =~ /#{shortcut}/
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'
@@ -1,6 +1,7 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Reopen main module to define the library version
3
4
  #
4
5
  module Byebug
5
- VERSION = '8.2.1'
6
+ VERSION = '8.2.2'.freeze
6
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.1
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: 2015-11-26 00:00:00.000000000 Z
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.4.5.1
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