Skip to content

Commit

Permalink
[rubygems/rubygems] 🚨 Rubocop Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
pboling authored and hsbt committed Oct 3, 2023
1 parent 0046c67 commit 16a97c7
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/bundler/cli/info.rb
Expand Up @@ -33,7 +33,7 @@ def spec_for_gem(gem_name)
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)
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/retry.rb
Expand Up @@ -56,7 +56,7 @@ def fail_attempt(e)
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?
Expand Down
2 changes: 1 addition & 1 deletion spec/bundler/commands/add_spec.rb
Expand Up @@ -63,7 +63,7 @@
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
Expand Down
6 changes: 3 additions & 3 deletions spec/bundler/commands/open_spec.rb
Expand Up @@ -104,7 +104,7 @@
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
Expand All @@ -113,7 +113,7 @@
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
Expand All @@ -122,7 +122,7 @@
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
Expand Down
4 changes: 2 additions & 2 deletions spec/bundler/install/gemfile/gemspec_spec.rb
Expand Up @@ -85,7 +85,7 @@
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
Expand All @@ -97,7 +97,7 @@
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
Expand Down
4 changes: 2 additions & 2 deletions spec/bundler/install/gemfile/git_spec.rb
Expand Up @@ -572,7 +572,7 @@

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/)
Expand All @@ -594,7 +594,7 @@

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/)
Expand Down
4 changes: 2 additions & 2 deletions spec/bundler/runtime/setup_spec.rb
Expand Up @@ -411,7 +411,7 @@ def clean_load_path(lp)

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
Expand Down Expand Up @@ -498,7 +498,7 @@ def clean_load_path(lp)

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
Expand Down

0 comments on commit 16a97c7

Please sign in to comment.