1
votes

I'm working on a bigger Rails application which should be able to load plugins. To achieve this at the moment I read the plugin files in a before hook and eval them. But this sucks... first of all, I'd like to get rid of the eval. I tried using require instead but when I do this, the files get only loaded once when I start the application.

This leads to my question: how do I either reload external files for every request (in development mode) or otherwise, is there a better way of handling plugins?

Greetings, CK

1
How about to use load instead of require? - jdoe
This is the solution, thank you! - ckruse
jdoe you should post your answer - BvuRVKyUVlViVIc7

1 Answers

2
votes

Kernel#load will load the file everytime.

Kernel#require will load it once.

Use load instead of require.