Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Config a Sprockets::Environment to mount as a Rack end-point. I like to use a subclass
- # as it allows the config to be easily reusable. Since I use the same instance for
- # all mount points I make it a singleton class. I just add this as an initializer to my
- # project since it is really just configuration.
- class AssetServer < Sprockets::Environment
- include Singleton
- def initialize
- super Rails.public_path
- append_path 'javascripts'
- append_path 'stylesheets'
- if Rails.env.production?
- self.js_compressor = YUI::JavaScriptCompressor.new :munge => true, :optimize => true
- self.css_compressor = YUI::CssCompressor.new
- end
- end
- end
Add Comment
Please, Sign In to add comment