Skip to content

Commit

Permalink
Bit friendlier way to find unused classes(ignoring comments)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulTaykalo committed Oct 1, 2018
1 parent 6a11e98 commit 0445422
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unused.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0445422

Please sign in to comment.