From: Vincent Ds Date: 2009-01-03T21:37:09+09:00 Subject: Re: require wackyness Rob Biedenharn wrote: > On Jan 2, 2009, at 6:37 PM, Vincent Ds wrote: >> contains >> >> spec/spec_helper.rb: >> >> paths = %w(classes, logic, logic/scrapers) > You almost certainly do not want those commas: > paths = %w( classes logic logic/scrapers) >> >> /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in >> /Users/spobo/Code/movie-crawler/lib/classes and this is included in >> $LOAD_PATH. >> >> What am I missing here? Debugging and figuring out this stuff any >> longer >> and my shiny new laptop will go from 60 to 0 in 0.01 second flat >> against >> the wall. *aaaaaaaar* it's frustrating!! >> -- > > > If you want *all* the directories under lib/ to be in the LOAD_PATH, > you could do: > > Dir['../lib/**/**'].each do |dir| > $LOAD_PATH << File.expand_path(dir) > end > puts $LOAD_PATH > > Then you'd pick up ALL the future directories under lib/, too! > > -Rob > > Rob Biedenharn http://agileconsultingllc.com > Rob@AgileConsultingLLC.com Aha! Rob, Thx! It was indeed the beginner mistake of using the commas where there shouldn't be any. The ways of other programming languages are still blocking my thinking :p The suggestion you made of including every directory under lib... looks good. I'll try it out. Thx for restoring my fait in Ruby :D I knew it had to be me and not Ruby that was playing tricks on me :p -- Posted via http://www.ruby-forum.com/.