EagerELK / ditty

Sinatra Based Web Application Framework
MIT License
8 stars 7 forks source link

Ditty doesn't register a new component #34

Closed AlfredBrandon closed 3 months ago

AlfredBrandon commented 3 months ago

`# frozen_string_literal: true

module Ditty class AutomatedActions class << self

  begin
    def routes
      controllers = File.expand_path('../../automatedactions/controllers', __dir__)
      Dir.glob("#{controllers}/*.rb").sort.each { |f| require f }
      {
        '/rules' => ::AutomatedActions::RuleController,
        '/domains' => ::AutomatedActions::DomainController,
        '/conditions' => ::AutomatedActions::ConditionController,
      }
    end
  end
end

end end

Ditty::Components.register_component(:automatedactions, Ditty::AutomatedActions)`

I have added a new component and read the documentation on how to add a new component . When I added the above component it doesn't want to register on Ditty.

AlfredBrandon commented 3 months ago

Found the issue thanks as part of the application.rb you also need to register the new component.