I''ve developed a file (let''s call it mypdf.rb) which extends the module PDF::Writer with some additional methods. This enables me to produce PDF documents of a very specific nature for a project I am working on. I''ve developed and tested this outside the RoR framework. Now I want to use it within the context of a RoR application. Where should I put the mypdf.rb file, so that I can define objects from the class ? Somewhere within the RoR application framework code ? Or somewhere in the Ruby install tree ? TIA Phil Nelson --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Philip Nelson wrote:> I''ve developed a file (let''s call it mypdf.rb) which extends the module > PDF::Writer with some additional methods. � This enables me to produce > PDF > documents of a very specific nature for a project I am working on. > > I''ve developed and tested this outside the RoR framework. � Now I want > to use > it within the context of a RoR application. > > Where should I put the mypdf.rb file, so that I can define objects from > the > class ? � Somewhere within the RoR application framework code ? � Or > somewhere in the Ruby install tree ? > > TIA > > Phil NelsonPhil You can put your mypdf.rb in <Your_App_Root>/lib and in your code you can do require ''lib/mypdf'' -daya -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On Aug 23, 2006, at 1:44 PM, Philip Nelson wrote:> Where should I put the mypdf.rb file, so that I can define objects > from the > class ? Somewhere within the RoR application framework code ? Or > somewhere in the Ruby install tree ?rails_root/lib -- Chris Wanstrath http://errtheblog.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 -~----------~----~----~----~------~----~------~--~---
On 8/23/06, Daya Sharma <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Phil > > You can put your mypdf.rb in <Your_App_Root>/lib and in your code you > can do > > require ''lib/mypdf'' >I am 95% sure that if you put the class in the root of lib (_not_ in a subdirectory) it will be autoloaded by Rails initializer. So don''t need the explicity require. At least with version 1.1.6. - rob -- http://www.robsanheim.com http://www.seekingalpha.com http://www.ajaxian.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 -~----------~----~----~----~------~----~------~--~---