Skip to content

Commit

Permalink
Revert "Update support for Emoji 4.0 (Unicode 9.0)"
Browse files Browse the repository at this point in the history
  • Loading branch information
ticky authored May 24, 2017
1 parent f432dc3 commit ea69f6b
Show file tree
Hide file tree
Showing 2,129 changed files with 1,074 additions and 6,868 deletions.
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

809 changes: 24 additions & 785 deletions README.md

Large diffs are not rendered by default.

39 changes: 8 additions & 31 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
require 'json'
require 'fileutils'

# Generates a table to be copy and pasted into the readme when emojis are updated
#
# To run via Docker:
#
# docker run -it --rm -v "$(pwd)":/src ruby bash -c "cd /src && bundle install && rake"

require 'json'

desc "Pick a random emoji"
task :random do
emojis = []

emojis_dir = __dir__
emojis_dir = File.dirname(__FILE__)
Dir.glob("#{emojis_dir}/img-*.json").each do |catalogue|
emojis.concat JSON.parse(File.read(catalogue)).reverse
end
Expand All @@ -19,7 +20,6 @@ task :random do
puts ":#{emoj['name']}:"
end

desc "Generate a table to be copy and pasted into the readme when emojis are updated"
task :default do
emojis = []

Expand Down Expand Up @@ -73,7 +73,8 @@ task :default do
end
end

def preprocess_emoji_json(parsed)
task :generate do
parsed = JSON.parse(File.read(ENV.fetch("EMOJI_JSON")))
new = []

parsed.each do |e|
Expand Down Expand Up @@ -109,29 +110,5 @@ def preprocess_emoji_json(parsed)
}
end

JSON.pretty_generate(new)
end

desc "Generate and show processed emoji data file"
task :generate do
parsed = JSON.parse(File.read(ENV.fetch("EMOJI_JSON")))
puts preprocess_emoji_json(parsed)
end

desc "Synchronise emoji data and images"
task :sync do
puts 'Synchronising Unicode emoji images...'
FileUtils.cp(
Dir["#{__dir__}/node_modules/emoji-datasource-apple/img/apple/64/*.png"],
"#{__dir__}/img-apple-64"
)

puts 'Synchronising Unicode emoji metadata...'
unicode_emoji_catalogue = JSON.parse(File.read("#{__dir__}/node_modules/emoji-datasource-apple/emoji.json"))
File.write(
"#{__dir__}/img-apple-64.json",
preprocess_emoji_json(unicode_emoji_catalogue)
)

puts 'Done!'
puts JSON.pretty_generate(new)
end
Loading

0 comments on commit ea69f6b

Please sign in to comment.