eandrejko / asset_packager Goto Github PK
View Code? Open in Web Editor NEWThis project forked from sbecker/asset_packager
JavaScript and CSS Asset Compression for Production Rails Apps
Home Page: http://synthesis.sbecker.net/pages/asset_packager
This project forked from sbecker/asset_packager
JavaScript and CSS Asset Compression for Production Rails Apps
Home Page: http://synthesis.sbecker.net/pages/asset_packager
Line
system("java -jar #{yui_path}/yuicompressor-2.4.2.jar --type js -v #{full_asset_path(s)} >/dev/null")
can be changed
system("java -jar #{yui_path}/yuicompressor-2.4.2.jar --type js -v #{full_asset_path(s)}")
to avoid problem on Windows OS.
Hi,
I was just trying out this plug-in as a replacement for the built in logic in v2.3.5 of Rails but I had some issues getting it running.
asset_packager.rb, Line 184: uninitialized class variable @@asset_host in Synthesis::AssetPackage
After doing a search I noticed that this variable was only populated in the build_all method, which is part of a rake task.
As my site was trying to create the initial files on the fly all I did was change the code to the following to get it running:
# class variables
@@asset_host = Rails.configuration.action_controller.asset_host
....
def build_all
@@asset_packages_yml.keys.each do |asset_type|
@@asset_packages_yml[asset_type].each { |p| self.new(asset_type, p).build }
end
end
I didn't have to make a change to the replace_asset_urls method.
EDIT: I just noticed this breaks the rake task, so I have now removed the line I added above and left it in build_all and added it to the replace_asset_urls method.
Regards,
Nick
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.