From 4d8f5992967e272c1e4546c728a18302bbcb2ee3 Mon Sep 17 00:00:00 2001 From: Martin Mischke Date: Fri, 25 Aug 2023 18:11:55 +0200 Subject: [PATCH] changend deprecated File.exists method calls to File.exist see also issue https://github.com/Gazler/githug/issues/337 and https://stackoverflow.com/questions/14351272/undefined-method-exists-for-fileclass-nomethoderror/75353113#75353113 --- lib/githug/cli.rb | 2 +- lib/githug/level.rb | 2 +- lib/githug/profile.rb | 2 +- lib/githug/repository.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/githug/cli.rb b/lib/githug/cli.rb index 36e165a0..9e431b09 100644 --- a/lib/githug/cli.rb +++ b/lib/githug/cli.rb @@ -97,7 +97,7 @@ def make_directory! end def check_githug_directory! - if File.exists?("./git_hug") + if File.exist?("./git_hug") UI.puts "Please change into the git_hug directory" exit end diff --git a/lib/githug/level.rb b/lib/githug/level.rb index 051d1738..d0723ec5 100644 --- a/lib/githug/level.rb +++ b/lib/githug/level.rb @@ -35,7 +35,7 @@ def setup(path) level_path = path.chomp(File.extname(path)) level = self.new - return false unless File.exists?(path) + return false unless File.exist?(path) level.instance_eval(File.read(path)) level.level_name = File.basename(path, File.extname(path)) diff --git a/lib/githug/profile.rb b/lib/githug/profile.rb index 021032e2..063a9984 100644 --- a/lib/githug/profile.rb +++ b/lib/githug/profile.rb @@ -13,7 +13,7 @@ def load private def settings - return defaults unless File.exists?(PROFILE_FILE) + return defaults unless File.exist?(PROFILE_FILE) defaults.merge(YAML::load(File.open(PROFILE_FILE))) end diff --git a/lib/githug/repository.rb b/lib/githug/repository.rb index 87e1cbae..ee0ef19d 100644 --- a/lib/githug/repository.rb +++ b/lib/githug/repository.rb @@ -20,7 +20,7 @@ def reset end def create_gitignore - Dir.chdir("git_hug") if File.exists?("./git_hug") + Dir.chdir("git_hug") if File.exist?("./git_hug") File.open(".gitignore", "w") do |file| file.puts(".profile.yml") file.puts(".gitignore")