From: "Jesús Gabriel y Galán" Date: 2010-10-29T02:07:39+09:00 Subject: Re: undefined method `find' for.:Module On Thu, Oct 28, 2010 at 7:00 PM, John Hammink wrote: > Hi, good explantion -and thanks! - almost - but please show me how my > script must actually look - as changed via your suggestion - to get it > to work properly. > > I don't understand a thing about load paths and what that does either. > As I'm using windows CMD a Unix command won't help. > > Last thing:  your suggestion > > require './Froop' > > Throws and error: > > irb(main):003:0> require './Froop' > NoMethodError: undefined method `find' for Froop:Module >        from E:/Sounds/Digital/Froop.rb:6:in `match' >        from E:/Sounds/Digital/Froop.rb:12:in `' >        from :29:in `require' >        from :29:in `require' >        from (irb):3 >        from C:/Ruby192/bin/irb:12:in `
' > > So I'm still stuck at the beginning :( I did it when I pasted the code in my previous answer: require 'find' module Froop def match(*paths) matched=[] # I changed this line adding "Find." in front: Find.find(*paths) { |path| matched << path if yield path } return matched end module_function :match end Froop.match("./") { |p| ext = p[-4...p.size]; ext && ext.downcase == "mp3" } Jesus.