Comments (5)
This fork has some Rails 5 fixes. No idea about complete compatibility but it's working how we use it
from non-stupid-digest-assets.
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.
from non-stupid-digest-assets.
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
from non-stupid-digest-assets.
Basic functionality seems fine to me in Rails 6, FWIW. What issues have other folks been seeing?
from non-stupid-digest-assets.
OK, here's one: it looks like JS in public/packs/js
doesn't get copied to the non-stupid path. Not a big deal for me as I'm only using this gem to statically link CSS and images in my 404.html
and 500.html
, but might be an issue for some.
from non-stupid-digest-assets.
Related Issues (20)
- Regular Expression in whitelist? HOT 1
- Pin Rails/Sprockets version? HOT 1
- Compatibility issue with Rails 4.2.0.beta1 HOT 10
- Docs: rake task not quite, more info/links? HOT 1
- Incompatibility with multi-core compilation HOT 3
- Missing non digested assets inside manifest file. HOT 4
- No usage section in readme
- Thank you! HOT 1
- Non manifested assets are never compressed HOT 1
- Doesn't work on Heroku HOT 1
- Inaccurate documentation from #22
- Any plan to support sprockets 3? HOT 1
- Reverting a change is not reflected on non-digest version HOT 1
- Non-digest only mode (move instead of copy) HOT 4
- Alternative: controller proxy
- On subsequent runs the assets are 0 file size HOT 1
- Works great, thank you! HOT 1
- Is the repo still maintained? HOT 2
- `CompileWithNonDigest` uses deprecated `File.exists?`, removed in Ruby 3.2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from non-stupid-digest-assets.