Sha256: 8b09a84591c21d7d5cf2db6f444d64eeea57773c4d1627daa5118004b5f90c03

Contents?: true

Size: 1.21 KB

Versions: 3

Compression:

Stored size: 1.21 KB

Contents

require 'foreman_bootdisk'

module Bootdisk
  class Engine < ::Rails::Engine
    engine_name Bootdisk::ENGINE_NAME

    config.autoload_paths += Dir["#{config.root}/app/controllers/concerns"]
    config.autoload_paths += Dir["#{config.root}/app/helpers/concerns"]
    config.autoload_paths += Dir["#{config.root}/app/models/concerns"]

    initializer 'foreman_bootdisk.load_default_settings', :before => :load_config_initializers do |app|
      require_dependency File.expand_path("../../../app/models/setting/bootdisk.rb", __FILE__) if (Setting.table_exists? rescue(false))
    end

    initializer "foreman_bootdisk.load_app_instance_data" do |app|
      app.config.paths['db/migrate'] += Bootdisk::Engine.paths['db/migrate'].existent
    end

    config.to_prepare do
      begin
        ConfigTemplate.send(:include, Bootdisk::ConfigTemplateExt)
        Host::Managed.send(:include, Bootdisk::HostExt)
        HostsController.send(:include, Bootdisk::HostsControllerExt)
        HostsHelper.send(:include, Bootdisk::HostsHelperExt)
        UnattendedController.send(:include, Bootdisk::UnattendedControllerExt)
      rescue => e
        puts "#{Bootdisk::ENGINE_NAME}: skipping engine hook (#{e.to_s})"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
foreman_bootdisk-1.2.3 lib/bootdisk/engine.rb
foreman_bootdisk-1.2.2 lib/bootdisk/engine.rb
foreman_bootdisk-1.2.1 lib/bootdisk/engine.rb