From ce1a258975a321dc1f79b4f1a021940c0e1aa082 Mon Sep 17 00:00:00 2001 From: ColinBruce Date: Tue, 31 May 2022 08:50:14 +0100 Subject: [PATCH 1/3] Update File.exists? reference This should remove the `gems/ruby-3.1.2/gems/devise_saml_authenticatable-1.9.0/lib/devise_saml_authenticatable/saml_config.rb:17: warning: File.exists? is deprecated; use File.exist? instead` warnings that are output in tests and server logs --- lib/devise_saml_authenticatable/saml_config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/devise_saml_authenticatable/saml_config.rb b/lib/devise_saml_authenticatable/saml_config.rb index 704331d..b09ea52 100644 --- a/lib/devise_saml_authenticatable/saml_config.rb +++ b/lib/devise_saml_authenticatable/saml_config.rb @@ -14,7 +14,7 @@ def file_based_config return @file_based_config if @file_based_config idp_config_path = "#{Rails.root}/config/idp.yml" - if File.exists?(idp_config_path) + if File.exist?(idp_config_path) @file_based_config ||= OneLogin::RubySaml::Settings.new(YAML.load(File.read(idp_config_path))[Rails.env]) end end From b1fb935fdae7779ae06d39f4390fc0041e54bd66 Mon Sep 17 00:00:00 2001 From: ColinBruce Date: Wed, 1 Jun 2022 07:13:32 +0100 Subject: [PATCH 2/3] Update saml_config test Ensure new File.exist call is tested --- spec/devise_saml_authenticatable/saml_config_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/devise_saml_authenticatable/saml_config_spec.rb b/spec/devise_saml_authenticatable/saml_config_spec.rb index 5965178..cf5b45e 100644 --- a/spec/devise_saml_authenticatable/saml_config_spec.rb +++ b/spec/devise_saml_authenticatable/saml_config_spec.rb @@ -10,7 +10,7 @@ context "when config/idp.yml does not exist" do before do allow(Rails).to receive(:root).and_return("/railsroot") - allow(File).to receive(:exists?).with("/railsroot/config/idp.yml").and_return(false) + allow(File).to receive(:exist?).with("/railsroot/config/idp.yml").and_return(false) end it "is the global devise SAML config" do From 42263505abe170af275442d67114ad3f9a775d77 Mon Sep 17 00:00:00 2001 From: ColinBruce Date: Tue, 28 Jun 2022 07:31:02 +0100 Subject: [PATCH 3/3] Update saml_config test Ensure File.exist? call is tested instead of File.exists? --- spec/devise_saml_authenticatable/saml_config_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/devise_saml_authenticatable/saml_config_spec.rb b/spec/devise_saml_authenticatable/saml_config_spec.rb index cf5b45e..4ab7e5c 100644 --- a/spec/devise_saml_authenticatable/saml_config_spec.rb +++ b/spec/devise_saml_authenticatable/saml_config_spec.rb @@ -156,7 +156,7 @@ def self.settings(idp_entity_id) before do allow(Rails).to receive(:env).and_return("environment") allow(Rails).to receive(:root).and_return("/railsroot") - allow(File).to receive(:exists?).with("/railsroot/config/idp.yml").and_return(true) + allow(File).to receive(:exist?).with("/railsroot/config/idp.yml").and_return(true) allow(File).to receive(:read).with("/railsroot/config/idp.yml").and_return(idp_yaml) end