Skip to content

Instantly share code, notes, and snippets.

@snowe2010
Created December 4, 2012 05:18
Show Gist options
  • Save snowe2010/4200882 to your computer and use it in GitHub Desktop.
Save snowe2010/4200882 to your computer and use it in GitHub Desktop.
Cleans the whitespace and comments from the file and returns them to a clean array
@read_file.lines.to_a.each {|line| @whitespace_clean << line.gsub(/\/\/.*?$|\/\*.*?\*\/|\t\m|\*.*$|\/\*\*.*$/,"").strip}
@snowe2010
Copy link
Author

Had to edit it a bit because it wasn't grabbing lines like /** blah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment