Sha256: 8966222a5268a0d7ba3d119638b4ffe10f272b878807c3a7d637d8558f9cb24b

Contents?: true

Size: 835 Bytes

Versions: 2

Compression:

Stored size: 835 Bytes

Contents

require 'fast_gettext'
require 'gettext_i18n_rails'
require 'fog'

module ForemanOne
  #Inherit from the Rails module of the parent app (Foreman), not the plugin.
  #Thus, inherits from ::Rails::Engine and not from Rails::Engine
  class Engine < ::Rails::Engine

    initializer 'foreman_one.register_gettext', :after => :load_config_initializers do |app|
      locale_dir = File.join(File.expand_path('../../..', __FILE__), 'locale')
      locale_domain = 'one'

      Foreman::Gettext::Support.add_text_domain locale_domain, locale_dir
    end

    initializer 'foreman_one.register_plugin', :after=> :finisher_hook do |app|
      Foreman::Plugin.register :foreman_one do
        requires_foreman '> 1.4'
        # Register OpenNebula compute resource in foreman
        compute_resource ForemanOne::One
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman_one-0.2 lib/foreman_one/engine.rb
foreman_one-0.1 lib/foreman_one/engine.rb