Skip to content

Commit

Permalink
Merge pull request #66 from alexgenco/file-exist
Browse files Browse the repository at this point in the history
Remove deprecated usage of .exists? style methods
  • Loading branch information
kana authored Jan 11, 2022
2 parents 48474f5 + 7814b83 commit dfa2724
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/vim-flavor/flavor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Flavor

# Return true if this flavor's repository is already cloned.
def cached?
Dir.exists?(cached_repo_path)
Dir.exist?(cached_repo_path)
end

def cached_version?(version)
Expand Down
8 changes: 4 additions & 4 deletions lib/vim-flavor/flavorfile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def default_group

def self.load_or_new(flavorfile_path)
ff = new()
ff.load(flavorfile_path) if FileTest.exists?(flavorfile_path)
ff.load(flavorfile_path) if FileTest.exist?(flavorfile_path)
ff
end

Expand All @@ -33,12 +33,12 @@ def self.path_from(dir_path, warn)
new_path = Pathname.new(flavorfile_path).relative_path_from(Pathname.getwd())
old_path = new_path.dirname() / 'VimFlavor'

path = if FileTest.exists?(new_path)
if warn and FileTest.exists?(old_path)
path = if FileTest.exist?(new_path)
if warn and FileTest.exist?(old_path)
Console::warn "Delete #{old_path}. #{new_path} is being read instead."
end
new_path
elsif FileTest.exists?(old_path)
elsif FileTest.exist?(old_path)
if warn
Console::warn "Rename #{old_path} to #{new_path}. #{old_path} wll be ignored in future version."
end
Expand Down
4 changes: 2 additions & 2 deletions lib/vim-flavor/lockfile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Flavor
class LockFile
def self.load_or_new(lockfile_path)
l = new(lockfile_path)
l.load() if File.exists?(lockfile_path)
l.load() if File.exist?(lockfile_path)
l
end

Expand All @@ -14,7 +14,7 @@ def self.path_from(dir_path, error)
new_path = Pathname.new(lockfile_path).relative_path_from(Pathname.getwd())
old_path = new_path.dirname() / 'VimFlavor.lock'

if error and FileTest.exists?(old_path)
if error and FileTest.exist?(old_path)
Console::error "#{old_path} is no longer used. Rename it to #{new_path}."
end

Expand Down

0 comments on commit dfa2724

Please sign in to comment.