mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 16:41:08 +08:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user