FIX: detect css changes in plugins that use register_css

This commit is contained in:
Neil Lalonde 2014-06-03 16:46:32 -04:00
parent 69abe470c5
commit 15e91f2da9
1 changed files with 5 additions and 2 deletions

View File

@ -42,8 +42,11 @@ class DiscourseStylesheets
end
def self.max_file_mtime
[ Dir.glob("#{Rails.root}/app/assets/stylesheets/**/*.*css").map {|x| File.mtime(x) }.max,
Dir.glob("#{Rails.root}/plugins/**/assets/stylesheets/**/*.*css").map {|x| File.mtime(x) }.max ].compact.max.to_i
[ "#{Rails.root}/app/assets/stylesheets/**/*.*css",
"#{Rails.root}/plugins/**/*.*css",
"#{Rails.root}/plugins/**/plugin.rb" ].map do |pattern|
Dir.glob(pattern).map { |x| File.mtime(x) }.max
end.compact.max.to_i
end