Is there an easy way to runs things like script/generate and db:migrate from within a controller? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jorg Lueke wrote:> Is there an easy way to runs things like script/generate and > db:migrate from within a controller?no not that I now of... but why would you like to that ? for example if you set up you application for production you only have to call rake db:migrate one time. (if you have set up your migrations as it should be of course :P ) I have never come across a problem that would need to run a shell command. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jorg Lueke wrote:> Is there an easy way to runs things like script/generate and > db:migrate from within a controller? >This will work (at least on Rails 1.2.3): if ENV["OS"] == "Windows_NT" `rake.bat db:migrate` else `rake db:migrate` end --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Norm wrote:> Jorg Lueke wrote: >> Is there an easy way to runs things like script/generate and >> db:migrate from within a controller? >> > This will work (at least on Rails 1.2.3): > if ENV["OS"] == "Windows_NT" > `rake.bat db:migrate` > else > `rake db:migrate` > endO sorry I didn''t now that would work... one question though.... why would you want to run db:migrate in a rails app ? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
jeljer te Wies wrote:> Norm wrote: > >> Jorg Lueke wrote: >> >>> Is there an easy way to runs things like script/generate and >>> db:migrate from within a controller? >>> >>> >> This will work (at least on Rails 1.2.3): >> if ENV["OS"] == "Windows_NT" >> `rake.bat db:migrate` >> else >> `rake db:migrate` >> end >> > > O sorry I didn''t now that would work... > one question though.... why would you want to run db:migrate in a rails > app ?In my case I do it to automatically update my database when the app is run. This is for an app that is a little different from the conventional Rails app. The app is run on the local network and may be installed and maintained by minimally knowledgeable persons. It is easier to do the migration automatically than to explain how and why and when to run it. I have it set up to get the current version and only run the migration if it is needed. --~--~---------~--~----~------------~-------~--~----~ 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 doubt it would be the best way. But if users want to create whole new objects running the script/generate scaffold would instantly generate the CRUD views. But I''m thinking of doing this a bit differently now. Maybe the people define the elements and that definition gets stored while the data is serialized. On Aug 26, 12:25 pm, jeljer te Wies <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Jorg Lueke wrote: > > Is there an easy way to runs things like script/generate and > > db:migrate from within a controller? > > no not that I now of... > but why would you like to that ? > > for example if you set up you application for production you only have > to call rake db:migrate one time. > (if you have set up your migrations as it should be of course :P ) > I have never come across a problem that would need to run a shell > command. > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
This concept won''t work too well in a production environment... On Tue, Aug 26, 2008 at 1:13 PM, Jorg Lueke <jlueke_2000-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> > I doubt it would be the best way. But if users want to create whole > new objects running the script/generate scaffold would instantly > generate the CRUD views. But I''m thinking of doing this a bit > differently now. > > Maybe the people define the elements and that definition gets stored > while the data is serialized. > > On Aug 26, 12:25 pm, jeljer te Wies <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: >> Jorg Lueke wrote: >> > Is there an easy way to runs things like script/generate and >> > db:migrate from within a controller? >> >> no not that I now of... >> but why would you like to that ? >> >> for example if you set up you application for production you only have >> to call rake db:migrate one time. >> (if you have set up your migrations as it should be of course :P ) >> I have never come across a problem that would need to run a shell >> command. >> >> -- >> Posted viahttp://www.ruby-forum.com/. > > >-- Robby Russell Chief Evangelist, Partner PLANET ARGON, LLC design // development // hosting http://www.planetargon.com/ http://www.robbyonrails.com/ aim: planetargon +1 503 445 2457 +1 877 55 ARGON [toll free] +1 815 642 4068 [fax] --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Use the "spawn" plugin and move the execution to a background process. You can use Ruby''s "system" command from the Kernel or the Shell::CommandProcessor http://www.ruby-doc.org/core/ On Aug 26, 9:30 pm, Jorg Lueke <jlueke_2...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> Is there an easy way to runs things like script/generate and > db:migrate from within a controller?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
There doesn''t seem to be a well-working concept for dynamic resource generation and storage as far as I can tell. It may be best to let people define the new forms and use them but then make them permanent for future use once per day. That way users get to be happy that they can create and use somehting instantly, plus the schema can then be updated normally once per unit time. Or is there an elegant solution for dynamically building objects? On Aug 26, 5:02 pm, "Robby Russell" <ro...-/Lcn8Y7Ot69QmPsQ1CNsNQ@public.gmane.org> wrote:> This concept won''t work too well in a production environment... > > > > > > On Tue, Aug 26, 2008 at 1:13 PM, Jorg Lueke <jlueke_2...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: > > > I doubt it would be the best way. But if users want to create whole > > new objects running the script/generate scaffold would instantly > > generate the CRUD views. But I''m thinking of doing this a bit > > differently now. > > > Maybe the people define the elements and that definition gets stored > > while the data is serialized. > > > On Aug 26, 12:25 pm, jeljer te Wies <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > wrote: > >> Jorg Lueke wrote: > >> > Is there an easy way to runs things like script/generate and > >> > db:migrate from within a controller? > > >> no not that I now of... > >> but why would you like to that ? > > >> for example if you set up you application for production you only have > >> to call rake db:migrate one time. > >> (if you have set up your migrations as it should be of course :P ) > >> I have never come across a problem that would need to run a shell > >> command. > > >> -- > >> Posted viahttp://www.ruby-forum.com/. > > -- > Robby Russell > Chief Evangelist, Partner > > PLANET ARGON, LLC > design // development // hosting > > http://www.planetargon.com/http://www.robbyonrails.com/ > aim: planetargon > > +1 503 445 2457 > +1 877 55 ARGON [toll free] > +1 815 642 4068 [fax]- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Worth a peek On Aug 27, 5:33 am, Mukund <marut...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> Use the "spawn" plugin and move the execution to a background > process. You can use Ruby''s "system" command from the Kernel or the > Shell::CommandProcessor > > http://www.ruby-doc.org/core/ > > On Aug 26, 9:30 pm, Jorg Lueke <jlueke_2...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: > > > > > Is there an easy way to runs things like script/generate and > > db:migrate from within a controller?- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---