#!/usr/bin/ruby # find /Applications/Xcode.app/Contents/Developer/Platforms -name '*.h' | ruby find_long_names.rb > names.txt names = [] STDIN.each_line do |line| path = line.strip begin File.open(path, "r") do |file| file.each_line do |fline| fline.strip.scan(/\w{40,}/) do |name| names << [name, path] end end end rescue Exception # ignore end end names.sort_by { |n| [n.first.length, n.last] }.uniq.reverse.each do |name, path| puts "#{name.length}\t#{name}\t\t#{path}" end