diff --git a/unused.rb b/unused.rb index 579f2c2..913c9dc 100755 --- a/unused.rb +++ b/unused.rb @@ -125,7 +125,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(/^[^\/]*\/\/.*/, "") } + lines = File.readlines(file).map {|line| line.gsub(/^([^\/]*)\/\/.*/, '\1') } words = lines.join("\n").split(/\W+/) words_arrray = words.group_by { |w| w }.map { |w, ws| [w, ws.length] }.flatten