/ Published in: Ruby
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/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('|')))
URL: http://onestepback.org/index.cgi/Tech/Rake/FindInCode.red