From 61e9f56ed26f08fd94c4706de0e2e1cd329aa0c5 Mon Sep 17 00:00:00 2001 From: Brandon High Date: Thu, 5 Mar 2020 17:03:48 -0800 Subject: [PATCH] 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 `?`. --- lib/vmpooler/pool_manager.rb | 4 ++-- lib/vmpooler/providers.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/vmpooler/pool_manager.rb b/lib/vmpooler/pool_manager.rb index 4ba39ab..fe6a8fa 100644 --- a/lib/vmpooler/pool_manager.rb +++ b/lib/vmpooler/pool_manager.rb @@ -181,13 +181,13 @@ module Vmpooler 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) 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]] check_hostname = pool_config['check_hostname_for_mismatch'] check_hostname = $config[:config]['check_ready_vm_hostname_for_mismatch'] if check_hostname.nil? diff --git a/lib/vmpooler/providers.rb b/lib/vmpooler/providers.rb index ade0272..94673f4 100644 --- a/lib/vmpooler/providers.rb +++ b/lib/vmpooler/providers.rb @@ -87,7 +87,7 @@ module Vmpooler # Returns an Array of Pathname objects. def gem_directories dirs = [] - if has_rubygems? + if rubygems? dirs = gemspecs.map do |spec| lib_path = File.expand_path(File.join(spec.full_gem_path, provider_path)) lib_path if File.exist? lib_path @@ -99,7 +99,7 @@ module Vmpooler # Internal: Check if RubyGems is loaded and available. # # Returns true if RubyGems is available, false if not. - def has_rubygems? + def rubygems? defined? ::Gem end