From 72c79e0dab5c99aa88169556e9ffe835eac64d64 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 5 Mar 2018 20:45:12 -0300 Subject: [PATCH] Bump rubocop from 0.52.1 to 0.53.0 (#438) Bumps [rubocop](https://github.com/bbatsov/rubocop) from 0.52.1 to 0.53.0. - [Release notes](https://github.com/bbatsov/rubocop/releases/tag/v0.53.0) - [Changelog](https://github.com/bbatsov/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/bbatsov/rubocop/compare/v0.52.1...v0.53.0) Signed-off-by: dependabot[bot] And fixes new offenses. --- Gemfile | 2 +- Gemfile.lock | 12 ++++++------ lib/byebug/helpers/bin.rb | 4 ++-- lib/byebug/helpers/eval.rb | 14 +++++++------- lib/byebug/helpers/frame.rb | 4 ++-- lib/byebug/history.rb | 8 ++++---- lib/byebug/printers/plain.rb | 2 +- lib/byebug/settings/autoirb.rb | 4 ++-- lib/byebug/settings/autolist.rb | 4 ++-- lib/byebug/settings/autopry.rb | 4 ++-- lib/byebug/settings/linetrace.rb | 4 ++-- lib/byebug/settings/post_mortem.rb | 4 ++-- 12 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Gemfile b/Gemfile index 7538a55d3..5d84c67a8 100644 --- a/Gemfile +++ b/Gemfile @@ -10,6 +10,6 @@ gem "minitest", "~> 5.11" gem "pry", "0.11.3" gem "rake", "~> 12.3" gem "rake-compiler", "~> 1.0" -gem "rubocop", "0.52.1" +gem "rubocop", "0.53.0" gem "simplecov", "0.15.1" gem "yard", "0.9.12" diff --git a/Gemfile.lock b/Gemfile.lock index 40afcbf2f..f3799e63d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,7 +8,7 @@ GEM specs: addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) - ast (2.3.0) + ast (2.4.0) chandler (0.7.0) netrc octokit (>= 2.2.0) @@ -31,8 +31,8 @@ GEM octokit (4.8.0) sawyer (~> 0.8.0, >= 0.5.3) parallel (1.12.1) - parser (2.4.0.2) - ast (~> 2.3) + parser (2.5.0.2) + ast (~> 2.4.0) powerpack (0.1.1) pry (0.11.3) coderay (~> 1.1.0) @@ -42,9 +42,9 @@ GEM rake (12.3.0) rake-compiler (1.0.4) rake - rubocop (0.52.1) + rubocop (0.53.0) parallel (~> 1.10) - parser (>= 2.4.0.2, < 3.0) + parser (>= 2.5) powerpack (~> 0.1) rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) @@ -73,7 +73,7 @@ DEPENDENCIES pry (= 0.11.3) rake (~> 12.3) rake-compiler (~> 1.0) - rubocop (= 0.52.1) + rubocop (= 0.53.0) simplecov (= 0.15.1) yard (= 0.9.12) diff --git a/lib/byebug/helpers/bin.rb b/lib/byebug/helpers/bin.rb index e1eef3ec4..9d79966fd 100644 --- a/lib/byebug/helpers/bin.rb +++ b/lib/byebug/helpers/bin.rb @@ -39,8 +39,8 @@ def executable_file_extensions ENV["PATHEXT"] ? ENV["PATHEXT"].split(";") : [""] end - def real_executable?(f) - File.executable?(f) && !File.directory?(f) + def real_executable?(file) + File.executable?(file) && !File.directory?(file) end end end diff --git a/lib/byebug/helpers/eval.rb b/lib/byebug/helpers/eval.rb index f545e57e4..f1393c8c3 100644 --- a/lib/byebug/helpers/eval.rb +++ b/lib/byebug/helpers/eval.rb @@ -63,22 +63,22 @@ def safe_eval(str, binding) yield(e) end - def msg(e) - msg = Setting[:stack_on_error] ? error_msg(e) : warning_msg(e) + def msg(exception) + msg = Setting[:stack_on_error] ? error_msg(exception) : warning_msg(exception) pr("eval.exception", text_message: msg) end - def error_msg(e) - at = e.backtrace + def error_msg(exception) + at = exception.backtrace - locations = ["#{at.shift}: #{warning_msg(e)}"] + locations = ["#{at.shift}: #{warning_msg(exception)}"] locations += at.map { |path| " from #{path}" } locations.join("\n") end - def warning_msg(e) - "#{e.class} Exception: #{e.message}" + def warning_msg(exception) + "#{exception.class} Exception: #{exception.message}" end # diff --git a/lib/byebug/helpers/frame.rb b/lib/byebug/helpers/frame.rb index fa5543177..a7ec5daa0 100644 --- a/lib/byebug/helpers/frame.rb +++ b/lib/byebug/helpers/frame.rb @@ -67,8 +67,8 @@ def direction(step) # # @param i [Integer] Integer to be converted in a proper positive index. # - def index_from_start(i) - i >= 0 ? i : context.stack_size + i + def index_from_start(index) + index >= 0 ? index : context.stack_size + index end end end diff --git a/lib/byebug/history.rb b/lib/byebug/history.rb index 548f05fc1..40bf6c719 100644 --- a/lib/byebug/history.rb +++ b/lib/byebug/history.rb @@ -45,7 +45,7 @@ def restore def save n_cmds = Setting[:histsize] > size ? size : Setting[:histsize] - open(Setting[:histfile], "w") do |file| + File.open(Setting[:histfile], "w") do |file| n_cmds.times { file.puts(pop) } end @@ -91,10 +91,10 @@ def to_s(n_cmds) end # - # Array of ids of the last n commands. + # Array of ids of the last +number+ commands. # - def last_ids(n) - (1 + size - n..size).to_a + def last_ids(number) + (1 + size - number..size).to_a end # diff --git a/lib/byebug/printers/plain.rb b/lib/byebug/printers/plain.rb index 1c73af16c..c6da20140 100644 --- a/lib/byebug/printers/plain.rb +++ b/lib/byebug/printers/plain.rb @@ -22,7 +22,7 @@ def print_collection(path, collection, &block) lines.join end - def print_variables(variables, *_) + def print_variables(variables, *_unused) print_collection("variable.variable", variables) do |(key, value), _| value = value.nil? ? "nil" : value.to_s if "#{key} = #{value}".size > Setting[:width] diff --git a/lib/byebug/settings/autoirb.rb b/lib/byebug/settings/autoirb.rb index 9df7aa47f..99cb2e913 100644 --- a/lib/byebug/settings/autoirb.rb +++ b/lib/byebug/settings/autoirb.rb @@ -18,8 +18,8 @@ def banner "Invoke IRB on every stop" end - def value=(v) - IrbCommand.always_run = v ? 1 : 0 + def value=(val) + IrbCommand.always_run = val ? 1 : 0 end def value diff --git a/lib/byebug/settings/autolist.rb b/lib/byebug/settings/autolist.rb index 85a612446..308230f9f 100644 --- a/lib/byebug/settings/autolist.rb +++ b/lib/byebug/settings/autolist.rb @@ -18,8 +18,8 @@ def banner "Invoke list command on every stop" end - def value=(v) - ListCommand.always_run = v ? 1 : 0 + def value=(val) + ListCommand.always_run = val ? 1 : 0 end def value diff --git a/lib/byebug/settings/autopry.rb b/lib/byebug/settings/autopry.rb index c28ea1e86..765198543 100644 --- a/lib/byebug/settings/autopry.rb +++ b/lib/byebug/settings/autopry.rb @@ -18,8 +18,8 @@ def banner "Invoke Pry on every stop" end - def value=(v) - PryCommand.always_run = v ? 1 : 0 + def value=(val) + PryCommand.always_run = val ? 1 : 0 end def value diff --git a/lib/byebug/settings/linetrace.rb b/lib/byebug/settings/linetrace.rb index 9c13889ee..ef0e9eb4c 100644 --- a/lib/byebug/settings/linetrace.rb +++ b/lib/byebug/settings/linetrace.rb @@ -11,8 +11,8 @@ def banner "Enable line execution tracing" end - def value=(v) - Byebug.tracing = v + def value=(val) + Byebug.tracing = val end def value diff --git a/lib/byebug/settings/post_mortem.rb b/lib/byebug/settings/post_mortem.rb index a9ca4b0eb..da5534927 100644 --- a/lib/byebug/settings/post_mortem.rb +++ b/lib/byebug/settings/post_mortem.rb @@ -16,8 +16,8 @@ def banner "Enable/disable post-mortem mode" end - def value=(v) - Byebug.post_mortem = v + def value=(val) + Byebug.post_mortem = val end def value