From 16a97c7bbb5ef04da58e7136830b57707b5fc2ad Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Thu, 14 Sep 2023 11:58:21 +0700 Subject: =?UTF-8?q?[rubygems/rubygems]=20=F0=9F=9A=A8=20Rubocop=20Linting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/rubygems/rubygems/commit/2851e051c3 --- lib/bundler/cli/info.rb | 2 +- lib/bundler/retry.rb | 2 +- spec/bundler/commands/add_spec.rb | 2 +- spec/bundler/commands/open_spec.rb | 6 +++--- spec/bundler/install/gemfile/gemspec_spec.rb | 4 ++-- spec/bundler/install/gemfile/git_spec.rb | 4 ++-- spec/bundler/runtime/setup_spec.rb | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/bundler/cli/info.rb b/lib/bundler/cli/info.rb index 36c7a58f12..3facde1947 100644 --- a/lib/bundler/cli/info.rb +++ b/lib/bundler/cli/info.rb @@ -33,7 +33,7 @@ module Bundler def default_gem_spec(gem_name) return unless Gem::Specification.respond_to?(:find_all_by_name) gem_spec = Gem::Specification.find_all_by_name(gem_name).last - return gem_spec if gem_spec&.default_gem? + gem_spec if gem_spec&.default_gem? end def spec_not_found(gem_name) diff --git a/lib/bundler/retry.rb b/lib/bundler/retry.rb index 2415ade200..b95c42c361 100644 --- a/lib/bundler/retry.rb +++ b/lib/bundler/retry.rb @@ -56,7 +56,7 @@ module Bundler def keep_trying? return true if current_run.zero? return false if last_attempt? - return true if @failed + true if @failed end def last_attempt? diff --git a/spec/bundler/commands/add_spec.rb b/spec/bundler/commands/add_spec.rb index 5a5b534e8d..1eaff913c3 100644 --- a/spec/bundler/commands/add_spec.rb +++ b/spec/bundler/commands/add_spec.rb @@ -63,7 +63,7 @@ RSpec.describe "bundle add" do it "adds multiple version constraints when specified" do requirements = ["< 3.0", "> 1.0"] bundle "add 'foo' --version='#{requirements.join(", ")}'" - expect(bundled_app_gemfile.read).to match(/gem "foo", #{Gem::Requirement.new(requirements).as_list.map(&:dump).join(', ')}/) + expect(bundled_app_gemfile.read).to match(/gem "foo", #{Gem::Requirement.new(requirements).as_list.map(&:dump).join(", ")}/) expect(the_bundle).to include_gems "foo 2.0" end end diff --git a/spec/bundler/commands/open_spec.rb b/spec/bundler/commands/open_spec.rb index e30ebfea5b..6ec64dd842 100644 --- a/spec/bundler/commands/open_spec.rb +++ b/spec/bundler/commands/open_spec.rb @@ -104,7 +104,7 @@ RSpec.describe "bundle open" do input.puts "2" end - expect(out).to match(%r{bundler_editor #{default_bundle_path('gems', 'activerecord-2.3.2')}/CHANGELOG\.md\z}) + expect(out).to match(%r{bundler_editor #{default_bundle_path("gems", "activerecord-2.3.2")}/CHANGELOG\.md\z}) end it "opens deep subpath of the selected matching gem", :readline do @@ -113,7 +113,7 @@ RSpec.describe "bundle open" do input.puts "2" end - expect(out).to match(%r{bundler_editor #{default_bundle_path('gems', 'activerecord-2.3.2')}/lib/activerecord/version\.rb\z}) + expect(out).to match(%r{bundler_editor #{default_bundle_path("gems", "activerecord-2.3.2")}/lib/activerecord/version\.rb\z}) end it "select the gem from many match gems", :readline do @@ -122,7 +122,7 @@ RSpec.describe "bundle open" do input.puts "2" end - expect(out).to match(/bundler_editor #{default_bundle_path('gems', 'activerecord-2.3.2')}\z/) + expect(out).to match(/bundler_editor #{default_bundle_path("gems", "activerecord-2.3.2")}\z/) end it "allows selecting exit from many match gems", :readline do diff --git a/spec/bundler/install/gemfile/gemspec_spec.rb b/spec/bundler/install/gemfile/gemspec_spec.rb index 346120446d..bed1d7fe04 100644 --- a/spec/bundler/install/gemfile/gemspec_spec.rb +++ b/spec/bundler/install/gemfile/gemspec_spec.rb @@ -85,7 +85,7 @@ RSpec.describe "bundle install from an existing gemspec" do source "#{file_uri_for(gem_repo2)}" gemspec :path => '#{tmp.join("foo")}' G - expect(err).to match(/There are no gemspecs at #{tmp.join('foo')}/) + expect(err).to match(/There are no gemspecs at #{tmp.join("foo")}/) end it "should raise if there are too many gemspecs available" do @@ -97,7 +97,7 @@ RSpec.describe "bundle install from an existing gemspec" do source "#{file_uri_for(gem_repo2)}" gemspec :path => '#{tmp.join("foo")}' G - expect(err).to match(/There are multiple gemspecs at #{tmp.join('foo')}/) + expect(err).to match(/There are multiple gemspecs at #{tmp.join("foo")}/) end it "should pick a specific gemspec" do diff --git a/spec/bundler/install/gemfile/git_spec.rb b/spec/bundler/install/gemfile/git_spec.rb index 910f96f4ab..b07afaaffb 100644 --- a/spec/bundler/install/gemfile/git_spec.rb +++ b/spec/bundler/install/gemfile/git_spec.rb @@ -572,7 +572,7 @@ RSpec.describe "bundle install with git sources" do bundle %(config set local.rack #{lib_path("local-rack")}) bundle :install, :raise_on_error => false - expect(err).to match(/Cannot use local override for rack-0.8 because #{Regexp.escape(lib_path('local-rack').to_s)} does not exist/) + expect(err).to match(/Cannot use local override for rack-0.8 because #{Regexp.escape(lib_path("local-rack").to_s)} does not exist/) solution = "config unset local.rack" expect(err).to match(/Run `bundle #{solution}` to remove the local override/) @@ -594,7 +594,7 @@ RSpec.describe "bundle install with git sources" do bundle %(config set local.rack #{lib_path("local-rack")}) bundle :install, :raise_on_error => false - expect(err).to match(/Cannot use local override for rack-0.8 at #{Regexp.escape(lib_path('local-rack').to_s)} because :branch is not specified in Gemfile/) + expect(err).to match(/Cannot use local override for rack-0.8 at #{Regexp.escape(lib_path("local-rack").to_s)} because :branch is not specified in Gemfile/) solution = "config unset local.rack" expect(err).to match(/Specify a branch or run `bundle #{solution}` to remove the local override/) diff --git a/spec/bundler/runtime/setup_spec.rb b/spec/bundler/runtime/setup_spec.rb index 5be9c49fef..38ca9e68a3 100644 --- a/spec/bundler/runtime/setup_spec.rb +++ b/spec/bundler/runtime/setup_spec.rb @@ -411,7 +411,7 @@ RSpec.describe "Bundler.setup" do it "provides a useful exception when the git repo is not checked out yet" do run "1", :raise_on_error => false - expect(err).to match(/the git source #{lib_path('rack-1.0.0')} is not yet checked out. Please run `bundle install`/i) + expect(err).to match(/the git source #{lib_path("rack-1.0.0")} is not yet checked out. Please run `bundle install`/i) end it "does not hit the git binary if the lockfile is available and up to date" do @@ -498,7 +498,7 @@ RSpec.describe "Bundler.setup" do FileUtils.rm_rf(lib_path("local-rack")) run "require 'rack'", :raise_on_error => false - expect(err).to match(/Cannot use local override for rack-0.8 because #{Regexp.escape(lib_path('local-rack').to_s)} does not exist/) + expect(err).to match(/Cannot use local override for rack-0.8 because #{Regexp.escape(lib_path("local-rack").to_s)} does not exist/) end it "explodes if branch is not given on runtime" do -- cgit v1.2.3