MohsinHijazee
2008-Feb-12 10:13 UTC
$:.unshift File.join(File.dirname(__FILE__),''..'',''lib'')?
What this code lines mean? Especially $:. before the unshift? $:.unshift File.join(File.dirname(__FILE__),''..'',''lib'') Regards, Mohsin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thorsten Mueller
2008-Feb-12 10:32 UTC
Re: $:.unshift File.join(File.dirname(__FILE__),''..'',''lib'')?
MohsinHijazee wrote:> What this code lines mean? Especially $:. before the unshift? > > $:.unshift File.join(File.dirname(__FILE__),''..'',''lib'') > > Regards, > Mohsinruby comes with a set of predefined variables $: = default search path (array of paths) __FILE__ = current sourcefile if i get it right (not 100% sure) this adds the lib path to this array of search paths by going over the current file. which is not exactly the best way, i would simply start with RAILS_ROOT (at least for a rails project) -- 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 -~----------~----~----~----~------~----~------~--~---