Class: DuplicateKeyFinder

Inherits:
LocaleFileWalker show all
Defined in:
lib/i18n/duplicate_key_finder.rb

Instance Method Summary collapse

Instance Method Details

#find_duplicates(path) ⇒ Object



6
7
8
9
10
# File 'lib/i18n/duplicate_key_finder.rb', line 6

def find_duplicates(path)
  @keys_with_count = Hash.new { 0 }
  handle_document(Psych.parse_file(path))
  @keys_with_count.select { |key, count| count > 1 }.keys
end