I have a rails engine. In initializer it requires a bunch of files from some folder. In this file user of my engine defines code, business logic, configures engine, etc.. All this data is stored statically in my engine main module class MyEngine class << self end end I want this files to be reloaded on each request to application in development mode. (So that the user don''t have to reload server to see changes he just made) Of course I can do something like this instead of initializer config.to_prepare do load(''some/file'') end But this way i will have issues (because constants defined in this file wont really reloaded) The ideal solution would be to make my whole engine reloadable on each request, but a have not found the way to do it. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I have a rails engine. In initializer it requires a bunch of files from some folder. In this file user of my engine defines code, business logic, configures engine, etc.. All this data is stored statically in my engine main module module MyEngine class << self def application @application ||= MyEngine::Application end end end I want this files to be reloaded on each request to application in development mode. (So that the user don''t have to reload server to see changes he just made) Of course I can do something like this instead of initializer config.to_prepare do MyEngine.application.clear! load(''some/file'') end But this way i will have issues (because constants defined in this file wont really reloaded) The ideal solution would be to make my whole engine reloadable on each request, but a have not found the way to do it. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.