Fixing Naming/PredicateName issues

This commit drops the `has_` prefix from several `?` style methods
because that's against the ruby style guide and redundant for a method
ending in `?`.
This commit is contained in:
Brandon High 2020-03-05 17:03:48 -08:00
parent 5193ff6a84
commit 61e9f56ed2
No known key found for this signature in database
GPG key ID: 270079C784FCAFDE
2 changed files with 4 additions and 4 deletions

View file

@ -181,13 +181,13 @@ module Vmpooler
end end
end end
return if has_mismatched_hostname?(vm, pool_name, provider) return if mismatched_hostname?(vm, pool_name, provider)
vm_still_ready?(pool_name, vm, provider) vm_still_ready?(pool_name, vm, provider)
end end
end end
def has_mismatched_hostname?(vm, pool_name, provider) def mismatched_hostname?(vm, pool_name, provider)
pool_config = $config[:pools][$config[:pool_index][pool_name]] pool_config = $config[:pools][$config[:pool_index][pool_name]]
check_hostname = pool_config['check_hostname_for_mismatch'] check_hostname = pool_config['check_hostname_for_mismatch']
check_hostname = $config[:config]['check_ready_vm_hostname_for_mismatch'] if check_hostname.nil? check_hostname = $config[:config]['check_ready_vm_hostname_for_mismatch'] if check_hostname.nil?

View file

@ -87,7 +87,7 @@ module Vmpooler
# Returns an Array of Pathname objects. # Returns an Array of Pathname objects.
def gem_directories def gem_directories
dirs = [] dirs = []
if has_rubygems? if rubygems?
dirs = gemspecs.map do |spec| dirs = gemspecs.map do |spec|
lib_path = File.expand_path(File.join(spec.full_gem_path, provider_path)) lib_path = File.expand_path(File.join(spec.full_gem_path, provider_path))
lib_path if File.exist? lib_path lib_path if File.exist? lib_path
@ -99,7 +99,7 @@ module Vmpooler
# Internal: Check if RubyGems is loaded and available. # Internal: Check if RubyGems is loaded and available.
# #
# Returns true if RubyGems is available, false if not. # Returns true if RubyGems is available, false if not.
def has_rubygems? def rubygems?
defined? ::Gem defined? ::Gem
end end