From ca0b277f425b298fa29b7ef2c0d2780341786030 Mon Sep 17 00:00:00 2001 From: jordanbreen28 Date: Thu, 21 Sep 2023 12:53:31 +0100 Subject: [PATCH] (maint) - remove deprecated 'exists?' --- Rakefile | 10 +++++----- .../puppet-languageserver-sidecar_spec.rb | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Rakefile b/Rakefile index 813fe687..0e53cbf1 100644 --- a/Rakefile +++ b/Rakefile @@ -89,9 +89,9 @@ task :gem_revendor do vendor_dir = File.join(File.dirname(__FILE__),'vendor') gem_list.each do |vendor| gem_dir = File.join(vendor_dir,vendor[:directory]) - FileUtils.rm_rf(gem_dir) if Dir.exists?(gem_dir) + FileUtils.rm_rf(gem_dir) if Dir.exist?(gem_dir) end - Dir.mkdir(vendor_dir) unless Dir.exists?(vendor_dir) + Dir.mkdir(vendor_dir) unless Dir.exist?(vendor_dir) gem_list.each do |vendor| puts "Vendoring #{vendor[:directory]}..." @@ -143,11 +143,11 @@ task build: [:gem_revendor] do file_list = ['lib', 'vendor', 'puppet-languageserver', 'puppet-debugserver', 'puppet-languageserver-sidecar', 'LICENSE'] # Remove files in the list that do not exist. - file_list.reject! { |filepath| !File.exists?(filepath) } + file_list.reject! { |filepath| !File.exist?(filepath) } puts "Cleaning output directory..." - FileUtils.rm_rf Dir.glob("#{output_dir}/*") if Dir.exists?(output_dir) - Dir.mkdir(output_dir) unless Dir.exists?(output_dir) + FileUtils.rm_rf Dir.glob("#{output_dir}/*") if Dir.exist?(output_dir) + Dir.mkdir(output_dir) unless Dir.exist?(output_dir) puts "Fetch editor services version..." require_relative 'lib/puppet_editor_services/version' diff --git a/spec/languageserver-sidecar/integration/puppet-languageserver-sidecar/puppet-languageserver-sidecar_spec.rb b/spec/languageserver-sidecar/integration/puppet-languageserver-sidecar/puppet-languageserver-sidecar_spec.rb index c5f749ff..c30281dc 100644 --- a/spec/languageserver-sidecar/integration/puppet-languageserver-sidecar/puppet-languageserver-sidecar_spec.rb +++ b/spec/languageserver-sidecar/integration/puppet-languageserver-sidecar/puppet-languageserver-sidecar_spec.rb @@ -73,7 +73,7 @@ def should_not_contain_default_functions(deserial) def expect_empty_cache cache = PuppetLanguageServerSidecar::Cache::FileSystem.new - expect(Dir.exists?(cache.cache_dir)).to eq(true), "Expected the cache directory #{cache.cache_dir} to exist" + expect(Dir.exist?(cache.cache_dir)).to eq(true), "Expected the cache directory #{cache.cache_dir} to exist" expect(Dir.glob(File.join(cache.cache_dir,'*')).count).to eq(0), "Expected the cache directory #{cache.cache_dir} to be empty" end