From 3dd9062d866266e1940bbf84b1ca5a63482cdadb Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Mon, 9 Mar 2015 12:37:48 +0000 Subject: File.exists? is deprecated. We prefer "File.exist?". Flagged by rubocop. --- lib/custodian/parser.rb | 2 +- lib/custodian/protocoltest/ping.rb | 2 +- lib/custodian/protocoltest/smtprelay.rb | 2 +- lib/custodian/settings.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/custodian/parser.rb b/lib/custodian/parser.rb index 733d375..9d1095a 100644 --- a/lib/custodian/parser.rb +++ b/lib/custodian/parser.rb @@ -413,7 +413,7 @@ module Custodian def parse_file( filename ) raise ArgumentError, "Missing configuration file!" if ( filename.nil? ) - raise ArgumentError, "File not found: #{@file}" unless ( File.exists?( filename) ) + raise ArgumentError, "File not found: #{@file}" unless ( File.exist?( filename) ) # # Read the configuration file. diff --git a/lib/custodian/protocoltest/ping.rb b/lib/custodian/protocoltest/ping.rb index 37722c2..937a5db 100644 --- a/lib/custodian/protocoltest/ping.rb +++ b/lib/custodian/protocoltest/ping.rb @@ -71,7 +71,7 @@ module Custodian # binary = nil binary = "./bin/multi-ping" - binary = "/usr/bin/multi-ping" if ( File.exists?( "/usr/bin/multi-ping" ) ) + binary = "/usr/bin/multi-ping" if ( File.exist?( "/usr/bin/multi-ping" ) ) if ( binary.nil? ) @error = "Failed to find '/usr/bin/multi-ping'" diff --git a/lib/custodian/protocoltest/smtprelay.rb b/lib/custodian/protocoltest/smtprelay.rb index 7cf22cc..85f7896 100644 --- a/lib/custodian/protocoltest/smtprelay.rb +++ b/lib/custodian/protocoltest/smtprelay.rb @@ -63,7 +63,7 @@ module Custodian def get_hostname hostname = "localhost.localdomain" - if ( File.exists?( "/etc/hostname" ) ) + if ( File.exist?( "/etc/hostname" ) ) File.readlines("/etc/hostname" ).each do |line| hostname = line if ( !line.nil? ) hostname.chomp! diff --git a/lib/custodian/settings.rb b/lib/custodian/settings.rb index b2bdb04..206e6a9 100644 --- a/lib/custodian/settings.rb +++ b/lib/custodian/settings.rb @@ -43,7 +43,7 @@ module Custodian # # The global configuration file. # - return unless( File.exists?( file ) ) + return unless( File.exist?( file ) ) # # Load and "parse" the key=value content. -- cgit v1.2.1