Skip to content

Instantly share code, notes, and snippets.

@marcus
Created November 11, 2009 22:30
Show Gist options
  • Save marcus/232380 to your computer and use it in GitHub Desktop.
Save marcus/232380 to your computer and use it in GitHub Desktop.
strings = []
directories = Dir['views/**/*']
directories.each do |d|
if d.match(/\.ejs\z/) && !d.match(/help/)
File.open(d) { |file|
file.each do |l|
brackets = l.match(/>([^<]+)</)
brackets.captures.each do |m|
if m.to_s.length > 5
strings.push(m)
end
end if brackets
end
}
end
end
File.open('strings2.txt','w') {|f| f.write(strings.uniq.join("\n")) }
puts strings.uniq
puts "Total #{strings.length}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment