Sha256: 2b789639b5eba51322ed74b70790cdbb2a38eb81affd4870370a473bf9542c36

Contents?: true

Size: 1.32 KB

Versions: 6

Compression:

Stored size: 1.32 KB

Contents

require 'rails'

module Bastion
  class Engine < ::Rails::Engine

    isolate_namespace Bastion

    initializer 'bastion.assets_dispatcher', :before => :build_middleware_stack do |app|
      app.middleware.use ::ActionDispatch::Static, "#{Bastion::Engine.root}/app/assets/javascripts/bastion"
    end

    initializer 'bastion.mount_engine', :after => :build_middleware_stack do |app|
      app.routes_reloader.paths << "#{Bastion::Engine.root}/config/routes/mount_engine.rb"
      app.routes_reloader.paths.unshift("#{Bastion::Engine.root}/config/routes.rb")
    end

    initializer "bastion.assets", :group => :all do |app|
      if Rails.env.production?
        app.config.assets.paths << "#{Bastion::Engine.root}/vendor/assets/stylesheets/bastion"
      else
        app.config.less.paths << "#{Bastion::Engine.root}/vendor/assets/stylesheets/bastion"
      end
    end

    initializer "bastion.plugin", :group => :all do |app|
      SETTINGS[:bastion] = {:assets => {}} if SETTINGS[:bastion].nil?

      SETTINGS[:bastion][:assets][:precompile] = [
        'bastion/bastion.css',
        'bastion/bastion.js'
      ]
    end

    initializer "angular_templates", :group => :all do |app|
      app.config.angular_templates.ignore_prefix = %w([bastion]*\/+)
    end

    rake_tasks do
      load "#{Bastion::Engine.root}/Rakefile"
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bastion-0.2.8 lib/bastion/engine.rb
bastion-0.2.7 lib/bastion/engine.rb
bastion-0.2.6 lib/bastion/engine.rb
bastion-0.2.5 lib/bastion/engine.rb
bastion-0.2.3 lib/bastion/engine.rb
bastion-0.2.2 lib/bastion/engine.rb