To save some typing I''d like to create and run any script in the console window. By ''any script'' I mean non-application related, that is a script that doos not exist within the application structure. This would help in exploring stuff without retyping all the time. Thanks, Mat -- 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 -~----------~----~----~----~------~----~------~--~---
Matthew Andersen wrote:> To save some typing I''d like to create and run any script in the console > window. > By ''any script'' I mean non-application related, that is a script that > doos not exist within the application structure. > This would help in exploring stuff without retyping all the time. > Thanks, > MatLike this? $ cat > test.rb puts ''this is a test'' ^D $ ruby test.rb this is a test $ ? Stephan -- 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 -~----------~----~----~----~------~----~------~--~---
Sorry, I was not too clear in my question. I ment Rails Console, where I''d like to run scripts that have access to the application environment but are NOT existing within the app structure. Say I''d like to try building and testing a Class that does not exist (yet) in my application, or try bits of code to see how things work, without actually modifing any existing application code. So far, I''ve been typing and retyping to explore Rails, but it would be nice to type my tests into a file, so I could build upon my new experience - and re-run the stuff the next time I get back to it. Thanks again, Mat -- 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 -~----------~----~----~----~------~----~------~--~---
Matthew Andersen wrote:> Sorry, I was not too clear in my question. > I ment Rails Console, where I''d like to run scripts that have access > to the application environment but are NOT existing within the app > structure. > > Say I''d like to try building and testing a Class that does not exist > (yet) in my application, or try bits of code to see how things work, > without actually modifing any existing application code. > > So far, I''ve been typing and retyping to explore Rails, but it would be > nice to type my tests into a file, so I could build upon my new > experience - and re-run the stuff the next time I get back to it. > > Thanks again, > MatLike this then? $ script/console>> require ''new_test.rb''=> true>> new_test = NewTest.new(whathaveyou)=> <<What Have You>>>> new_test.run=> true>>Stephan -- 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 -~----------~----~----~----~------~----~------~--~---
Hi -- On Sat, 19 Apr 2008, Matthew Andersen wrote:> > Sorry, I was not too clear in my question. > I ment Rails Console, where I''d like to run scripts that have access > to the application environment but are NOT existing within the app > structure. > > Say I''d like to try building and testing a Class that does not exist > (yet) in my application, or try bits of code to see how things work, > without actually modifing any existing application code. > > So far, I''ve been typing and retyping to explore Rails, but it would be > nice to type my tests into a file, so I could build upon my new > experience - and re-run the stuff the next time I get back to it.You can either load files while you''re in the console, or use script/runner, which will run Ruby scripts in the context of your application''s environment. David -- Rails training from David A. Black and Ruby Power and Light: INTRO TO RAILS June 9-12 Berlin ADVANCING WITH RAILS June 16-19 Berlin INTRO TO RAILS June 24-27 London (Skills Matter) See http://www.rubypal.com for details and updates! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---