Hi, I was curious if there was a more appropriate way to execute a "one- time" initialization of a plugin-- Basically, I''ve created a plugin that utilizes a javascript file-- I want to copy this j/s file into the public/javascripts/ directory immediately upon adding it your project. Is there a standard mechanism for doing this? Unless someone has a better idea, my approach was going to be to write code in init.rb that checks to see if these files already exist in the public directory, and if not, to copy them in (from within the plugin directory structure). Anyone got a better idea? -John --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
IIRC, you can have install.rb in your plugin which will be run when someone does script/plugin install But of course, it won''t work if someone just copies the plugin or use piston/svn directly. On 9/17/07, John Trupiano <jtrupiano-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi, > > I was curious if there was a more appropriate way to execute a "one- > time" initialization of a plugin-- > > Basically, I''ve created a plugin that utilizes a javascript file-- I > want to copy this j/s file into the public/javascripts/ directory > immediately upon adding it your project. > > Is there a standard mechanism for doing this? > > Unless someone has a better idea, my approach was going to be to write > code in init.rb that checks to see if these files already exist in the > public directory, and if not, to copy them in (from within the plugin > directory structure). > > Anyone got a better idea? > > -John > > > > >-- Cheers! - Pratik http://m.onkey.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?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks for the response. Yeah, we''re using Piston here to manage our plugins, and that was certainly a concern of mine (no initialization, that is). I guess I could just do both (install.rb and init.rb)! -John On Sep 17, 12:51 pm, Pratik <pratikn...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> IIRC, you can have install.rb in your plugin which will be run when > someone does script/plugin install > > But of course, it won''t work if someone just copies the plugin or use > piston/svn directly. > > On 9/17/07, John Trupiano <jtrupi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > Hi, > > > I was curious if there was a more appropriate way to execute a "one- > > time" initialization of a plugin-- > > > Basically, I''ve created a plugin that utilizes a javascript file-- I > > want to copy this j/s file into the public/javascripts/ directory > > immediately upon adding it your project. > > > Is there a standard mechanism for doing this? > > > Unless someone has a better idea, my approach was going to be to write > > code in init.rb that checks to see if these files already exist in the > > public directory, and if not, to copy them in (from within the plugin > > directory structure). > > > Anyone got a better idea? > > > -John > > -- > Cheers! > - Pratikhttp://m.onkey.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?hl=en -~----------~----~----~----~------~----~------~--~---