From: Joe Nahmias Date: Wed, 8 Oct 2025 23:52:49 -0400 Subject: remove usage of sprockets each_logical_path() --- Rakefile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 6f1f2b4..2e788bf 100644 --- a/Rakefile +++ b/Rakefile @@ -3,7 +3,7 @@ require "fileutils" require "rubygems" -require "mail_catcher/version" +require_relative "lib/mail_catcher/version" # XXX: Would prefer to use Rake::SprocketsTask but can't populate # non-digest assets, and we don't want sprockets at runtime so @@ -15,11 +15,19 @@ task "assets" do compiled_path = File.expand_path("../public/assets", __FILE__) FileUtils.mkdir_p(compiled_path) - require "mail_catcher/web/assets" + require_relative "lib/mail_catcher/web/assets" sprockets = MailCatcher::Web::Assets sprockets.css_compressor = :sass sprockets.js_compressor = :uglifier - sprockets.each_logical_path(/(\Amailcatcher\.(js|css)|\.(xsl|png)\Z)/) do |logical_path| + a = [ + 'logo.png', + 'logo_2x.png', + 'logo_large.png', + 'mailcatcher.css', + 'mailcatcher.js', + ] + a.each do |logical_path| + puts "looking for ", logical_path if asset = sprockets.find_asset(logical_path) target = File.join(compiled_path, logical_path) asset.write_to target