Auto reloading files on a rack framework

Hello everyone,

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 ?

Thank you for your time ! :slight_smile:

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.

Click here to view Company Information and Confidentiality Notice.<http://www.jameshall.co.uk/index.php/small-print/email-disclaimer&gt;

off topic: Andy, there is a public archive of this list,
so a confidentiality notice seems rather strange.

Regards,
Marcus

···

Am 03.08.2016 um 18:25 schrieb Andy Jones:

Click here to view Company Information and Confidentiality Notice.[snip]

--
GitHub: stomar (Marcus Stollsteimer) · GitHub
PGP: 0x6B3A101A

Theres also a quite nice post about different code reloaders: http://rosenfeld.herokuapp.com/en/articles/ruby-rails/2016-07-18-a-review-of-code-reloaders-for-ruby

Cheers benny

···

On 2016-08-03 18:25, Andy Jones wrote:

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.

Click here to view Company Information and Confidentiality Notice.<http://www.jameshall.co.uk/index.php/small-print/email-disclaimer&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

off topic: Andy, there is a public archive of this list,
so a confidentiality notice seems rather strange.

Indeed. But of course the notice is appended to every mail by our exchange server; I have no control over it. This is a very common practice.

Click here to view Company Information and Confidentiality Notice.<http://www.jameshall.co.uk/index.php/small-print/email-disclaimer&gt;