I have two apps sharing a common model and lib. I''d like to share my plugins as well, however I noticed that the plugins_path in the Rails::Configuration (0.14.2) is not accessible as is view_path or log_path. What would be the best way to go about accomplishing this? Thanks. --Ryan
On Nov 5, 2005, at 10:06 AM, Ryan Wood wrote:> I have two apps sharing a common model and lib. I''d like to share my > plugins as well, however I noticed that the plugins_path in the > Rails::Configuration (0.14.2) is not accessible as is view_path or > log_path. What would be the best way to go about accomplishing this? > Thanks.You can subclass Rails::Configuration and pass it into Rails::Initializer.run. Your environment.rb will look something like this: class CustomConfig < Rails::Configuration def plugin_path "/path/to/my/custom/plugin/location" end end Rails::Initializer.run(:process, CustomConfig.new) do |config| ... end (Disclaimer: I''ve not actually tried this, but it should work, in theory) - Jamis
Nathaniel S. H. Brown
2005-Nov-05 19:42 UTC
RE: Changing plugins_path in Rails::Configuration
I heard on the ODEO Rails podcast that they do something similar by having the svn:externals link multiple application interfaces across the same core. Warmest regards, Nathan. -------------------------------------------------------------- Nathaniel S. H. Brown Toll Free 1.877.4.INIMIT Inimit Innovations Phone 604.724.6624 www.inimit.com Fax 604.444.9942> -----Original Message----- > From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Ryan Wood > Sent: November 5, 2005 9:07 AM > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: [Rails] Changing plugins_path in Rails::Configuration > > I have two apps sharing a common model and lib. I''d like to > share my plugins as well, however I noticed that the > plugins_path in the Rails::Configuration (0.14.2) is not > accessible as is view_path or log_path. What would be the > best way to go about accomplishing this? > Thanks. > > --Ryan > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Thanks Jamis. Works like a charm (except that the method to override is "plugins_path" not "plugin_path"). That stumped me for a bit, but now does exactly what I need. --Ryan On 11/5/05, Jamis Buck <jamis-uHoyYlH2B+GakBO8gow8eQ@public.gmane.org> wrote:> On Nov 5, 2005, at 10:06 AM, Ryan Wood wrote: > > > I have two apps sharing a common model and lib. I''d like to share my > > plugins as well, however I noticed that the plugins_path in the > > Rails::Configuration (0.14.2) is not accessible as is view_path or > > log_path. What would be the best way to go about accomplishing this? > > Thanks. > > You can subclass Rails::Configuration and pass it into > Rails::Initializer.run. Your environment.rb will look something like > this: > > class CustomConfig < Rails::Configuration > def plugin_path > "/path/to/my/custom/plugin/location" > end > end > > Rails::Initializer.run(:process, CustomConfig.new) do |config| > ... > end > > (Disclaimer: I''ve not actually tried this, but it should work, in > theory) > > - Jamis > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On Nov 5, 2005, at 6:12 PM, Ryan Wood wrote:> Thanks Jamis. Works like a charm (except that the method to override > is "plugins_path" not "plugin_path"). That stumped me for a bit, but > now does exactly what I need.Gah, my apologies. Glad you got it working in spite of my attempt to misdirect you. ;) - Jamis> > --Ryan > > On 11/5/05, Jamis Buck <jamis-uHoyYlH2B+GakBO8gow8eQ@public.gmane.org> wrote: >> On Nov 5, 2005, at 10:06 AM, Ryan Wood wrote: >> >>> I have two apps sharing a common model and lib. I''d like to share my >>> plugins as well, however I noticed that the plugins_path in the >>> Rails::Configuration (0.14.2) is not accessible as is view_path or >>> log_path. What would be the best way to go about accomplishing this? >>> Thanks. >> >> You can subclass Rails::Configuration and pass it into >> Rails::Initializer.run. Your environment.rb will look something like >> this: >> >> class CustomConfig < Rails::Configuration >> def plugin_path >> "/path/to/my/custom/plugin/location" >> end >> end >> >> Rails::Initializer.run(:process, CustomConfig.new) do |config| >> ... >> end >> >> (Disclaimer: I''ve not actually tried this, but it should work, in >> theory) >> >> - Jamis >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails