debian-mirror-gitlab/fixtures/emojis/generate_aliases.rb

19 lines
332 B
Ruby
Raw Normal View History

2016-04-02 18:10:28 +05:30
#!/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: '')