Sha256: ef62a54035650e396720fdfc667706085038008bb89d2f0f8089c095ca792cb7

Contents?: true

Size: 654 Bytes

Versions: 5

Compression:

Stored size: 654 Bytes

Contents

require 'rails'

module Opal
  module Rails
    class Engine < ::Rails::Engine
      config.app_generators.javascript_engine :opal

      # Cache eager_load_paths now, otherwise the assets dir is added
      # and its .rb files are eagerly loaded.
      config.eager_load_paths

      initializer 'opal.asset_paths', :after => 'sprockets.environment', :group => :all do |app|
        app.config.before_initialize do
          app.config.eager_load_paths = app.config.eager_load_paths.dup - Dir["#{app.root}/app/{assets,views}"]
        end

        Opal.paths.each do |path|
          app.assets.append_path path
        end
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
opal-rails-0.3.8 lib/opal/rails/engine.rb
opal-rails-0.3.7 lib/opal/rails/engine.rb
opal-rails-0.3.6 lib/opal/rails/engine.rb
opal-rails-0.3.5 lib/opal/rails/engine.rb
opal-rails-0.3.4 lib/opal/rails/engine.rb