Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Recover from lack of JS runtime in production #1

Merged
merged 5 commits into from Feb 24, 2012

Conversation

Projects
None yet
2 participants
Contributor

gkellogg commented Feb 21, 2012

In a hosting environment where there is no JavaScript runtime, Assets#path_for, calls Bundle#name and Bundle#hashed_path, both of which rely on Bundle#content, which uses Uglifier and CSSMin. Uglifier depends on a JavaScript runtime environment on the server, which shouldn't be necessary if pre-compilation is done in development, and may not be available on the hosting environment.

This change moves the require for 'uglifier' and 'cssmin' into #content, and adds a rescue clause in #hash to look up the have from the most recent complied assets, removing the dependency on the runtime in a production enviornment. Arguably, it shouldn't even attempt to calculate a hash in production, and look for compiled assets based on the filename pattern, but this change doesn't go there.

@peteog peteog added a commit that referenced this pull request Feb 24, 2012

@peteog peteog Merge pull request #1 from gkellogg/master
Recover from lack of JS runtime in production
a89fe8d

@peteog peteog merged commit a89fe8d into peteog:master Feb 24, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment