Sha256: 3187e6fedb7c0401b007275d471bac3317e520c6564770feffbfb1216d94b7e7

Contents?: true

Size: 866 Bytes

Versions: 1

Compression:

Stored size: 866 Bytes

Contents

module ForemanHostRundeck
  class Engine < ::Rails::Engine

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

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

        # Add permissions
        security_block :foreman_host_rundeck do
          permission :view_foreman_host_rundeck, {:hosts_controller => [:index, :show]}
        end
      end
    end

    #Include concerns in this config.to_prepare block
    config.to_prepare do
      begin
        HostsController.send(:include, ForemanHostRundeck::HostsControllerExtensions)
      # rescue => e
      #   puts "ForemanHostRundeck: skipping engine hook (#{e})"
       end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
foreman_host_rundeck-0.0.2 lib/foreman_host_rundeck/engine.rb