Sha256: b1d789f1b67be4eb087ebe2f0d4da68ef5b08bb026b07d2b4f394c1aa3763d9a
Contents?: true
Size: 1.38 KB
Versions: 1
Compression:
Stored size: 1.38 KB
Contents
require 'rafters/sprockets/directive_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", "*", "*/")] 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', Rafters::DirectiveProcessor) 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', Rafters::DirectiveProcessor) rescue Rails.logger.warn("Could not load Sprockets::ComponentProcessor for application/javascript") end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rafters-1.2.1 | lib/rafters/railtie.rb |