I come from a PHP environment where we have a "library" of sorts that contains various functionality in the form of object-oriented classes. The classes can be tied into any new project and the functionality of that class is gained without any duplication of coding efforts. In learning Ruby on Rails, I''d like to create something similar for use in developing Rails applications. Is there a best practice for said "library" of functionality? How best is this code base shared between applications? Most importantly, how can updates to said library be easily reflected across all applications? For instance, we want to have a single login/logout user capability between applications, since all of our applications will share the same userbase. I know restful_authentication exists, but I''m working on rolling my own as a learning exercise. Give a User Model, Session (login/logout) and User (registration/ activation) Controllers, and an Authentication Module, what is the best way to share this code set across applications? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Plugins. On Feb 15, 8:25 pm, ericindc <ericmilf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I come from a PHP environment where we have a "library" of sorts that > contains various functionality in the form of object-oriented > classes. The classes can be tied into any new project and the > functionality of that class is gained without any duplication of > coding efforts. > > In learning Ruby on Rails, I''d like to create something similar for > use in developing Rails applications. Is there a best practice for > said "library" of functionality? How best is this code base shared > between applications? Most importantly, how can updates to said > library be easily reflected across all applications? > > For instance, we want to have a single login/logout user capability > between applications, since all of our applications will share the > same userbase. I know restful_authentication exists, but I''m working > on rolling my own as a learning exercise. > > Give a User Model, Session (login/logout) and User (registration/ > activation) Controllers, and an Authentication Module, what is the > best way to share this code set across applications?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Plugins. On Feb 15, 8:25 pm, ericindc <ericmilf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I come from a PHP environment where we have a "library" of sorts that > contains various functionality in the form of object-oriented > classes. The classes can be tied into any new project and the > functionality of that class is gained without any duplication of > coding efforts. > > In learning Ruby on Rails, I''d like to create something similar for > use in developing Rails applications. Is there a best practice for > said "library" of functionality? How best is this code base shared > between applications? Most importantly, how can updates to said > library be easily reflected across all applications? > > For instance, we want to have a single login/logout user capability > between applications, since all of our applications will share the > same userbase. I know restful_authentication exists, but I''m working > on rolling my own as a learning exercise. > > Give a User Model, Session (login/logout) and User (registration/ > activation) Controllers, and an Authentication Module, what is the > best way to share this code set across applications?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
But aren''t plugins packaged with the application? How does that work for updates to the code? On Feb 15, 10:00 pm, willhaslett <will.hasl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Plugins. > > On Feb 15, 8:25 pm, ericindc <ericmilf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I come from a PHP environment where we have a "library" of sorts that > > contains various functionality in the form of object-oriented > > classes. The classes can be tied into any new project and the > > functionality of that class is gained without any duplication of > > coding efforts. > > > In learning Ruby on Rails, I''d like to create something similar for > > use in developing Rails applications. Is there a best practice for > > said "library" of functionality? How best is this code base shared > > between applications? Most importantly, how can updates to said > > library be easily reflected across all applications? > > > For instance, we want to have a single login/logout user capability > > between applications, since all of our applications will share the > > same userbase. I know restful_authentication exists, but I''m working > > on rolling my own as a learning exercise. > > > Give a User Model, Session (login/logout) and User (registration/ > > activation) Controllers, and an Authentication Module, what is the > > best way to share this code set across applications? > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 16 Feb 2009, at 05:56, ericindc wrote:> But aren''t plugins packaged with the application? How does that work > for updates to the code?Plugins as git submodules. Google search will probably reveal more, but this is one I came across just now: http://woss.name/2008/04/09/using-git-submodules-to-track-vendorrails/ Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I second plugins as git submodules. My company has built up a suite of standard plugins we use in apps for various things, and with git submodules it''s easy to cascade updates to those plugins to all the apps that use them. I''ll give you a piece of advice that took me forever to sort out. The two following commands are not equivalent: (Assuming vendor/plugins/my_plugin is the root of your submodule) $ git add vendor/plugins/my_plugin $ git add vendor/plugins/my_plugin/ The trailing slash (often added my tab completion) gives you all sorts of problems with submodules. Beware! ;) Cheers, Darrik On Feb 16, 4:10 am, Peter De Berdt <peter.de.be...-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> On 16 Feb 2009, at 05:56, ericindc wrote: > > > But aren''t plugins packaged with the application? How does that work > > for updates to the code? > > Plugins as git submodules. > > Google search will probably reveal more, but this is one I came across > just now:http://woss.name/2008/04/09/using-git-submodules-to-track-vendorrails/ > > Best regards > > Peter De Berdt--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> But aren''t plugins packaged with the application? How does that work > for updates to the code?even in "the old days" (way back when everyone was still using subversion - must have been at least a year ago) this was possible. today (with git) it''s more or less the same. store your plugin''s code in a repository. inside your application checkout this plugin and everytime you commit any changes to the code in your repository, just update your plugin. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---