Sha256: 245ed85489f5239d8a6d6f79b3ef2cabc268b34b347dbc1d910d97d65c60210a

Contents?: true

Size: 2 KB

Versions: 2

Compression:

Stored size: 2 KB

Contents

require 'foreman_setup'

module ForemanSetup
  class Engine < ::Rails::Engine
    engine_name 'foreman_setup'

    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_setup.load_app_instance_data" do |app|
      app.config.paths['db/migrate'] += ForemanSetup::Engine.paths['db/migrate'].existent
    end

    initializer 'foreman_setup.register_plugin', :after=> :finisher_hook do |app|
      Foreman::Plugin.register :foreman_setup do
        requires_foreman '>= 1.9.0'

        menu :top_menu, :provisioners, :url_hash => {:controller=> :'foreman_setup/provisioners', :action=>:index},
                 :caption=> N_('Provisioning setup'),
                 :parent => :infrastructure_menu,
                 :first => true

        security_block :provisioning do
          permission :edit_provisioning, {:'foreman_setup/provisioners' => [:index, :new, :update, :create, :show, :destroy, :step1,
             :step2, :step2_update, :step3, :step4, :step4_update, :step5] }, :resource_type => "ForemanSetup::Provisioner"
        end
        role "Provisioning setup", [:edit_provisioning]
      end
    end

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

    initializer 'foreman_setup.assets.precompile' do |app|
      app.config.assets.precompile += ['foreman_setup/false.png']
    end
    initializer 'foreman_setup.configure_assets', group: :assets do
      SETTINGS[:foreman_setup] = { assets: { precompile: ['foreman_setup/false.png'] } }
    end
  end

  def table_name_prefix
    'setup_'
  end

  def self.table_name_prefix
    'setup_'
  end

  def use_relative_model_naming
    true
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman_setup-3.0.2 lib/foreman_setup/engine.rb
foreman_setup-3.0.1 lib/foreman_setup/engine.rb