Sha256: 9726bb936de510a9aced871345f64dbeef63299114554906a301d574171cbbe7

Contents?: true

Size: 776 Bytes

Versions: 5

Compression:

Stored size: 776 Bytes

Contents

module Teabag
  class Engine < ::Rails::Engine

    isolate_namespace Teabag

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

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

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

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
teabag-0.7.3 lib/teabag/engine.rb
teabag-0.7.2 lib/teabag/engine.rb
teabag-0.7.1 lib/teabag/engine.rb
teabag-0.7.0 lib/teabag/engine.rb
teabag-0.6.0 lib/teabag/engine.rb