Skip to content

Commit

Permalink
(maint) - remove deprecated 'exists?'
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbreen28 committed Sep 21, 2023
1 parent f69f0a7 commit e7fe170
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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]}..."
Expand Down Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e7fe170

Please sign in to comment.