diff --git a/unused.rb b/unused.rb index 1db641b..85ea8f7 100755 --- a/unused.rb +++ b/unused.rb @@ -124,7 +124,7 @@ def find_usages_in_files(files, xibs, items_in) items = items_in usages = items.map { |f| 0 } files.each { |file| - lines = File.readlines(file).map {|line| line.gsub(/^\s*\/\/.*/, "") } + lines = File.readlines(file).map {|line| line.gsub(/^[^\/]*\/\/.*/, "") } words = lines.join("\n").split(/\W+/) words_arrray = words.group_by { |w| w }.map { |w, ws| [w, ws.length] }.flatten