summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2019-03-07 09:33:03 +0000
committerPhil Hughes <me@iamphill.com>2019-03-07 09:33:03 +0000
commitd07919de90e8212673adb47a4e60514c2573f2ce (patch)
treea45262773f31061182db9fe39700fea726b6cfc2 /lib/tasks
parentb7998f60f63a4b85db7b835ef152a9042db5e791 (diff)
downloadgitlab-ce-d07919de90e8212673adb47a4e60514c2573f2ce.tar.gz
Moved all emojis to the public folder
Created new emojis map in public folder Renamed folder to emojis Loading now the emojis from Localstorage or from Server Moved all emojis to the public folder Loading the emojis.json file now through AJAX Loads now the map in the web element instead when building the emoji tag Updated the custom Element Setup to modern method Fixed Emoji Karma Specs for async loading Loading now the emojis from Localstorage or from Server Loads now the map in the web element instead when building the emoji tag Fixed problem with FIXTURE_PATH for emojis fixtures Fixes Linting Error in gemojione.rake Fixed Emoji Karma Specs Fix static type check in gemojione and check if already registered Testing if the Emoji Support Check is failing Rspec Change of CLass Name, returning true on check to test Fixes failing Emoji RSpec Tests Moved Emojis into public/-/emojis/1/ Fixed Linting Errors in gl_emoji Fix to fixtures creation for emojis Fixed path spec for new subdirectory -/emojis Optimized emojis.json output Fix for Emoji Spec failure due to unicode dataset Better catch handling for emojis
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/gemojione.rake15
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/tasks/gemojione.rake b/lib/tasks/gemojione.rake
index 560a52053d8..c24207b134a 100644
--- a/lib/tasks/gemojione.rake
+++ b/lib/tasks/gemojione.rake
@@ -30,33 +30,28 @@ namespace :gemojione do
# We don't have `node_modules` available in built versions of GitLab
FileUtils.cp_r(Rails.root.join('node_modules', 'emoji-unicode-version', 'emoji-unicode-version-map.json'), File.join(Rails.root, 'fixtures', 'emojis'))
- dir = Gemojione.images_path
resultant_emoji_map = {}
Gitlab::Emoji.emojis.each do |name, emoji_hash|
# Ignore aliases
unless Gitlab::Emoji.emojis_aliases.key?(name)
- fpath = File.join(dir, "#{emoji_hash['unicode']}.png")
- hash_digest = Digest::SHA256.file(fpath).hexdigest
-
category = emoji_hash['category']
if name == 'gay_pride_flag'
category = 'flags'
end
entry = {
- category: category,
- moji: emoji_hash['moji'],
- description: emoji_hash['description'],
- unicodeVersion: Gitlab::Emoji.emoji_unicode_version(name),
- digest: hash_digest
+ c: category,
+ e: emoji_hash['moji'],
+ d: emoji_hash['description'],
+ u: Gitlab::Emoji.emoji_unicode_version(name)
}
resultant_emoji_map[name] = entry
end
end
- out = File.join(Rails.root, 'fixtures', 'emojis', 'digests.json')
+ out = File.join(Rails.root, 'public', '-', 'emojis', '1', 'emojis.json')
File.open(out, 'w') do |handle|
handle.write(JSON.pretty_generate(resultant_emoji_map))
end