diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /lib/tasks/gemojione.rake | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) | |
download | gitlab-ce-8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781.tar.gz |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'lib/tasks/gemojione.rake')
-rw-r--r-- | lib/tasks/gemojione.rake | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/tasks/gemojione.rake b/lib/tasks/gemojione.rake index 3833689e07e..85393bba9a6 100644 --- a/lib/tasks/gemojione.rake +++ b/lib/tasks/gemojione.rake @@ -32,6 +32,7 @@ namespace :gemojione do dir = Gemojione.images_path resultant_emoji_map = {} + resultant_emoji_map_new = {} Gitlab::Emoji.emojis.each do |name, emoji_hash| # Ignore aliases @@ -53,6 +54,16 @@ namespace :gemojione do } resultant_emoji_map[name] = entry + + # Our new map is only characters to make the json substantially smaller + new_entry = { + c: category, + e: emoji_hash['moji'], + d: emoji_hash['description'], + u: Gitlab::Emoji.emoji_unicode_version(name) + } + + resultant_emoji_map_new[name] = new_entry end end @@ -60,6 +71,11 @@ namespace :gemojione do File.open(out, 'w') do |handle| handle.write(Gitlab::Json.pretty_generate(resultant_emoji_map)) end + + out_new = File.join(Rails.root, 'public', '-', 'emojis', '1', 'emojis.json') + File.open(out_new, 'w') do |handle| + handle.write(Gitlab::Json.pretty_generate(resultant_emoji_map_new)) + end end # This task will generate a standard and Retina sprite of all of the current |