Sha256: d3fa67ad5844ed481c9f76c61fdb5e466dba3bc283f6f9561e04d62e9ae1f6b6

Contents?: true

Size: 794 Bytes

Versions: 2

Compression:

Stored size: 794 Bytes

Contents

module OodAppkit
  # The Rails Engine that defines the OodAppkit environment
  class Engine < Rails::Engine
    # Set default configuration options before initializers are called
    config.before_initialize do
      OodAppkit.set_default_configuration
    end

    # Confirm the `OodAppkit.dataroot` configuration option was set
    config.after_initialize do
      raise UndefinedDataroot, "OodAppkit.dataroot must be defined (default: ENV['OOD_DATAROOT'])" unless OodAppkit.dataroot
    end

    config.to_prepare do
      # TODO:
      # make the helper available to all views
      # i.e. ApplicationController.helper(OodBannerHelper)
    end

    # An exception raised when `OodAppkit.dataroot` configuration option is undefined
    class UndefinedDataroot < StandardError; end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ood_appkit-0.0.3 lib/ood_appkit/engine.rb
ood_appkit-0.0.2 lib/ood_appkit/engine.rb