diff --git a/lib/yettings.rb b/lib/yettings.rb index e6b8f3e..39f600e 100644 --- a/lib/yettings.rb +++ b/lib/yettings.rb @@ -14,7 +14,7 @@ def setup! def find_ymls main_file = "#{Rails.root.to_s}/config/yetting.yml" - yettings_main_file = File.exists?(main_file) ? [main_file] : [] + yettings_main_file = File.exist?(main_file) ? [main_file] : [] yettings_namespaced_files = Dir.glob("#{Rails.root.to_s}/config/yettings/**/*.yml").sort yettings_main_file.concat(yettings_namespaced_files) end diff --git a/test_app/config/boot.rb b/test_app/config/boot.rb index 4489e58..f2830ae 100644 --- a/test_app/config/boot.rb +++ b/test_app/config/boot.rb @@ -3,4 +3,4 @@ # Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) +require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) diff --git a/test_app/spec/yettings_spec.rb b/test_app/spec/yettings_spec.rb index 92f5081..d471ddc 100644 --- a/test_app/spec/yettings_spec.rb +++ b/test_app/spec/yettings_spec.rb @@ -35,11 +35,11 @@ end it "should find 3 yettings dir files if there is no main file" do - FileUtils.mv("#{YETTING_FILE}","#{YETTING_FILE}_tmp") if File.exists?("#{YETTING_FILE}") + FileUtils.mv("#{YETTING_FILE}","#{YETTING_FILE}_tmp") if File.exist?("#{YETTING_FILE}") Yettings.find_ymls.should eq ["#{Rails.root}/config/yettings/blank.yml", "#{Rails.root}/config/yettings/hendrix.yml", "#{Rails.root}/config/yettings/jimi.yml"] - FileUtils.mv("#{YETTING_FILE}_tmp","#{YETTING_FILE}") if File.exists?("#{YETTING_FILE}_tmp") + FileUtils.mv("#{YETTING_FILE}_tmp","#{YETTING_FILE}") if File.exist?("#{YETTING_FILE}_tmp") end it "should load the yml and return hash" do