Skip to content
代码片段 群组 项目
提交 1d1ca8b9 编辑于 作者: Arinde Eniola's avatar Arinde Eniola
浏览文件

fix emoji aliases not showing in autocomplete

上级 26f51bb0
No related branches found
No related tags found
无相关合并请求
此差异已折叠。
......@@ -5,12 +5,23 @@ namespace :gemojione do
require 'json'
dir = Gemojione.index.images_path
digests = []
aliases = Hash.new { |hash, key| hash[key] = [] }
aliases_path = File.join(Rails.root, 'fixtures', 'emojis', 'aliases.json')
digests = AwardEmoji.emojis.map do |name, emoji_hash|
JSON.parse(File.read(aliases_path)).each do |alias_name, real_name|
aliases[real_name] << alias_name
end
AwardEmoji.emojis.map do |name, emoji_hash|
fpath = File.join(dir, "#{emoji_hash['unicode']}.png")
digest = Digest::SHA256.file(fpath).hexdigest
{ name: name, unicode: emoji_hash['unicode'], digest: digest }
digests << { name: name, unicode: emoji_hash['unicode'], digest: digest }
aliases[name].each do |alias_name|
digests << { name: alias_name, unicode: emoji_hash['unicode'], digest: digest }
end
end
out = File.join(Rails.root, 'fixtures', 'emojis', 'digests.json')
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册