Posted By

bbuckley on 08/28/06


Tagged

rails ruby rake


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

webstic


Using Rake as a Library


 / Published in: Ruby
 

URL: http://onestepback.org/index.cgi/Tech/Rake/FindInCode.red

  1. #!/usr/bin/env ruby # -*- ruby -*- exts = ['.rb'] if ARGV[0] =~ /^\.[a-zA-Z0-9]+$/ exts = [] while ARGV[0] =~ /^\.[a-zA-Z0-9]+$/ exts << ARGV.shift end end ext = "{" + exts.join(',') + "}" if ARGV.size < 1 puts "Usage: #{File.basename($0)} [.ext ...] pattern ..." exit 1 end require 'rake' FileList["**/*#{ext}"].egrep(Regexp.new(ARGV.join('|')))

Report this snippet  

You need to login to post a comment.