8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/gemojione/index_importer.rb', line 8
def import_from_emojione
count = 0
mojis.each do |array|
unicode = array[0].upcase
hash = array[1]
unless index.find_by_unicode(unicode)
count += 1
add_moji(
hash['shortname'].gsub(':', ''),
unicode,
hash['name'],
hash['category'],
hash['code_points']['fully_qualified'].split('-').map { |u| u.downcase.to_i(16) }.pack('U*'),
hash['shortname_alternates']
)
end
end
puts "Added #{count} emojis to the index"
end
|