Last active
August 3, 2016 23:53
-
-
Save michaelfeathers/30ed70ef5fd541b3cb90a8768d996340 to your computer and use it in GitHub Desktop.
This file contains 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
# http://c2.com/doc/SignatureSurvey/ | |
require 'find' | |
def file_text file_name | |
IO.read(file_name).scan(/[{};]/).join | |
rescue | |
"error in file" | |
end | |
puts Find.find(File.expand_path(ARGV[0] || ".")) | |
.grep(/\.[ch]$/) | |
.map {|fn| "#{fn}:\n#{file_text(fn)}\n" } | |
.join($/) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment