Sha256: ec41a0f2bd20eb31b9157210a2954c18e38ede4e613c76879f55765f1031c113

Contents?: true

Size: 1.64 KB

Versions: 15

Compression:

Stored size: 1.64 KB

Contents

require "rails"

module Ddr
  module Models
    class Engine < ::Rails::Engine

      engine_name "ddr_models"

      config.generators do |g|
        g.test_framework :rspec
        g.fixture_replacement :factory_girl
        g.assets false
        g.helper false
      end

      #
      # Initializers
      #
      initializer "ddr_models.external_files" do
        Ddr::Models.external_file_store = ENV["EXTERNAL_FILE_STORE"]
        Ddr::Models.external_file_subpath_pattern = ENV["EXTERNAL_FILE_SUBPATH_PATTERN"] || "--"
      end

      # Add custom predicates to ActiveFedora
      initializer "ddr_models.predicates" do
        ActiveFedora::Predicates.set_predicates(Ddr::Metadata::PREDICATES)
      end

      # Integration of remote (Grouper) groups via Shibboleth
      initializer "ddr_auth.grouper" do
        # Load configuration for Grouper service, if present
        if File.exists? "#{Rails.root}/config/grouper.yml"
          Ddr::Auth::GrouperService.config = YAML.load_file("#{Rails.root}/config/grouper.yml")[Rails.env]
        end

        Warden::Manager.after_set_user do |user, auth, opts|
          user.group_service = Ddr::Auth::RemoteGroupService.new(auth.env)
        end
      end

      # Set superuser group
      initializer "ddr_auth.superuser" do
        Ddr::Auth.superuser_group = ENV["SUPERUSER_GROUP"]
      end

      initializer "ddr_auth.collection_creators" do
        Ddr::Auth.collection_creators_group = ENV["COLLECTION_CREATORS_GROUP"]
      end

      initializer "ezid_client" do
        unless Rails.env.production?
          require "ezid/test_helper"
          ezid_test_mode!
        end
      end

    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ddr-models-1.11.8 lib/ddr/models/engine.rb
ddr-models-1.12.3 lib/ddr/models/engine.rb
ddr-models-1.11.7 lib/ddr/models/engine.rb
ddr-models-1.12.2 lib/ddr/models/engine.rb
ddr-models-1.11.6 lib/ddr/models/engine.rb
ddr-models-1.12.1 lib/ddr/models/engine.rb
ddr-models-1.11.5 lib/ddr/models/engine.rb
ddr-models-1.12.0 lib/ddr/models/engine.rb
ddr-models-1.11.4 lib/ddr/models/engine.rb
ddr-models-1.11.3 lib/ddr/models/engine.rb
ddr-models-1.11.2 lib/ddr/models/engine.rb
ddr-models-1.11.1 lib/ddr/models/engine.rb
ddr-models-1.11.0 lib/ddr/models/engine.rb
ddr-models-1.10.0 lib/ddr/models/engine.rb
ddr-models-1.9.0 lib/ddr/models/engine.rb