Sha256: ba421addb4a93882a8d2b8b1e97e416195ab77c060a6908d8ff5e3df42a44b2d

Contents?: true

Size: 1.09 KB

Versions: 6

Compression:

Stored size: 1.09 KB

Contents

# frozen_string_literal: true

require 'sprockets/railtie'

module DemoMode
  class Engine < ::Rails::Engine
    isolate_namespace DemoMode
    engine_name 'demo_mode'

    unless Rails.env.production?
      rake_tasks do
        load 'demo_mode/tasks.rb'
      end

      initializer 'demo_mode' do |_app|
        require 'zeitwerk/version'
        raise 'DemoMode only supports Zeitwerk::VERSION >= 2.4.2' unless Gem::Version.new(Zeitwerk::VERSION) >= Gem::Version.new('2.4.2')

        Rails.autoloaders.main.on_load(DemoMode.app_base_controller_name) do
          DemoMode.app_base_controller_name.constantize.include Demoable
        end
      end
    end

    initializer 'demo_mode.assets' do |app|
      app.config.assets.precompile << 'demo_mode/application.css'
      app.config.assets.precompile << 'demo_mode/application.js'
      app.config.assets.precompile << 'demo_mode/icon--user.png'
      app.config.assets.precompile << 'demo_mode/icon--users.png'
      app.config.assets.precompile << 'demo_mode/icon--tophat.png'
      app.config.assets.precompile << 'demo_mode/loader.png'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
demo_mode-1.4.1 lib/demo_mode/engine.rb
demo_mode-1.4.0 lib/demo_mode/engine.rb
demo_mode-1.3.0 lib/demo_mode/engine.rb
demo_mode-1.2.3 lib/demo_mode/engine.rb
demo_mode-1.2.2 lib/demo_mode/engine.rb
demo_mode-1.2.1 lib/demo_mode/engine.rb