I’m currently attempting to introduce dry-system to rails, but I am having issues with auto registrar of dry-system with as my classes are inflected with ActiveSupport::Inflections. Is there a way to configure inflections with dry-system auto-register functionality? By the way, this is my current workaround solution in Rails, but using inject will still invoke inflecto and cause issues.
class Container < Dry::System::Container
configure do |config|
config.root = Rails.root
end
load_paths!('lib/components')
end
dir = Rails.root.join('lib/components')
Dir["#{dir}/**/*.rb"].each do |filename|
pathname = Pathname.new(filename)
.relative_path_from(dir)
.sub_ext('')
.to_path
require pathname
Container.register(pathname.tr('/', '.'), pathname.camelize.constantize.new)