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

how about '#require_dependency if defined? Rails' ? #2

Closed
stanislaw opened this issue Oct 11, 2011 · 3 comments
Closed

how about '#require_dependency if defined? Rails' ? #2

stanislaw opened this issue Oct 11, 2011 · 3 comments

Comments

@stanislaw
Copy link

Hi!

I can't foresee now all possible consequences, but it seems to be possible to have #require_dependency instead of #require when require_all is operating in Rails app context.

What do you think?

And...

Thank you for a nice gem!

@jarmo
Copy link
Owner

jarmo commented Oct 12, 2011

Could you be more specific what would that #require_dependency do exactly?

@stanislaw
Copy link
Author

It allows class reloading on each request in development mode.

http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/c010f3051c7d9cdb?pli=1

@jarmo
Copy link
Owner

jarmo commented Oct 12, 2011

I'm not sure if that is meant for a public use.

But, nevertheless - you can already do that since RequireAll has quite flexible API. Just put :require_dependencies as a :method argument for #require_all:

module ::RequireAll
  def require_all_deps *args
    require_all args, :method => :require_dependencies
  end
end

# and now use #require_all_deps wherever you want...

@jarmo jarmo closed this as completed Oct 12, 2011
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

2 participants