Created
September 15, 2011 17:03
-
-
Save skanev/1219818 to your computer and use it in GitHub Desktop.
Replacing Sprocketizer with Sprockets 2.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Something::Application.routes.draw do | |
| # ... | |
| mount SprocketizerReplacement.app => 'sprockets' | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module SprocketizerReplacement | |
| extend self | |
| def app | |
| Sprockets::Environment.new(Rails.root.to_s) do |env| | |
| env.logger = Rails.logger | |
| env.version = Rails.env + '-1.0' | |
| env.cache = Rails.cache | |
| env.append_path 'app/javascripts' | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shouldn't you always assign
Rails.cache? In development,Rails.cacheis a simple in-memory cache that is cleared between all requests AFAIK.