Skip to content

Instantly share code, notes, and snippets.

@michaelfeathers
Last active August 3, 2016 23:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelfeathers/30ed70ef5fd541b3cb90a8768d996340 to your computer and use it in GitHub Desktop.
Save michaelfeathers/30ed70ef5fd541b3cb90a8768d996340 to your computer and use it in GitHub Desktop.
# 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