diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2016-08-10 00:23:25 +0300 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2016-08-11 13:54:45 +0300 |
commit | 96ebc8c4f7223091d97c38c442d68c8058d26261 (patch) | |
tree | 4340c6ad010acbcbd47e908176cb6653a0c8f935 /lib/backup/repository.rb | |
parent | 3a46eac1ef903c027c244d31369329f45c636914 (diff) | |
download | gitlab-ce-96ebc8c4f7223091d97c38c442d68c8058d26261.tar.gz |
Use `File::exist?` instead of `File::exists?`
Since version ruby-2.2.0, method `File::exists?` is deprecated.
Diffstat (limited to 'lib/backup/repository.rb')
-rw-r--r-- | lib/backup/repository.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/backup/repository.rb b/lib/backup/repository.rb index 1f5917b8127..f117fc3d37d 100644 --- a/lib/backup/repository.rb +++ b/lib/backup/repository.rb @@ -28,7 +28,7 @@ module Backup wiki = ProjectWiki.new(project) - if File.exists?(path_to_repo(wiki)) + if File.exist?(path_to_repo(wiki)) $progress.print " * #{wiki.path_with_namespace} ... " if wiki.repository.empty? $progress.puts " [SKIPPED]".color(:cyan) @@ -49,7 +49,7 @@ module Backup def restore Gitlab.config.repositories.storages.each do |name, path| - next unless File.exists?(path) + next unless File.exist?(path) # Move repos dir to 'repositories.old' dir bk_repos_path = File.join(path, '..', 'repositories.old.' + Time.now.to_i.to_s) @@ -63,7 +63,7 @@ module Backup project.ensure_dir_exist - if File.exists?(path_to_bundle(project)) + if File.exist?(path_to_bundle(project)) FileUtils.mkdir_p(path_to_repo(project)) cmd = %W(tar -xf #{path_to_bundle(project)} -C #{path_to_repo(project)}) else @@ -80,7 +80,7 @@ module Backup wiki = ProjectWiki.new(project) - if File.exists?(path_to_bundle(wiki)) + if File.exist?(path_to_bundle(wiki)) $progress.print " * #{wiki.path_with_namespace} ... " # If a wiki bundle exists, first remove the empty repo |