colorful rat Ratfactor.com > Dave's Repos

faceclick

A lightweight Emoji picker popup library with labels and keyword search.
git clone http://ratfactor.com/repos/faceclick/faceclick.git

faceclick/data/check_dupe_labels.rb

Download raw file: data/check_dupe_labels.rb

1 # This script just checks if there are any labels that get used 2 # more than once. I don't think so, but I want to be sure. 3 4 require 'json' 5 json_in = ARGF.read 6 list = JSON.parse(json_in) 7 8 uniq_tags = {} 9 has_dupes = false 10 11 list.each do |emoj| 12 if uniq_tags.key?(emoj['label']) 13 puts "Duplicate: #{emoj['label']}" 14 has_dupes = true 15 end 16 uniq_tags[emoj['label']] = true 17 end 18 19 if has_dupes 20 puts "Duplicates found!" 21 else 22 puts "No duplicates found." 23 end