Created
November 11, 2009 22:30
-
-
Save marcus/232380 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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