Over a million developers have joined DZone.

A Simple Util For Hacking Rails On Windows

·
This a simple redish util, that i'm using while hacking my way through rails libs directory. (*nix guys has their natural power tools)

found_files = Dir.glob( ARGV[0] + "/**/*.rb")
serach_pattern = Regexp.new( ARGV[1] )
for entry in found_files
  file = File.new(entry,"r")
  line_count=0
  file.readlines.each { |line|
	line_count+=1
	puts "#{entry}[#{line_count}]:#{line}" if serach_pattern.match(line)
  }
end
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}