Files
BreakEscape/lib/break_escape/engine.rb
Z. Cliffe Schreuders 680c7bfcae feat: Generate Rails Engine structure
- Create mountable engine with isolated namespace
- Configure Pundit authorization
- Set up gemspec with dependencies
- Configure generators for test_unit with fixtures
2025-11-21 15:27:53 +00:00

27 lines
621 B
Ruby

require 'pundit'
module BreakEscape
class Engine < ::Rails::Engine
isolate_namespace BreakEscape
config.generators do |g|
g.test_framework :test_unit, fixture: true
g.assets false
g.helper false
end
# Load lib directory
config.autoload_paths << File.expand_path('../', __dir__)
# Pundit authorization
config.after_initialize do
if defined?(Pundit)
BreakEscape::ApplicationController.include Pundit::Authorization
end
end
# Static files from public/break_escape
config.middleware.use ::ActionDispatch::Static, "#{root}/public"
end
end