diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-02-16 07:40:32 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-02-16 07:41:44 +0300 |
commit | bbdf05993bf192840d64d843851f27216c864624 (patch) | |
tree | 169e2abc348e769948d4f833d63d4fe191d1d1ee /fixtures/emojis/generate_aliases.rb | |
parent | 262286936ac0dee98182d4dc904224afd1ab08a7 (diff) |
Update fixtures/emojis/aliases.json
Also adds a script to re-generate them from the index.
Diffstat (limited to 'fixtures/emojis/generate_aliases.rb')
-rwxr-xr-x | fixtures/emojis/generate_aliases.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fixtures/emojis/generate_aliases.rb b/fixtures/emojis/generate_aliases.rb new file mode 100755 index 00000000000..8838fb9a3af --- /dev/null +++ b/fixtures/emojis/generate_aliases.rb @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby + +require 'json' + +aliases = {} + +index_file = File.expand_path("./index.json") +index = JSON.parse(File.read(index_file)) + +index.each_pair do |key, data| + data['aliases'].each do |a| + a.tr!(':', '') + + aliases[a] = key + end +end + +puts JSON.pretty_generate(aliases, indent: ' ', space: '', space_before: '') |