rubocop: Update deprecated class methods

This commit is contained in:
Will Binns 2019-01-12 09:11:33 -06:00 committed by Will Binns
parent 7d604c17aa
commit 0d453a8e81
3 changed files with 4 additions and 11 deletions

View File

@ -6,13 +6,6 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 5
# Cop supports --auto-correct.
Lint/DeprecatedClassMethods:
Exclude:
- '_plugins/contributors.rb'
- '_plugins/events.rb'
# Offense count: 1
Lint/LiteralAsCondition:
Exclude:

View File

@ -105,7 +105,7 @@ module Jekyll
end
## Create cache directory if it doesn't exist
if !File.exists?('_cache')
if !File.exist?('_cache')
Dir.mkdir('_cache')
end
@ -117,7 +117,7 @@ module Jekyll
# file has to be updated, they both get updated.
corecontributors_cache = '_cache/corecontributors.marshall'
sitecontributors_cache = '_cache/sitecontributors.marshall'
if File.exists?(corecontributors_cache) && File.exists?(sitecontributors_cache)
if File.exist?(corecontributors_cache) && File.exist?(sitecontributors_cache)
corecontributors_cache_age = (Time.now - File.stat(corecontributors_cache).mtime).to_i
sitecontributors_cache_age = (Time.now - File.stat(sitecontributors_cache).mtime).to_i
else

View File

@ -66,7 +66,7 @@ module Jekyll
end
## Create cache directory if it doesn't exist
if !File.exists?('_cache')
if !File.exist?('_cache')
Dir.mkdir('_cache')
end
@ -78,7 +78,7 @@ module Jekyll
events_file = '_events.yml'
events_file_unix_time = File.stat(events_file).mtime.to_i
if File.exists?(conferences_cache)
if File.exist?(conferences_cache)
conferences_cache_unix_time = File.stat(conferences_cache).mtime.to_i
else
conferences_cache_unix_time = 0