Can someone help me understand the difference(s) between a Gem and a plugin? Thanks, Bill --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bill Walton wrote:> Can someone help me understand the difference(s) between a Gem and a plugin? > > Thanks, > BillA gem is a library of ruby code that can add some specific functionality. You need to ''require'' them to use them in your rails project. They do not depend on Rails for functionality. A plugin is a bit of code that is loaded by the rails framework when it starts up that is typically used to add or modify core functionality of rails. Plugins require Rails to function. If you have a bit of code that you want to release, it might be better as a gem if it is generally useful to everyone using Ruby or you might prefer to package it as a plugin if it really only applies to Rails applications. _Kevin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks, Kevin. That helps. Would it be safe (i.e., not 100%, but not too inaccurate) to say something like " Gems extend the functionality, in addition to Rails, that''s available to all your Rails apps, while Plugins allow Rails to provide additional functionality to a specific Rails app." Best regards, Bill ----- Original Message ----- From: "_Kevin" <kevin.olbrich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> To: "Ruby on Rails: Talk" <rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Sent: Wednesday, October 25, 2006 6:56 AM Subject: [Rails] Re: Gem vs. plugin> > > Bill Walton wrote: >> Can someone help me understand the difference(s) between a Gem and a >> plugin? >> >> Thanks, >> Bill > > A gem is a library of ruby code that can add some specific > functionality. You need to ''require'' them to use them in your rails > project. They do not depend on Rails for functionality. > > A plugin is a bit of code that is loaded by the rails framework when it > starts up that is typically used to add or modify core functionality of > rails. Plugins require Rails to function. > > If you have a bit of code that you want to release, it might be better > as a gem if it is generally useful to everyone using Ruby or you might > prefer to package it as a plugin if it really only applies to Rails > applications. > > _Kevin > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bill Walton wrote:> Thanks, Kevin. That helps. Would it be safe (i.e., not 100%, but not too > inaccurate) to say something like " > > Gems extend the functionality, in addition to Rails, that''s available to all > your Rails apps, while Plugins allow Rails to provide additional > functionality to a specific Rails app." > > Best regards, > Bill > > > ----- Original Message ----- > From: "_Kevin" <kevin.olbrich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > To: "Ruby on Rails: Talk" <rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > Sent: Wednesday, October 25, 2006 6:56 AM > Subject: [Rails] Re: Gem vs. plugin > > > > > > > > Bill Walton wrote: > >> Can someone help me understand the difference(s) between a Gem and a > >> plugin? > >> > >> Thanks, > >> Bill > > > > A gem is a library of ruby code that can add some specific > > functionality. You need to ''require'' them to use them in your rails > > project. They do not depend on Rails for functionality. > > > > A plugin is a bit of code that is loaded by the rails framework when it > > starts up that is typically used to add or modify core functionality of > > rails. Plugins require Rails to function. > > > > If you have a bit of code that you want to release, it might be better > > as a gem if it is generally useful to everyone using Ruby or you might > > prefer to package it as a plugin if it really only applies to Rails > > applications. > > > > _Kevin > > > > > > > > >No, because you have to load gems manually anyway. It would be better to say that Gems extend the functionality of Ruby, while plugins extend the functionality of Rails. _Kevin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Kevin wrote:> It would be better to say that Gems extend the > functionality of Ruby, while plugins extend the > functionality of Rails.I like that. Thanks! Bill --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''m still not clear. What was the Rails team''s rationale for thinking up and adopting the plugin scheme (a special code packaging technique just for Rails'' apps). What does that buy us over having extension writers package their code as gems? Brian On 10/25/06, Bill Walton <bill.walton-xwVYE8SWAR3R7s880joybQ@public.gmane.org> wrote:> > Kevin wrote: > > > It would be better to say that Gems extend the > > functionality of Ruby, while plugins extend the > > functionality of Rails. > > I like that. Thanks! > > Bill > > > >-- Brian K. Buckley briankbuckley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Kevin''s association of gems with ruby and plugins with rails is pretty accurate. Plugins serve a slightly different and more specific purpose than gems, including a hook (init.rb) which allows a plugin to do any initialisation at a controlled point while Rails is loaded. Beyond install.rb, they are really simple, and don''t require any packaging to distribute. It''s also trivial to distribute them within a Rails application. Gems are typically installed on a system-wide basis, requiring another control mechanism to determine which gem''d plugins might get loaded for any particular Rails application. What might using gems gain us? Well, possibly dependencies, but not much more. The current plugin implementation is simple, focussed, and most importantly is entirely under the control of the Rails team, so it can be extended in ways which suit the future direction of the framework without any issues. On 10/25/06, Brian Buckley <briankbuckley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I''m still not clear. What was the Rails team''s rationale for thinking > up and adopting the plugin scheme (a special code packaging technique > just for Rails'' apps). What does that buy us over having extension > writers package their code as gems? > > Brian > > > On 10/25/06, Bill Walton <bill.walton-xwVYE8SWAR3R7s880joybQ@public.gmane.org> wrote: > > > > Kevin wrote: > > > > > It would be better to say that Gems extend the > > > functionality of Ruby, while plugins extend the > > > functionality of Rails. > > > > I like that. Thanks! > > > > Bill > > > > > > > > > > -- > Brian K. Buckley > briankbuckley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > > >-- * J * ~ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---