Hi !
Trying to write a patch which will allow the user to configure where
to have their vendor/gems directory (ies!). However this is rather
tricky to add because there seems to be 3 main times when rails will
want to load up and work with vendor/gems.
1) the Rake tasks to freeze / unfreeze gems
2) the Rails startup code in the very beginning, will try to load once the gems
3) the time after environment.rb and *after* the config,gem in run
initializer do |config|.
So far I have succeeded in doing muliple paths for 3), but not 1) and 2).
I can put in my environment.rb a configuration line like this:
config.gem_paths = ["#{PLUGIN_PATH}/vendor/gems"]
But if telling the load paths is happen too late in the environment.rb
file, then where earlier can we specify such a configuration?
Which is basically an equivalent of config.plugin_paths for plugins
(which is already in rails). The problem is that these rake tasks and
early initialization code don't read the environment.rb file until
much later on. I think that it would be nice to have this feature, but
am finding the gems management code a little too complex to be able to
accomodate this one.
This is in contrast to rails plugins which don't need such a complex
loading beforehand. Why are the vendor/gems need to be loaded up so
rigourously? If you have checked out your vendor/gems under version
control then why the need for these rake tasks ? It seems slightly
inflexible approach.
And were there any other plans to re-think the gem code (ie at times
like during search of gem dependancies at startup, etc) ?
Thoughts and comments appreciated.
You can get my code at:
http://github.com/dreamcat4/rails/tree/wip-multi-gem-paths
Its just a single commit based off the 2-3-stable branch. See:
http://github.com/dreamcat4/rails/commit/0b347ba81210363035d998831b66564b42adf006
dreamcat4
[email protected]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---