Sha256: 5e434c8af3c7ce9b48771f7c14cd7874363e5f9511b570d2e40d929aa5d0e78e
Contents?: true
Size: 1.29 KB
Versions: 3
Compression:
Stored size: 1.29 KB
Contents
require 'sprockets/component_processor' class Rafters::Railtie < Rails::Railtie initializer "rafters.load_view_paths" do |app| Rafters.view_paths = Dir[app.root.join("app", "components", "*", "views")] end initializer "rafters.load_asset_paths" do |app| Rafters.asset_paths = Dir[app.root.join("app", "components", "*", "assets", "*")] end initializer "rafters.set_asset_paths", :after => "rafters.load_asset_paths" do |app| app.config.assets.paths += Rafters.asset_paths end initializer "rafters.set_autoload_paths", :before => :set_autoload_paths do |app| app.config.autoload_paths += Dir[app.root.join("app", "components", "*/")] end config.after_initialize do |app| begin app.assets.unregister_preprocessor('text/css', Sprockets::DirectiveProcessor) app.assets.register_preprocessor('text/css', Sprockets::ComponentProcessor) rescue Rails.logger.warn("Could not load Sprockets::ComponentProcessor for text/css") end begin app.assets.unregister_preprocessor('application/javascript', Sprockets::DirectiveProcessor) app.assets.register_preprocessor('application/javascript', Sprockets::ComponentProcessor) rescue Rails.logger.warn("Could not load Sprockets::ComponentProcessor for application/javascript") end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rafters-0.1.0 | lib/rafters/railtie.rb |
rafters-0.0.5 | lib/rafters/railtie.rb |
rafters-0.0.4 | lib/rafters/railtie.rb |