Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some usage of !foo.nil? #1277

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/bundle/brew_dumper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def formulae
end

def formulae_by_full_name(name = nil)
return @formulae_by_full_name[name] if !name.nil? && @formulae_by_full_name&.key?(name)
return @formulae_by_full_name[name] if name.present? && @formulae_by_full_name&.key?(name)

require "formula"
require "formulary"
Expand Down
6 changes: 3 additions & 3 deletions lib/bundle/brew_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ def install_change_state!(no_upgrade:, verbose:, force:)
end

def start_service?
!@start_service.nil?
@start_service.present?
end

def start_service_needed?
start_service? && !BrewServices.started?(@full_name)
end

def restart_service?
!@restart_service.nil?
@restart_service.present?
end

def restart_service_needed?
Expand All @@ -82,7 +82,7 @@ def restart_service_needed?
end

def changed?
!@changed.nil?
@changed.present?
end

def service_change_state!(verbose:)
Expand Down