Merge pull request #158 from github/rm-custom-emoji
Remove custom emoji
1
.gitignore
vendored
@@ -1,5 +1,4 @@
|
||||
/bin/*
|
||||
!/bin/gemoji
|
||||
.bundle
|
||||
.ruby-version
|
||||
Gemfile.lock
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](LICENSE).
|
||||
|
||||
This project adheres to the [Open Code of Conduct][code-of-conduct]. By participating, you are expected to uphold this code.
|
||||
[code-of-conduct]: http://todogroup.org/opencodeofconduct/#gemoji/opensource@github.com
|
||||
|
||||
Our emoji set is based off Apple's emoji character palette, plus some custom
|
||||
emoji such as :octocat: :shipit: :metal:.
|
||||
|
||||
Some useful tools in development are:
|
||||
|
||||
```
|
||||
@@ -17,28 +11,11 @@ Sets up the development environment. The prerequisites are:
|
||||
* Ruby 1.9+
|
||||
* Bundler
|
||||
|
||||
```
|
||||
rake db:generate
|
||||
```
|
||||
|
||||
On OS X, this will rebuild the `db/Category-Emoji.json` file from the system
|
||||
one, pulling in any new emoji that Apple may have added in the meantime.
|
||||
|
||||
```
|
||||
script/test
|
||||
```
|
||||
|
||||
Runs the test suite, including the integrity test where we assert that we have
|
||||
covered each of Apple's emoji.
|
||||
|
||||
```
|
||||
script/regenerate
|
||||
```
|
||||
|
||||
Rebuilds the `db/emoji.json` file which is our main list of emoji: their
|
||||
canonical representations, descriptions, aliases, and tags. This requires OS X
|
||||
because Safari is used in the process to verify which character render as emoji
|
||||
and which render as ordinary Unicode glyphs from the current font.
|
||||
Runs the test suite.
|
||||
|
||||
```
|
||||
script/console
|
||||
|
||||
16
LICENSE
@@ -1,18 +1,4 @@
|
||||
octocat, squirrel, shipit
|
||||
Copyright (c) 2013 GitHub Inc. All rights reserved.
|
||||
|
||||
bowtie, neckbeard, fu
|
||||
Copyright (c) 2013 37signals, LLC. All rights reserved.
|
||||
|
||||
feelsgood, finnadie, goberserk, godmode, hurtrealbad, rage 1-4, suspect
|
||||
Copyright (c) 2013 id Software. All rights reserved.
|
||||
|
||||
trollface
|
||||
Copyright (c) 2013 whynne@deviantart. All rights reserved.
|
||||
|
||||
Source code:
|
||||
|
||||
Copyright (c) 2013 GitHub, Inc.
|
||||
Copyright (c) 2019 GitHub, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
|
||||
13
README.md
@@ -1,8 +1,7 @@
|
||||
gemoji
|
||||
======
|
||||
|
||||
This library contains character information about native emoji, as well as image
|
||||
files for a few custom emoji.
|
||||
This library contains character information about native emojis.
|
||||
|
||||
|
||||
Installation
|
||||
@@ -14,16 +13,6 @@ Add `gemoji` to your Gemfile.
|
||||
gem 'gemoji'
|
||||
```
|
||||
|
||||
### Extract images
|
||||
|
||||
``` sh
|
||||
bundle exec gemoji extract public/images/emoji
|
||||
```
|
||||
|
||||
This will extract images into filenames such as:
|
||||
|
||||
* `public/images/emoji/octocat.png`
|
||||
|
||||
|
||||
Example Rails Helper
|
||||
--------------------
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'emoji/cli'
|
||||
|
||||
exit_code = Emoji::CLI.dispatch(ARGV)
|
||||
exit exit_code
|
||||
120
db/emoji.json
@@ -21535,124 +21535,4 @@
|
||||
, "unicode_version": "11.0"
|
||||
, "ios_version": "12.1"
|
||||
}
|
||||
, {
|
||||
"aliases": [
|
||||
"basecamp"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
}
|
||||
, {
|
||||
"aliases": [
|
||||
"basecampy"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
}
|
||||
, {
|
||||
"aliases": [
|
||||
"bowtie"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
}
|
||||
, {
|
||||
"aliases": [
|
||||
"feelsgood"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
}
|
||||
, {
|
||||
"aliases": [
|
||||
"finnadie"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
}
|
||||
, {
|
||||
"aliases": [
|
||||
"goberserk"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
}
|
||||
, {
|
||||
"aliases": [
|
||||
"godmode"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
}
|
||||
, {
|
||||
"aliases": [
|
||||
"hurtrealbad"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
}
|
||||
, {
|
||||
"aliases": [
|
||||
"neckbeard"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
}
|
||||
, {
|
||||
"aliases": [
|
||||
"octocat"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
}
|
||||
, {
|
||||
"aliases": [
|
||||
"rage1"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
}
|
||||
, {
|
||||
"aliases": [
|
||||
"rage2"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
}
|
||||
, {
|
||||
"aliases": [
|
||||
"rage3"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
}
|
||||
, {
|
||||
"aliases": [
|
||||
"rage4"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
}
|
||||
, {
|
||||
"aliases": [
|
||||
"shipit"
|
||||
, "squirrel"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
}
|
||||
, {
|
||||
"aliases": [
|
||||
"suspect"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
}
|
||||
, {
|
||||
"aliases": [
|
||||
"trollface"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -3,7 +3,6 @@ Gem::Specification.new do |s|
|
||||
s.version = "3.0.1"
|
||||
s.summary = "Emoji library"
|
||||
s.description = "Character information and metadata for standard and custom emoji."
|
||||
s.executables = ["gemoji"]
|
||||
|
||||
s.required_ruby_version = '> 1.9'
|
||||
|
||||
@@ -14,8 +13,7 @@ Gem::Specification.new do |s|
|
||||
|
||||
s.files = Dir[
|
||||
"README.md",
|
||||
"bin/gemoji",
|
||||
"images/*.png",
|
||||
"LICENSE",
|
||||
"db/emoji.json",
|
||||
"lib/**/*.rb",
|
||||
]
|
||||
|
||||
|
Before Width: | Height: | Size: 898 B |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
BIN
images/rage1.png
|
Before Width: | Height: | Size: 1.0 KiB |
BIN
images/rage2.png
|
Before Width: | Height: | Size: 1.0 KiB |
BIN
images/rage3.png
|
Before Width: | Height: | Size: 1.1 KiB |
BIN
images/rage4.png
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 1004 B |
|
Before Width: | Height: | Size: 2.7 KiB |
@@ -11,10 +11,6 @@ module Emoji
|
||||
File.expand_path('../../db/emoji.json', __FILE__)
|
||||
end
|
||||
|
||||
def images_path
|
||||
File.expand_path("../../images", __FILE__)
|
||||
end
|
||||
|
||||
def all
|
||||
return @all if defined? @all
|
||||
@all = []
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'fileutils'
|
||||
require 'optparse'
|
||||
|
||||
module Emoji
|
||||
module CLI
|
||||
extend self
|
||||
|
||||
InvalidUsage = Class.new(RuntimeError)
|
||||
|
||||
def dispatch(argv)
|
||||
cmd = argv[0]
|
||||
argv = argv[1..-1]
|
||||
|
||||
case cmd
|
||||
when "extract"
|
||||
public_send(cmd, argv)
|
||||
when "help", "--help", "-h"
|
||||
help
|
||||
else
|
||||
raise InvalidUsage
|
||||
end
|
||||
|
||||
return 0
|
||||
rescue InvalidUsage, OptionParser::InvalidArgument, OptionParser::InvalidOption => err
|
||||
unless err.message == err.class.to_s
|
||||
$stderr.puts err.message
|
||||
$stderr.puts
|
||||
end
|
||||
$stderr.puts usage_text
|
||||
return 1
|
||||
end
|
||||
|
||||
def help
|
||||
puts usage_text
|
||||
end
|
||||
|
||||
def extract(argv)
|
||||
# OptionParser.new do |opts|
|
||||
# opts.on("--size=64", Integer) do |size|
|
||||
# end.parse!(argv)
|
||||
|
||||
raise InvalidUsage unless argv.size == 1
|
||||
path = argv[0]
|
||||
|
||||
Dir["#{Emoji.images_path}/*.png"].each do |png|
|
||||
FileUtils.cp(png, File.join(path, File.basename(png)))
|
||||
end
|
||||
end
|
||||
|
||||
def usage_text
|
||||
<<EOF
|
||||
Usage: gemoji extract <path>
|
||||
EOF
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -8,7 +8,7 @@ class EmojiTest < TestCase
|
||||
end
|
||||
|
||||
test "unicodes set contains the unicodes" do
|
||||
min_size = Emoji.all.reject(&:custom?).size
|
||||
min_size = Emoji.all.size
|
||||
count = Emoji.all.map(&:unicode_aliases).flatten.size
|
||||
assert count > min_size, "there were too few unicode mappings: #{count}"
|
||||
end
|
||||
@@ -112,7 +112,7 @@ class EmojiTest < TestCase
|
||||
end
|
||||
|
||||
test "emoji have category" do
|
||||
missing = Emoji.all.select { |e| !e.custom? && e.category.to_s.empty? }
|
||||
missing = Emoji.all.select { |e| e.category.to_s.empty? }
|
||||
assert_equal [], missing.map(&:name), "some emoji don't have a category"
|
||||
|
||||
emoji = Emoji.find_by_alias('family_man_woman_girl')
|
||||
@@ -133,7 +133,7 @@ class EmojiTest < TestCase
|
||||
end
|
||||
|
||||
test "emoji have description" do
|
||||
missing = Emoji.all.select { |e| !e.custom? && e.description.to_s.empty? }
|
||||
missing = Emoji.all.select { |e| e.description.to_s.empty? }
|
||||
assert_equal [], missing.map(&:name), "some emoji don't have a description"
|
||||
|
||||
emoji = Emoji.find_by_alias('family_man_woman_girl')
|
||||
@@ -146,27 +146,16 @@ class EmojiTest < TestCase
|
||||
end
|
||||
|
||||
test "emoji have iOS version" do
|
||||
missing = Emoji.all.select { |e| !e.custom? && e.ios_version.to_s.empty? }
|
||||
missing = Emoji.all.select { |e| e.ios_version.to_s.empty? }
|
||||
assert_equal [], missing.map(&:name), "some emoji don't have an iOS version"
|
||||
|
||||
emoji = Emoji.find_by_alias('family_man_woman_girl')
|
||||
assert_equal '8.3', emoji.ios_version
|
||||
end
|
||||
|
||||
test "custom emojis" do
|
||||
test "no custom emojis" do
|
||||
custom = Emoji.all.select(&:custom?)
|
||||
assert custom.size > 0
|
||||
|
||||
custom.each do |emoji|
|
||||
assert_nil emoji.raw
|
||||
assert_equal [], emoji.unicode_aliases
|
||||
end
|
||||
end
|
||||
|
||||
test "custom emoji names" do
|
||||
custom_names = Emoji.all.select(&:custom?).map(&:name)
|
||||
assert custom_names.include?("shipit")
|
||||
assert !custom_names.include?("+1")
|
||||
assert 0, custom.size
|
||||
end
|
||||
|
||||
test "create" do
|
||||
|
||||