Sha256: 1156ff36feced2a977058cd4cc91a8a5b6a9469e5c805f54059fb6d613e837aa

Contents?: true

Size: 1.48 KB

Versions: 7

Compression:

Stored size: 1.48 KB

Contents

# frozen_string_literal: true

module ForemanAcd
  # This engine connects ForemanAcd with Foreman core
  class Engine < ::Rails::Engine
    engine_name 'foreman_acd'

    config.autoload_paths += Dir["#{config.root}/app/controllers/foreman_acd/concerns"]
    config.autoload_paths += Dir["#{config.root}/app/helpers"]
    config.autoload_paths += Dir["#{config.root}/app/models/foreman_acd/concerns"]
    config.autoload_paths += Dir["#{config.root}/app/models/parameters"]
    config.autoload_paths += Dir["#{config.root}/app/overrides"]
    config.autoload_paths += Dir["#{config.root}/app/services"]
    config.autoload_paths += Dir["#{config.root}/app/lib"]

    # Add any db migrations
    initializer 'foreman_acd.load_app_instance_data' do |app|
      ForemanAcd::Engine.paths['db/migrate'].existent.each do |path|
        app.config.paths['db/migrate'] << path
      end
    end

    initializer 'foreman_acd.apipie' do
      Apipie.configuration.checksum_path += ['/acd/api/']
    end

    rake_tasks do
      Rake::Task['db:seed'].enhance do
        ForemanAcd::Engine.load_seed
      end
    end

    initializer 'foreman_acd.register_gettext', :after => :load_config_initializers do
      locale_dir = File.join(File.expand_path('../..', __dir__), 'locale')
      locale_domain = 'foreman_acd'
      Foreman::Gettext::Support.add_text_domain locale_domain, locale_dir
    end

    initializer 'foreman_acd.register_plugin', :before => :finisher_hook do
      require 'foreman_acd/plugin'
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
foreman_acd-0.2.1 lib/foreman_acd/engine.rb
foreman_acd-0.0.6 lib/foreman_acd/engine.rb
foreman_acd-0.0.5 lib/foreman_acd/engine.rb
foreman_acd-0.0.4 lib/foreman_acd/engine.rb
foreman_acd-0.0.3 lib/foreman_acd/engine.rb
foreman_acd-0.0.2 lib/foreman_acd/engine.rb
foreman_acd-0.0.1 lib/foreman_acd/engine.rb