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
Fix regex to support multi-length rails digests. #15508
Conversation
assets.each do |file| | ||
next if File.directory?(file) || file !~ regex | ||
non_digested = file.sub(regex, '') | ||
non_digested = file.gsub(regex, '\1\2') | ||
puts "Copying file #{file} to #{non_digested}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this going to result in lots of spew?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with a comment of Brendan's on an earlier PR that it might be useful to have a comment with an example of a before file and an after file. Also maybe an explanation of why we need to copy digested assets to non-digested file paths?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as much spew as assets:precompile already generates (one log line per file). Is there a better way to do this? like a debug logging function or something? I don't know how to ruby.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me neither really. This is probably fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, added a nice big comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after addressing Brent's comments
Thanks for explaining Paul, I had not understood why we were avoiding hashes! |
To test:
from
apps
directory:from
dashboard
directory:$ rm -rf public/assets/js/ $ rake assets:precompile $ ls public/assets/js/*.png public/assets/js/blank_sharing_drawingwpae53b62a1609cbbb425574e45b37b837-0c22492410826036caf742a1eb6e79c906f739b0acf9667a6325f7369ec92ce2.png public/assets/js/blank_sharing_drawingwpae53b62a1609cbbb425574e45b37b837.png public/assets/js/elementarywp4317a6014f2aa8d965d83d3f0bc94d21-de4b27829100b513c64372f9cd93f3d212270fbc93a653d23ce6d40ceba8ab28.png public/assets/js/elementarywp4317a6014f2aa8d965d83d3f0bc94d21.png public/assets/js/findguestspeakerwp287fdc6e6a9700d926cd118ae698af5e-32930437c3854394f5b5791452358dd04ed4105c43c871a360d0e157808f4dd4.png public/assets/js/findguestspeakerwp287fdc6e6a9700d926cd118ae698af5e.png public/assets/js/highschoolwp991b0c5aebd55b17a68ab3a3ee3bfeab-9ee06682b087f8411a2ac4b2316ef9c5d3a70a984da49759e1cb3adcbc928e95.png public/assets/js/highschoolwp991b0c5aebd55b17a68ab3a3ee3bfeab.png public/assets/js/hourofcode2wp6304252f708af29544a57d0e38622f2e-fd419c5fbccddd2339da085c6116b238ff0b4e0ced51cf830489c68bd632e083.png public/assets/js/hourofcode2wp6304252f708af29544a57d0e38622f2e.png public/assets/js/hourofcodewp784b8b85d9e6fab9bd7de091157ca8cd-9312a07d10214f5d03f044e987eac6dcae3bf37722cd28eebdb7f59221952c78.png public/assets/js/hourofcodewp784b8b85d9e6fab9bd7de091157ca8cd.png public/assets/js/middleschoolwp5ad518ecb95f9a86eb5b5f5a7a165bd3-7835590410635c04908fa3457628a4dee5cd684de124c508e030d0145d2d0334.png public/assets/js/middleschoolwp5ad518ecb95f9a86eb5b5f5a7a165bd3.png public/assets/js/professionallearningwp7aea55b0516bcb6f60becdc502c93665-444d90a2e4689966d71f4502f51b560c36c4e6ae72703121c127003bcf09839b.png public/assets/js/professionallearningwp7aea55b0516bcb6f60becdc502c93665.png public/assets/js/redesign-screencastwp0632a3b6553d509099e61147e4d7dd07-c3ed8a43c829142314735ef10a91feb727b0ddba743b0d25aa9d451ba7df84bb.png public/assets/js/redesign-screencastwp0632a3b6553d509099e61147e4d7dd07.png public/assets/js/small_purple_iconswpbe854106ca4dc1a0d64388b177ad9ffd-2f0fc0083827eaaea2a127be0e75ab21128c88fffc9acb74eacc53b64c4dfda2.png public/assets/js/small_purple_iconswpbe854106ca4dc1a0d64388b177ad9ffd.png public/assets/js/standardsandframeworkwp0a8a1c35db1cc5c3285f813fe2e15f23-a65c6f3745244d460c5f748bab7d596e187cb9d997e6f3a6117b3f747a8605ab.png public/assets/js/standardsandframeworkwp0a8a1c35db1cc5c3285f813fe2e15f23.png public/assets/js/teachercommunitywp9a85da3757170d2e01918532ce250674-4dad080075f26353a7e0fb56606bbef6a143e10133b87b183d2edce63ac4a4e8.png public/assets/js/teachercommunitywp9a85da3757170d2e01918532ce250674.png public/assets/js/tile-guidewp3ebdf2cbc512efb380c5833cfc56b739-b6159c81d170d08d6a372b5790288df9f8f83c86a4f3fcfbd32d5ca8fa7e3057.png public/assets/js/tile-guidewp3ebdf2cbc512efb380c5833cfc56b739.png