Sha256: ac7cc1e32e1db53dfe5bbb75708a291581b1dab7bfeb536d0e28bd53014caff5

Contents?: true

Size: 874 Bytes

Versions: 2

Compression:

Stored size: 874 Bytes

Contents

require 'fileutils'
require 'yaml'
require 'diffy'
require 'git'

module ForemanTemplates
  # Inherit from the Rails module of the parent app (Foreman), not the plugin.
  # Thus, inhereits from ::Rails::Engine and not from Rails::Engine
  class Engine < ::Rails::Engine
    engine_name 'foreman_templates'

    initializer 'foreman_templates.register_plugin', :before => :finisher_hook do
      Foreman::Plugin.register :foreman_templates do
        requires_foreman '>= 1.12'
      end
    end

    config.to_prepare do
      begin
        Template.send(:include, ForemanTemplates::TemplateImport)
        Ptable.send(:include, ForemanTemplates::PtableImport)
        ProvisioningTemplate.send(:include, ForemanTemplates::ProvisioningTemplateImport)
      rescue => e
        puts "#{ForemanTemplates::ENGINE_NAME}: skipping engine hook (#{e})"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman_templates-3.1.0 lib/foreman_templates/engine.rb
foreman_templates-3.0.0 lib/foreman_templates/engine.rb