Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins are not reloaded #86

Open
jadefish opened this issue Feb 13, 2019 · 0 comments
Open

Plugins are not reloaded #86

jadefish opened this issue Feb 13, 2019 · 0 comments

Comments

@jadefish
Copy link
Collaborator

jadefish commented Feb 13, 2019

When using a plugin in a POM, changing files causes the plugin to stop functioning.

Voom::Presenters.define(:some_pom) do
  plugin :some_plugin
  # ...
end

Changing any file (including the POM itself) causes the autoloader to reload everything. Plugins seem to not be included in the reload sweep, however, and the POM fails to render at next page load:

NameError at /some/path
undefined local variable or method `some_plugin'

This can be worked around by require_depdency'ing the plugin's main .rb file and any files referenced therein:

Voom::Presenters.define(:some_pom) do
  require_dependency 'voom/presenters/plugins/some_plugin.rb'
  require_dependency 'voom/presenters/plugins/some_plugin/component.rb'
  plugin :some_plugin
  # no more NameError
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant