Sha256: 17fa0a5078b16c785da68fe222067f43329b7a4c46ae7bd40bc4e41a60a4c9d3

Contents?: true

Size: 1.51 KB

Versions: 23

Compression:

Stored size: 1.51 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.configure_assets", :group => :all do |app|
      SETTINGS[:bastion] = {:assets => {}} if SETTINGS[:bastion].nil?

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

      locale_files = Dir.glob("#{Bastion::Engine.root}/vendor/assets/javascripts/#{Bastion.localization_path("*")}")
      locale_files.map do |file|
        file.gsub!("#{Bastion::Engine.root}/vendor/assets/javascripts/", "")
      end

      SETTINGS[:bastion][:assets][:precompile].concat(locale_files)
    end

    initializer 'bastion.assets.precompile', :after => 'bastion.configure_assets' do |app|
      app.config.assets.precompile += SETTINGS[:bastion][:assets][:precompile]
    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

23 entries across 23 versions & 1 rubygems

Version Path
bastion-4.2.2 lib/bastion/engine.rb
bastion-4.2.1 lib/bastion/engine.rb
bastion-4.2.0 lib/bastion/engine.rb
bastion-4.1.0 lib/bastion/engine.rb
bastion-4.0.0 lib/bastion/engine.rb
bastion-3.4.4 lib/bastion/engine.rb
bastion-3.4.3 lib/bastion/engine.rb
bastion-3.4.2 lib/bastion/engine.rb
bastion-3.4.1 lib/bastion/engine.rb
bastion-3.4.0 lib/bastion/engine.rb
bastion-3.3.6 lib/bastion/engine.rb
bastion-3.3.5 lib/bastion/engine.rb
bastion-3.3.4 lib/bastion/engine.rb
bastion-3.3.3 lib/bastion/engine.rb
bastion-3.3.2 lib/bastion/engine.rb
bastion-3.3.1 lib/bastion/engine.rb
bastion-3.3.0 lib/bastion/engine.rb
bastion-3.2.2 lib/bastion/engine.rb
bastion-3.2.1 lib/bastion/engine.rb
bastion-3.2.0 lib/bastion/engine.rb