DEV: Fix methods removed in Ruby 3.2 (#15459)

* File.exists? is deprecated and removed in Ruby 3.2 in favor of
File.exist?
* Dir.exists? is deprecated and removed in Ruby 3.2 in favor of
Dir.exist?
This commit is contained in:
Peter Zhu
2022-01-05 12:45:08 -05:00
committed by GitHub
parent 692ba188bf
commit c5fd8c42db
75 changed files with 140 additions and 140 deletions

View File

@ -107,7 +107,7 @@ class Stylesheet::Manager
def self.last_file_updated
if Rails.env.production?
@last_file_updated ||= if File.exists?(MANIFEST_FULL_PATH)
@last_file_updated ||= if File.exist?(MANIFEST_FULL_PATH)
File.readlines(MANIFEST_FULL_PATH, 'r')[0]
else
mtime = max_file_mtime
@ -224,7 +224,7 @@ class Stylesheet::Manager
builder = Builder.new(target: target, theme: theme, manager: self)
next if builder.theme&.component && !scss_checker.has_scss(theme_id)
builder.compile unless File.exists?(builder.stylesheet_fullpath)
builder.compile unless File.exist?(builder.stylesheet_fullpath)
href = builder.stylesheet_path(current_hostname)
data[:new_href] = href
@ -242,7 +242,7 @@ class Stylesheet::Manager
end
else
builder = Builder.new(target: target, manager: self)
builder.compile unless File.exists?(builder.stylesheet_fullpath)
builder.compile unless File.exist?(builder.stylesheet_fullpath)
href = builder.stylesheet_path(current_hostname)
data = { target: target, new_href: href }
@ -285,7 +285,7 @@ class Stylesheet::Manager
manager: self
)
builder.compile unless File.exists?(builder.stylesheet_fullpath)
builder.compile unless File.exist?(builder.stylesheet_fullpath)
href = builder.stylesheet_path(current_hostname)
stylesheet[:new_href] = href