From 741db7e0d1a21b5a9db851bf8c6f7f8eae92ff71 Mon Sep 17 00:00:00 2001 From: Mark Friedgan Date: Wed, 18 Mar 2020 13:08:54 -0500 Subject: [PATCH] Change exists to exist as exists is deprecated warning: File.exists? is a deprecated name, use File.exist? instead --- lib/active_config.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/active_config.rb b/lib/active_config.rb index bf1c539..fb95bdb 100644 --- a/lib/active_config.rb +++ b/lib/active_config.rb @@ -95,7 +95,7 @@ def initialize opts={} self._flush_cache dups_h=Hash.new{|h,e|h[e]=[]} self._config_path.map{|e| - if File.exists?(e) and File.directory?(e) + if File.exist?(e) and File.directory?(e) Dir[e + '/*'].map{|f| if File.file?(f) dups_h[File.basename(f)] << f @@ -174,7 +174,7 @@ def _load_config_files(name, force=false) filename=f val=nil mod_time=nil - next unless File.exists?(filename) + next unless File.exist?(filename) next(@file_cache[filename]) unless (mod_time=File.stat(filename).mtime) != @file_times[filename] begin File.open( filename ) { | yf | @@ -228,7 +228,7 @@ def get_config_file(name) # Returns a list of all relavant config files as specified # by the suffixes object. def _config_files(name) - return [name] if File.exists?(name) and not File.directory?(name) + return [name] if File.exist?(name) and not File.directory?(name) _suffixes.for(name).inject([]) do | files,name_x | _config_path.reverse.inject(files) do |files, dir | files << File.join(dir, name_x.to_s + '.yml')