Skip to content

Commit

Permalink
Merge pull request #1277 from MikeMcQuaid/fix_nil_usage
Browse files Browse the repository at this point in the history
Fix some usage of `!foo.nil?`
  • Loading branch information
MikeMcQuaid authored Jan 9, 2024
2 parents 48adf41 + 63dc8a9 commit aeb6ac0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit aeb6ac0

Please sign in to comment.