From b07ea85b70a3fc45f14463a9c972d218f2d1ffe9 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sun, 2 Mar 2025 11:32:55 -0800 Subject: [PATCH] Update ruby scripts to use 'File.exist?' Signed-off-by: Danila Fedorin --- agda.rb | 2 +- analyze.rb | 2 +- build-agda-html.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/agda.rb b/agda.rb index 85c06bd..48a83df 100644 --- a/agda.rb +++ b/agda.rb @@ -23,7 +23,7 @@ class AgdaContext return @file_infos[file] if @file_infos.include? file @file_infos[file] = line_infos = {} - unless File.exists?(file) + unless File.exist?(file) return line_infos end diff --git a/analyze.rb b/analyze.rb index 86a8df0..9e39779 100644 --- a/analyze.rb +++ b/analyze.rb @@ -43,7 +43,7 @@ files.each do |file| tags = [] group = 1 draft = false - next unless File.exists?(file) + next unless File.exist?(file) value = File.size(file) url = file.gsub(/^content/, "https://danilafe.com").delete_suffix("/index.md").delete_suffix(".md") File.readlines(file).each do |l| diff --git a/build-agda-html.rb b/build-agda-html.rb index b218bde..06f781d 100644 --- a/build-agda-html.rb +++ b/build-agda-html.rb @@ -26,7 +26,7 @@ files = ARGV code_paths = Dir.entries(root_path).select do |f| File.directory?(File.join(root_path, f)) and f != '.' and f != '..' end.to_set -code_paths += JSON.parse(File.read(data_file)).keys if File.exists? data_file +code_paths += JSON.parse(File.read(data_file)).keys if File.exist? data_file # Extending code_paths from submodules.json means that nested Agda modules # have their root dir correctly set.