Sha256: 96acff65619c75d7be52cb1f2a1f657be4df4dd468e343162551f8e0d3246b92

Contents?: true

Size: 1.67 KB

Versions: 162

Compression:

Stored size: 1.67 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|
      app.config.assets.paths << "#{Bastion::Engine.root}/vendor/assets/stylesheets/bastion"
    end

    initializer "bastion.configure_assets", :group => :all do |_app|
      SETTINGS[:bastion] = {:assets => {}} if SETTINGS[:bastion].nil?
      SETTINGS[:bastion][:assets] = {} if SETTINGS[:bastion][:assets].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
  end
end

Version data entries

162 entries across 162 versions & 1 rubygems

Version Path
katello-4.6.2 engines/bastion/lib/bastion/engine.rb
katello-4.7.0 engines/bastion/lib/bastion/engine.rb
katello-4.6.1 engines/bastion/lib/bastion/engine.rb
katello-4.7.0.rc2 engines/bastion/lib/bastion/engine.rb
katello-4.7.0.rc1 engines/bastion/lib/bastion/engine.rb
katello-4.4.2.2 engines/bastion/lib/bastion/engine.rb
katello-4.4.2.1 engines/bastion/lib/bastion/engine.rb
katello-4.4.2 engines/bastion/lib/bastion/engine.rb
katello-4.5.1 engines/bastion/lib/bastion/engine.rb
katello-4.6.0 engines/bastion/lib/bastion/engine.rb
katello-4.6.0.rc2 engines/bastion/lib/bastion/engine.rb
katello-4.6.0.rc1 engines/bastion/lib/bastion/engine.rb
katello-4.5.0 engines/bastion/lib/bastion/engine.rb
katello-4.5.0.rc2 engines/bastion/lib/bastion/engine.rb
katello-4.4.1 engines/bastion/lib/bastion/engine.rb
katello-4.5.0.rc1 engines/bastion/lib/bastion/engine.rb
katello-4.4.0.2 engines/bastion/lib/bastion/engine.rb
katello-4.4.0.1 engines/bastion/lib/bastion/engine.rb
katello-4.3.1 engines/bastion/lib/bastion/engine.rb
katello-4.4.0 engines/bastion/lib/bastion/engine.rb