Sha256: 838fbb0d3209c4488b5fd1b264a69d79177e0908d40bc9d2198a6808dfaf2406

Contents?: true

Size: 792 Bytes

Versions: 4

Compression:

Stored size: 792 Bytes

Contents

module Teaspoon
  class Engine < ::Rails::Engine

    isolate_namespace Teaspoon

    initializer :assets, :group => :all do |app|
      # default the root if it's not set
      Teaspoon.configuration.root ||= app.root

      # append the asset paths from the configuration
      Teaspoon.configuration.asset_paths.each do |path|
        app.config.assets.paths << Teaspoon.configuration.root.join(path).to_s
      end
    end

    config.after_initialize do |app|
      # inject our sprockets hack for instrumenting javascripts
      Sprockets::Environment.send(:include, Teaspoon::SprocketsInstrumentation)

      # prepend routes so a catchall doesn't get in the way
      app.routes.prepend do
        mount Teaspoon::Engine => Teaspoon.configuration.mount_at
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
teaspoon-0.7.8 lib/teaspoon/engine.rb
teaspoon-0.7.7 lib/teaspoon/engine.rb
teaspoon-0.7.6 lib/teaspoon/engine.rb
teaspoon-0.7.5 lib/teaspoon/engine.rb