util/check.rb in emojidex-vectors-0.1.2 vs util/check.rb in emojidex-vectors-0.1.3

- old
+ new

@@ -16,10 +16,14 @@ emoji_root = File.expand_path('../../emoji/', __FILE__) utf_path = File.expand_path('utf', emoji_root) extended_path = File.expand_path('extended', emoji_root) +category_names = [] +Emojidex::Categories.new.each { |category| category_names << category.code } + + # Check utf = Emojidex::Collection.new utf.load_local_collection utf_path utf_cc = Emojidex::CollectionChecker.new(utf, formats: [:svg]) if utf_cc.asset_only.empty? && utf_cc.index_only.empty? @@ -45,6 +49,16 @@ puts "Asset Only:\n" extended_cc.asset_only.each { |a| puts "[#{a}]\n" } puts "Index Only: \n" extended_cc.index_only.each { |i| puts "[#{i}]\n" } exit 2 +end + + +# Category name check +(all_emoji = utf) << extended +all_emoji.each do |emoji| + unless category_names.include?(emoji.category.to_s) + puts "Contains the wrong category name." + puts emoji["code"] + end end