There's a lot of conditionals in this file. Seems like a perfect use case for polymorphism. You've already setup individual modules for each framework, and it seems logical to extend that even further. It may require making them classes instead of modules. For instance....

I think you could also take it a step further and implement some simple delegation on the frameworks, so as long as you keep the method name the same between this class and the sub-framework classes.

If when you first get the framework, you figure out which one it is in the constructor:

```Ruby
module Sidekiq
  class Framework
     def initialize
        @framework = identify_framework.new
     end

     def hook!
        @framework.hook # All Framework classes respond to hook, and you can do all the correct requires in it
     end

     def root
        @framework.root # All Framework classes respond to root, and do the right thing
     end

     private

     def identify_framework
        ..... #you logic to figure out which one, ie let's assume it's Rails
        Sidekiq::Framework::Rails
     end
   end
end
```

None of this is totally necessary, but it would keep the complication out of this class and make some beautiful code  :beers: