I'm currently building a web framework to match some custom needs.
I'd like to implement an auto-reload file solution for devs, but I
don't really know what approach I should follow.
I see 2 way of doing this :
- Following all the files in the folder of my project an re-require
(if it is possible) the new class.
- This approach sounds a bit heavy, and I'm not sure I can follow
some external file the dev might add.
- Re-instantiate my application on every request
- It seems to be a little bit heavy too, since I would have to
reload all the caches of my request dispatchers.
Which one should I choose ? Am I missing something ? Is there another
way of doing this that could be better ?
I'm currently building a web framework to match some custom needs.
I'd like to implement an auto-reload file solution for devs, but I
don't really know what approach I should follow.
The Sinatra FAQ recommends using rerun (https://github.com/alexch/rerun\) for this. I can't see that it is written with Sinatra in mind, so it should work for you. I've never used it, so I can't make any further comment.
I'm currently building a web framework to match some custom needs.
I'd like to implement an auto-reload file solution for devs, but I
don't really know what approach I should follow.
The Sinatra FAQ recommends using rerun (https://github.com/alexch/rerun\) for this. I can't see that it is written with Sinatra in mind, so it should work for you. I've never used it, so I can't make any further comment.