-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add info for Rails 5 / Sprockets 3 #48
Comments
This fork has some Rails 5 fixes. No idea about complete compatibility but it's working how we use it |
The changes in that fork are made by me, they are not to fix Rails 5 problems, they are just for some server setup problems. |
module NonStupidDigestAssets
mattr_accessor :whitelist
@@whitelist = []
class << self
def files(files)
return files if whitelist.empty?
whitelisted_files(files)
end
private
def whitelisted_files(files)
files.select do |file, info|
whitelist.any? do |item|
case item
when Regexp
info['logical_path'] =~ item
else
info['logical_path'] == item
end
end
end
end
end
end
module NonDigest
def compile *args
super *args
NonStupidDigestAssets.files(files).each do |(digest_path, info)|
full_digest_path = File.join dir, digest_path
full_digest_gz_path = "#{full_digest_path}.gz"
full_non_digest_path = File.join dir, info['logical_path']
full_non_digest_gz_path = "#{full_non_digest_path}.gz"
if File.exists? full_digest_path
# logger.info "Writing #{full_non_digest_path}"
FileUtils.rm full_non_digest_path if File.exists? full_non_digest_path
FileUtils.cp full_digest_path, full_non_digest_path
else
logger.warn "Could not find: #{full_digest_path}"
end
if File.exists? full_digest_gz_path
# logger.info "Writing #{full_non_digest_gz_path}"
FileUtils.rm full_non_digest_gz_path if File.exists? full_non_digest_gz_path
FileUtils.cp full_digest_gz_path, full_non_digest_gz_path
else
logger.warn "Could not find: #{full_digest_gz_path}"
end
end
end
end
module Sprockets
class Manifest
prepend NonDigest
end
end |
Basic functionality seems fine to me in Rails 6, FWIW. What issues have other folks been seeing? |
OK, here's one: it looks like JS in |
Hi, is this gem still required for Rails 5? I didn't find any info if it is possible to compile both assets versions in Rails 5 without this gem, so I assume it is still required. It would be nice to add some info to the README.md.
The text was updated successfully, but these errors were encountered: