Compare commits
29 Commits
v4.0.0.rc2
...
v4.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac35c33c44 | ||
|
|
70eb18cf81 | ||
|
|
d04fd7701e | ||
|
|
744495f776 | ||
|
|
ea4d73899a | ||
|
|
d7ca116556 | ||
|
|
f7a6bb68c0 | ||
|
|
a8d55fd539 | ||
|
|
5f3415f5fe | ||
|
|
9917299963 | ||
|
|
e13ac61ebd | ||
|
|
6af51fcecd | ||
|
|
a166a06499 | ||
|
|
44c22eac93 | ||
|
|
1c3519c6bb | ||
|
|
55bb37afa4 | ||
|
|
64cd0e9ccf | ||
|
|
0f2f9ce047 | ||
|
|
b1c7878afe | ||
|
|
ce6c4ab12a | ||
|
|
4c47a26900 | ||
|
|
2a97e7e98c | ||
|
|
f6fa963350 | ||
|
|
2eb30abcd1 | ||
|
|
59ef859169 | ||
|
|
be99618db3 | ||
|
|
3675a8781f | ||
|
|
7f6550fe73 | ||
|
|
a5865153a2 |
24
.github/workflows/test.yml
vendored
Normal file
24
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
name: Test
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
ruby: ["2.7", "3.0", "3.1"]
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{matrix.ruby}}
|
||||
bundler-cache: true
|
||||
|
||||
- name: Run tests
|
||||
run: bundle exec rake
|
||||
12
.travis.yml
12
.travis.yml
@@ -1,12 +0,0 @@
|
||||
sudo: false
|
||||
script: script/test
|
||||
rvm:
|
||||
- 1.9.3
|
||||
- '2.1'
|
||||
- '2.2'
|
||||
- '2.3'
|
||||
- '2.4'
|
||||
- '2.5'
|
||||
- '2.6'
|
||||
notifications:
|
||||
email: false
|
||||
1
Gemfile
1
Gemfile
@@ -2,5 +2,6 @@ source "https://rubygems.org"
|
||||
|
||||
gem "rake", "~> 10.3.2"
|
||||
gem "minitest", "~> 5.3.5"
|
||||
gem "i18n", "~> 1.8.5"
|
||||
|
||||
gemspec
|
||||
|
||||
25
Gemfile.lock
Normal file
25
Gemfile.lock
Normal file
@@ -0,0 +1,25 @@
|
||||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
gemoji (4.0.0)
|
||||
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
concurrent-ruby (1.1.7)
|
||||
i18n (1.8.5)
|
||||
concurrent-ruby (~> 1.0)
|
||||
minitest (5.3.5)
|
||||
rake (10.3.2)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
gemoji!
|
||||
i18n (~> 1.8.5)
|
||||
minitest (~> 5.3.5)
|
||||
rake (~> 10.3.2)
|
||||
|
||||
BUNDLED WITH
|
||||
2.0.2
|
||||
2
Rakefile
2
Rakefile
@@ -20,5 +20,5 @@ namespace :db do
|
||||
end
|
||||
|
||||
file 'vendor/unicode-emoji-test.txt' do |t|
|
||||
system 'curl', '-fsSL', 'http://unicode.org/Public/emoji/13.0/emoji-test.txt', '-o', t.name
|
||||
system 'curl', '-fsSL', 'http://unicode.org/Public/emoji/14.0/emoji-test.txt', '-o', t.name
|
||||
end
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "i18n"
|
||||
require 'emoji'
|
||||
require 'json'
|
||||
require_relative './emoji-test-parser'
|
||||
|
||||
I18n.config.available_locales = :en
|
||||
items = []
|
||||
|
||||
_, categories = EmojiTestParser.parse(File.expand_path("../../vendor/unicode-emoji-test.txt", __FILE__))
|
||||
@@ -34,10 +36,10 @@ for category in categories
|
||||
)
|
||||
else
|
||||
output_item.update(
|
||||
aliases: [description.gsub(/\W+/, '_').downcase],
|
||||
aliases: [I18n.transliterate(description).gsub(/\W+/, '_').downcase],
|
||||
tags: [],
|
||||
unicode_version: "13.0",
|
||||
ios_version: "14.0",
|
||||
unicode_version: "14.0",
|
||||
ios_version: "15.4",
|
||||
)
|
||||
end
|
||||
output_item[:skin_tones] = true if emoji_item[:skin_tones]
|
||||
|
||||
591
db/emoji.json
591
db/emoji.json
@@ -135,6 +135,20 @@
|
||||
, "unicode_version": "8.0"
|
||||
, "ios_version": "9.1"
|
||||
}
|
||||
, {
|
||||
"emoji": "🫠"
|
||||
, "description": "melting face"
|
||||
, "category": "Smileys & Emotion"
|
||||
, "aliases": [
|
||||
"melting_face"
|
||||
]
|
||||
, "tags": [
|
||||
"sarcasm"
|
||||
, "dread"
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "😉"
|
||||
, "description": "winking face"
|
||||
@@ -371,7 +385,7 @@
|
||||
}
|
||||
, {
|
||||
"emoji": "🤗"
|
||||
, "description": "hugging face"
|
||||
, "description": "smiling face with open hands"
|
||||
, "category": "Smileys & Emotion"
|
||||
, "aliases": [
|
||||
"hugs"
|
||||
@@ -395,6 +409,32 @@
|
||||
, "unicode_version": "11.0"
|
||||
, "ios_version": "12.1"
|
||||
}
|
||||
, {
|
||||
"emoji": "🫢"
|
||||
, "description": "face with open eyes and hand over mouth"
|
||||
, "category": "Smileys & Emotion"
|
||||
, "aliases": [
|
||||
"face_with_open_eyes_and_hand_over_mouth"
|
||||
]
|
||||
, "tags": [
|
||||
"gasp"
|
||||
, "shock"
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "🫣"
|
||||
, "description": "face with peeking eye"
|
||||
, "category": "Smileys & Emotion"
|
||||
, "aliases": [
|
||||
"face_with_peeking_eye"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "🤫"
|
||||
, "description": "shushing face"
|
||||
@@ -421,6 +461,19 @@
|
||||
, "unicode_version": "8.0"
|
||||
, "ios_version": "9.1"
|
||||
}
|
||||
, {
|
||||
"emoji": "🫡"
|
||||
, "description": "saluting face"
|
||||
, "category": "Smileys & Emotion"
|
||||
, "aliases": [
|
||||
"saluting_face"
|
||||
]
|
||||
, "tags": [
|
||||
"respect"
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "🤐"
|
||||
, "description": "zipper-mouth face"
|
||||
@@ -487,6 +540,31 @@
|
||||
, "unicode_version": "6.0"
|
||||
, "ios_version": "6.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "🫥"
|
||||
, "description": "dotted line face"
|
||||
, "category": "Smileys & Emotion"
|
||||
, "aliases": [
|
||||
"dotted_line_face"
|
||||
]
|
||||
, "tags": [
|
||||
"invisible"
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "😶🌫️"
|
||||
, "description": "face in clouds"
|
||||
, "category": "Smileys & Emotion"
|
||||
, "aliases": [
|
||||
"face_in_clouds"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "13.1"
|
||||
, "ios_version": "14.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "😏"
|
||||
, "description": "smirking face"
|
||||
@@ -537,6 +615,18 @@
|
||||
, "unicode_version": "6.1"
|
||||
, "ios_version": "6.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "😮💨"
|
||||
, "description": "face exhaling"
|
||||
, "category": "Smileys & Emotion"
|
||||
, "aliases": [
|
||||
"face_exhaling"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "13.1"
|
||||
, "ios_version": "14.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "🤥"
|
||||
, "description": "lying face"
|
||||
@@ -739,7 +829,7 @@
|
||||
}
|
||||
, {
|
||||
"emoji": "😵"
|
||||
, "description": "dizzy face"
|
||||
, "description": "face with crossed-out eyes"
|
||||
, "category": "Smileys & Emotion"
|
||||
, "aliases": [
|
||||
"dizzy_face"
|
||||
@@ -749,6 +839,18 @@
|
||||
, "unicode_version": "6.0"
|
||||
, "ios_version": "6.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "😵💫"
|
||||
, "description": "face with spiral eyes"
|
||||
, "category": "Smileys & Emotion"
|
||||
, "aliases": [
|
||||
"face_with_spiral_eyes"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "13.1"
|
||||
, "ios_version": "14.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "🤯"
|
||||
, "description": "exploding head"
|
||||
@@ -852,6 +954,19 @@
|
||||
, "unicode_version": "6.1"
|
||||
, "ios_version": "6.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "🫤"
|
||||
, "description": "face with diagonal mouth"
|
||||
, "category": "Smileys & Emotion"
|
||||
, "aliases": [
|
||||
"face_with_diagonal_mouth"
|
||||
]
|
||||
, "tags": [
|
||||
"confused"
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "😟"
|
||||
, "description": "worried face"
|
||||
@@ -958,6 +1073,20 @@
|
||||
, "unicode_version": "11.0"
|
||||
, "ios_version": "12.1"
|
||||
}
|
||||
, {
|
||||
"emoji": "🥹"
|
||||
, "description": "face holding back tears"
|
||||
, "category": "Smileys & Emotion"
|
||||
, "aliases": [
|
||||
"face_holding_back_tears"
|
||||
]
|
||||
, "tags": [
|
||||
"tears"
|
||||
, "gratitude"
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "😦"
|
||||
, "description": "frowning face with open mouth"
|
||||
@@ -1681,6 +1810,30 @@
|
||||
, "unicode_version": "6.0"
|
||||
, "ios_version": "6.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "❤️🔥"
|
||||
, "description": "heart on fire"
|
||||
, "category": "Smileys & Emotion"
|
||||
, "aliases": [
|
||||
"heart_on_fire"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "13.1"
|
||||
, "ios_version": "14.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "❤️🩹"
|
||||
, "description": "mending heart"
|
||||
, "category": "Smileys & Emotion"
|
||||
, "aliases": [
|
||||
"mending_heart"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "13.1"
|
||||
, "ios_version": "14.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "❤️"
|
||||
, "description": "red heart"
|
||||
@@ -2044,6 +2197,58 @@
|
||||
, "ios_version": "8.3"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "🫱"
|
||||
, "description": "rightwards hand"
|
||||
, "category": "People & Body"
|
||||
, "aliases": [
|
||||
"rightwards_hand"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "🫲"
|
||||
, "description": "leftwards hand"
|
||||
, "category": "People & Body"
|
||||
, "aliases": [
|
||||
"leftwards_hand"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "🫳"
|
||||
, "description": "palm down hand"
|
||||
, "category": "People & Body"
|
||||
, "aliases": [
|
||||
"palm_down_hand"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "🫴"
|
||||
, "description": "palm up hand"
|
||||
, "category": "People & Body"
|
||||
, "aliases": [
|
||||
"palm_up_hand"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "👌"
|
||||
, "description": "OK hand"
|
||||
@@ -2113,6 +2318,19 @@
|
||||
, "ios_version": "10.2"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "🫰"
|
||||
, "description": "hand with index finger and thumb crossed"
|
||||
, "category": "People & Body"
|
||||
, "aliases": [
|
||||
"hand_with_index_finger_and_thumb_crossed"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "🤟"
|
||||
, "description": "love-you gesture"
|
||||
@@ -2231,6 +2449,19 @@
|
||||
, "ios_version": "6.0"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "🫵"
|
||||
, "description": "index pointing at the viewer"
|
||||
, "category": "People & Body"
|
||||
, "aliases": [
|
||||
"index_pointing_at_the_viewer"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "👍"
|
||||
, "description": "thumbs up"
|
||||
@@ -2349,6 +2580,20 @@
|
||||
, "ios_version": "6.0"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "🫶"
|
||||
, "description": "heart hands"
|
||||
, "category": "People & Body"
|
||||
, "aliases": [
|
||||
"heart_hands"
|
||||
]
|
||||
, "tags": [
|
||||
"love"
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "👐"
|
||||
, "description": "open hands"
|
||||
@@ -2387,6 +2632,7 @@
|
||||
]
|
||||
, "unicode_version": "9.0"
|
||||
, "ios_version": "10.2"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "🙏"
|
||||
@@ -2668,6 +2914,18 @@
|
||||
, "unicode_version": "6.0"
|
||||
, "ios_version": "6.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "🫦"
|
||||
, "description": "biting lip"
|
||||
, "category": "People & Body"
|
||||
, "aliases": [
|
||||
"biting_lip"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "👶"
|
||||
, "description": "baby"
|
||||
@@ -2768,7 +3026,7 @@
|
||||
}
|
||||
, {
|
||||
"emoji": "🧔"
|
||||
, "description": "man: beard"
|
||||
, "description": "person: beard"
|
||||
, "category": "People & Body"
|
||||
, "aliases": [
|
||||
"bearded_person"
|
||||
@@ -2779,6 +3037,32 @@
|
||||
, "ios_version": "12.1"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "🧔♂️"
|
||||
, "description": "man: beard"
|
||||
, "category": "People & Body"
|
||||
, "aliases": [
|
||||
"man_beard"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "13.1"
|
||||
, "ios_version": "14.0"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "🧔♀️"
|
||||
, "description": "woman: beard"
|
||||
, "category": "People & Body"
|
||||
, "aliases": [
|
||||
"woman_beard"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "13.1"
|
||||
, "ios_version": "14.0"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "👨🦰"
|
||||
, "description": "man: red hair"
|
||||
@@ -4258,6 +4542,19 @@
|
||||
, "ios_version": "10.0"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "🫅"
|
||||
, "description": "person with crown"
|
||||
, "category": "People & Body"
|
||||
, "aliases": [
|
||||
"person_with_crown"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "🤴"
|
||||
, "description": "prince"
|
||||
@@ -4429,8 +4726,8 @@
|
||||
, "description": "woman with veil"
|
||||
, "category": "People & Body"
|
||||
, "aliases": [
|
||||
"woman_with_veil",
|
||||
"bride_with_veil"
|
||||
"woman_with_veil"
|
||||
, "bride_with_veil"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
@@ -4451,6 +4748,32 @@
|
||||
, "ios_version": "10.2"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "🫃"
|
||||
, "description": "pregnant man"
|
||||
, "category": "People & Body"
|
||||
, "aliases": [
|
||||
"pregnant_man"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "🫄"
|
||||
, "description": "pregnant person"
|
||||
, "category": "People & Body"
|
||||
, "aliases": [
|
||||
"pregnant_person"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "🤱"
|
||||
, "description": "breast-feeding"
|
||||
@@ -4906,6 +5229,18 @@
|
||||
, "unicode_version": "11.0"
|
||||
, "ios_version": "12.1"
|
||||
}
|
||||
, {
|
||||
"emoji": "🧌"
|
||||
, "description": "troll"
|
||||
, "category": "People & Body"
|
||||
, "aliases": [
|
||||
"troll"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "💆"
|
||||
, "description": "person getting massage"
|
||||
@@ -6081,7 +6416,7 @@
|
||||
]
|
||||
, "unicode_version": "12.0"
|
||||
, "ios_version": "13.0"
|
||||
, "skin_tones": true
|
||||
, "skin_tones": false
|
||||
}
|
||||
, {
|
||||
"emoji": "👭"
|
||||
@@ -6138,6 +6473,7 @@
|
||||
]
|
||||
, "unicode_version": "6.0"
|
||||
, "ios_version": "6.0"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "👩❤️💋👨"
|
||||
@@ -6150,6 +6486,7 @@
|
||||
]
|
||||
, "unicode_version": "11.0"
|
||||
, "ios_version": "12.1"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "👨❤️💋👨"
|
||||
@@ -6162,6 +6499,7 @@
|
||||
]
|
||||
, "unicode_version": "6.0"
|
||||
, "ios_version": "8.3"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "👩❤️💋👩"
|
||||
@@ -6174,6 +6512,7 @@
|
||||
]
|
||||
, "unicode_version": "6.0"
|
||||
, "ios_version": "8.3"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "💑"
|
||||
@@ -6186,6 +6525,7 @@
|
||||
]
|
||||
, "unicode_version": "6.0"
|
||||
, "ios_version": "6.0"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "👩❤️👨"
|
||||
@@ -6198,6 +6538,7 @@
|
||||
]
|
||||
, "unicode_version": "11.0"
|
||||
, "ios_version": "12.1"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "👨❤️👨"
|
||||
@@ -6210,6 +6551,7 @@
|
||||
]
|
||||
, "unicode_version": "6.0"
|
||||
, "ios_version": "8.3"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "👩❤️👩"
|
||||
@@ -6222,6 +6564,7 @@
|
||||
]
|
||||
, "unicode_version": "6.0"
|
||||
, "ios_version": "8.3"
|
||||
, "skin_tones": true
|
||||
}
|
||||
, {
|
||||
"emoji": "👪"
|
||||
@@ -7833,6 +8176,18 @@
|
||||
, "unicode_version": "6.0"
|
||||
, "ios_version": "6.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "🪸"
|
||||
, "description": "coral"
|
||||
, "category": "Animals & Nature"
|
||||
, "aliases": [
|
||||
"coral"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "🐌"
|
||||
, "description": "snail"
|
||||
@@ -8068,6 +8423,18 @@
|
||||
, "unicode_version": "6.0"
|
||||
, "ios_version": "6.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "🪷"
|
||||
, "description": "lotus"
|
||||
, "category": "Animals & Nature"
|
||||
, "aliases": [
|
||||
"lotus"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "🏵️"
|
||||
, "description": "rosette"
|
||||
@@ -8317,6 +8684,30 @@
|
||||
, "unicode_version": "6.0"
|
||||
, "ios_version": "6.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "🪹"
|
||||
, "description": "empty nest"
|
||||
, "category": "Animals & Nature"
|
||||
, "aliases": [
|
||||
"empty_nest"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "🪺"
|
||||
, "description": "nest with eggs"
|
||||
, "category": "Animals & Nature"
|
||||
, "aliases": [
|
||||
"nest_with_eggs"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "🍇"
|
||||
, "description": "grapes"
|
||||
@@ -8721,6 +9112,18 @@
|
||||
, "unicode_version": "9.0"
|
||||
, "ios_version": "10.2"
|
||||
}
|
||||
, {
|
||||
"emoji": "🫘"
|
||||
, "description": "beans"
|
||||
, "category": "Food & Drink"
|
||||
, "aliases": [
|
||||
"beans"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "🌰"
|
||||
, "description": "chestnut"
|
||||
@@ -9770,6 +10173,18 @@
|
||||
, "unicode_version": "9.0"
|
||||
, "ios_version": "10.2"
|
||||
}
|
||||
, {
|
||||
"emoji": "🫗"
|
||||
, "description": "pouring liquid"
|
||||
, "category": "Food & Drink"
|
||||
, "aliases": [
|
||||
"pouring_liquid"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "🥤"
|
||||
, "description": "cup with straw"
|
||||
@@ -9896,6 +10311,18 @@
|
||||
, "unicode_version": "6.0"
|
||||
, "ios_version": "6.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "🫙"
|
||||
, "description": "jar"
|
||||
, "category": "Food & Drink"
|
||||
, "aliases": [
|
||||
"jar"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "🏺"
|
||||
, "description": "amphora"
|
||||
@@ -10657,6 +11084,18 @@
|
||||
, "unicode_version": "6.0"
|
||||
, "ios_version": "6.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "🛝"
|
||||
, "description": "playground slide"
|
||||
, "category": "Travel & Places"
|
||||
, "aliases": [
|
||||
"playground_slide"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "🎡"
|
||||
, "description": "ferris wheel"
|
||||
@@ -11238,6 +11677,18 @@
|
||||
, "unicode_version": "5.2"
|
||||
, "ios_version": "6.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "🛞"
|
||||
, "description": "wheel"
|
||||
, "category": "Travel & Places"
|
||||
, "aliases": [
|
||||
"wheel"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "🚨"
|
||||
, "description": "police car light"
|
||||
@@ -11315,6 +11766,19 @@
|
||||
, "unicode_version": "4.1"
|
||||
, "ios_version": "6.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "🛟"
|
||||
, "description": "ring buoy"
|
||||
, "category": "Travel & Places"
|
||||
, "aliases": [
|
||||
"ring_buoy"
|
||||
]
|
||||
, "tags": [
|
||||
"life preserver"
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "⛵"
|
||||
, "description": "sailboat"
|
||||
@@ -13228,7 +13692,7 @@
|
||||
}
|
||||
, {
|
||||
"emoji": "🎯"
|
||||
, "description": "direct hit"
|
||||
, "description": "bullseye"
|
||||
, "category": "Activities"
|
||||
, "aliases": [
|
||||
"dart"
|
||||
@@ -13314,6 +13778,18 @@
|
||||
, "unicode_version": "11.0"
|
||||
, "ios_version": "12.1"
|
||||
}
|
||||
, {
|
||||
"emoji": "🪬"
|
||||
, "description": "hamsa"
|
||||
, "category": "Activities"
|
||||
, "aliases": [
|
||||
"hamsa"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "🎮"
|
||||
, "description": "video game"
|
||||
@@ -13396,13 +13872,27 @@
|
||||
, "description": "piñata"
|
||||
, "category": "Activities"
|
||||
, "aliases": [
|
||||
"pi_ata"
|
||||
"pinata"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "13.0"
|
||||
, "ios_version": "14.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "🪩"
|
||||
, "description": "mirror ball"
|
||||
, "category": "Activities"
|
||||
, "aliases": [
|
||||
"mirror_ball"
|
||||
]
|
||||
, "tags": [
|
||||
"disco"
|
||||
, "party"
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "🪆"
|
||||
, "description": "nesting dolls"
|
||||
@@ -14601,6 +15091,18 @@
|
||||
, "unicode_version": "6.0"
|
||||
, "ios_version": "6.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "🪫"
|
||||
, "description": "low battery"
|
||||
, "category": "Objects"
|
||||
, "aliases": [
|
||||
"low_battery"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "🔌"
|
||||
, "description": "electric plug"
|
||||
@@ -15291,11 +15793,11 @@
|
||||
, "description": "envelope"
|
||||
, "category": "Objects"
|
||||
, "aliases": [
|
||||
"email"
|
||||
, "envelope"
|
||||
"envelope"
|
||||
]
|
||||
, "tags": [
|
||||
"letter"
|
||||
, "email"
|
||||
]
|
||||
, "unicode_version": ""
|
||||
, "ios_version": "6.0"
|
||||
@@ -15305,7 +15807,8 @@
|
||||
, "description": "e-mail"
|
||||
, "category": "Objects"
|
||||
, "aliases": [
|
||||
"e-mail"
|
||||
"email"
|
||||
, "e-mail"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
@@ -15988,7 +16491,7 @@
|
||||
}
|
||||
, {
|
||||
"emoji": "🔫"
|
||||
, "description": "pistol"
|
||||
, "description": "water pistol"
|
||||
, "category": "Objects"
|
||||
, "aliases": [
|
||||
"gun"
|
||||
@@ -16347,6 +16850,18 @@
|
||||
, "unicode_version": "12.0"
|
||||
, "ios_version": "13.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "🩼"
|
||||
, "description": "crutch"
|
||||
, "category": "Objects"
|
||||
, "aliases": [
|
||||
"crutch"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "🩺"
|
||||
, "description": "stethoscope"
|
||||
@@ -16359,6 +16874,18 @@
|
||||
, "unicode_version": "12.0"
|
||||
, "ios_version": "13.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "🩻"
|
||||
, "description": "x-ray"
|
||||
, "category": "Objects"
|
||||
, "aliases": [
|
||||
"x_ray"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "🚪"
|
||||
, "description": "door"
|
||||
@@ -16602,6 +17129,18 @@
|
||||
, "unicode_version": "11.0"
|
||||
, "ios_version": "12.1"
|
||||
}
|
||||
, {
|
||||
"emoji": "🫧"
|
||||
, "description": "bubbles"
|
||||
, "category": "Objects"
|
||||
, "aliases": [
|
||||
"bubbles"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "🪥"
|
||||
, "description": "toothbrush"
|
||||
@@ -16725,6 +17264,18 @@
|
||||
, "unicode_version": "13.0"
|
||||
, "ios_version": "14.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "🪪"
|
||||
, "description": "identification card"
|
||||
, "category": "Objects"
|
||||
, "aliases": [
|
||||
"identification_card"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "🏧"
|
||||
, "description": "ATM sign"
|
||||
@@ -17979,6 +18530,18 @@
|
||||
, "unicode_version": "6.0"
|
||||
, "ios_version": "6.0"
|
||||
}
|
||||
, {
|
||||
"emoji": "🟰"
|
||||
, "description": "heavy equals sign"
|
||||
, "category": "Symbols"
|
||||
, "aliases": [
|
||||
"heavy_equals_sign"
|
||||
]
|
||||
, "tags": [
|
||||
]
|
||||
, "unicode_version": "14.0"
|
||||
, "ios_version": "15.4"
|
||||
}
|
||||
, {
|
||||
"emoji": "♾️"
|
||||
, "description": "infinity"
|
||||
@@ -18017,7 +18580,7 @@
|
||||
}
|
||||
, {
|
||||
"emoji": "❓"
|
||||
, "description": "question mark"
|
||||
, "description": "red question mark"
|
||||
, "category": "Symbols"
|
||||
, "aliases": [
|
||||
"question"
|
||||
@@ -18054,7 +18617,7 @@
|
||||
}
|
||||
, {
|
||||
"emoji": "❗"
|
||||
, "description": "exclamation mark"
|
||||
, "description": "red exclamation mark"
|
||||
, "category": "Symbols"
|
||||
, "aliases": [
|
||||
"exclamation"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "gemoji"
|
||||
s.version = "4.0.0.rc2"
|
||||
s.version = "4.0.0"
|
||||
s.summary = "Unicode emoji library"
|
||||
s.description = "Character information and metadata for Unicode emoji."
|
||||
|
||||
|
||||
@@ -51,11 +51,12 @@ module Emoji
|
||||
|
||||
# Public: Find an emoji by its unicode character. Return nil if missing.
|
||||
def find_by_unicode(unicode)
|
||||
unicodes_index[unicode]
|
||||
unicodes_index[unicode] || unicodes_index[unicode.sub(SKIN_TONE_RE, "")]
|
||||
end
|
||||
|
||||
private
|
||||
VARIATION_SELECTOR_16 = "\u{fe0f}".freeze
|
||||
SKIN_TONE_RE = /[\u{1F3FB}-\u{1F3FF}]/
|
||||
|
||||
# Characters which must have VARIATION_SELECTOR_16 to render as color emoji:
|
||||
TEXT_GLYPHS = [
|
||||
@@ -70,7 +71,7 @@ module Emoji
|
||||
"\u{3030}", # wavy dash
|
||||
].freeze
|
||||
|
||||
private_constant :VARIATION_SELECTOR_16, :TEXT_GLYPHS
|
||||
private_constant :VARIATION_SELECTOR_16, :TEXT_GLYPHS, :SKIN_TONE_RE
|
||||
|
||||
def parse_data_file
|
||||
data = File.open(data_file, 'r:UTF-8') do |file|
|
||||
@@ -118,6 +119,7 @@ module Emoji
|
||||
emoji.description = dedup.call(raw_emoji[:description])
|
||||
emoji.unicode_version = dedup.call(raw_emoji[:unicode_version])
|
||||
emoji.ios_version = dedup.call(raw_emoji[:ios_version])
|
||||
emoji.skin_tones = raw_emoji.fetch(:skin_tones, false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,6 +11,11 @@ module Emoji
|
||||
# True if the emoji is not a standard Emoji character.
|
||||
def custom?() !raw end
|
||||
|
||||
# True if the emoji supports Fitzpatrick scale skin tone modifiers
|
||||
def skin_tones?() @skin_tones end
|
||||
|
||||
attr_writer :skin_tones
|
||||
|
||||
# A list of names uniquely referring to this emoji.
|
||||
attr_reader :aliases
|
||||
|
||||
@@ -38,6 +43,21 @@ module Emoji
|
||||
# Raw Unicode string for an emoji. Nil if emoji is non-standard.
|
||||
def raw() unicode_aliases.first end
|
||||
|
||||
# Raw Unicode strings for each skin tone variant of this emoji.
|
||||
def raw_skin_tone_variants
|
||||
return [] if custom? || !skin_tones?
|
||||
raw_normalized = raw.sub("\u{fe0f}", "") # strip VARIATION_SELECTOR_16
|
||||
idx = raw_normalized.index("\u{200d}") # detect zero-width joiner
|
||||
SKIN_TONES.map do |modifier|
|
||||
if idx
|
||||
# insert modifier before zero-width joiner
|
||||
raw_normalized[...idx] + modifier + raw_normalized[idx..]
|
||||
else
|
||||
raw_normalized + modifier
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def add_unicode_alias(str)
|
||||
unicode_aliases << str
|
||||
end
|
||||
@@ -54,6 +74,7 @@ module Emoji
|
||||
@aliases = Array(name)
|
||||
@unicode_aliases = []
|
||||
@tags = []
|
||||
@skin_tones = false
|
||||
end
|
||||
|
||||
def inspect
|
||||
@@ -76,6 +97,16 @@ module Emoji
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
SKIN_TONES = [
|
||||
"\u{1F3FB}", # light skin tone
|
||||
"\u{1F3FC}", # medium-light skin tone
|
||||
"\u{1F3FD}", # medium skin tone
|
||||
"\u{1F3FE}", # medium-dark skin tone
|
||||
"\u{1F3FF}", # dark skin tone
|
||||
]
|
||||
|
||||
private_constant :SKIN_TONES
|
||||
|
||||
def default_image_filename
|
||||
if custom?
|
||||
|
||||
@@ -50,13 +50,19 @@ class EmojiTest < TestCase
|
||||
GENDER_EXCEPTIONS = [
|
||||
"man_with_gua_pi_mao",
|
||||
"woman_with_headscarf",
|
||||
"pregnant_woman",
|
||||
"isle_of_man",
|
||||
"blonde_woman",
|
||||
"blonde_woman", # blond_haired_man
|
||||
/^couple(kiss)?_/,
|
||||
/^family_/,
|
||||
]
|
||||
|
||||
DASH_EXCEPTIONS = [
|
||||
"-1",
|
||||
"t-rex",
|
||||
"e-mail",
|
||||
"non-potable_water",
|
||||
]
|
||||
|
||||
test "emojis have valid names" do
|
||||
aliases = Emoji.all.flat_map(&:aliases)
|
||||
|
||||
@@ -75,7 +81,7 @@ class EmojiTest < TestCase
|
||||
alias_count = Hash.new(0)
|
||||
aliases.each do |name|
|
||||
alias_count[name] += 1
|
||||
invalid << name if name !~ /\A[\w+-]+\Z/
|
||||
invalid << name if name !~ /\A[\w+]+\Z/ && !DASH_EXCEPTIONS.include?(name)
|
||||
another_gender = to_another_gender.call(name)
|
||||
gender_mismatch << another_gender unless aliases.include?(another_gender)
|
||||
end
|
||||
@@ -90,7 +96,6 @@ class EmojiTest < TestCase
|
||||
test "missing or incorrect unicodes" do
|
||||
emoji_map, _ = EmojiTestParser.parse(File.expand_path("../../vendor/unicode-emoji-test.txt", __FILE__))
|
||||
source_unicode_emoji = emoji_map.values
|
||||
supported_sequences = Emoji.all.flat_map(&:unicode_aliases)
|
||||
text_glyphs = Emoji.const_get(:TEXT_GLYPHS)
|
||||
|
||||
missing = 0
|
||||
@@ -152,6 +157,27 @@ class EmojiTest < TestCase
|
||||
assert_equal '8.3', emoji.ios_version
|
||||
end
|
||||
|
||||
test "skin tones" do
|
||||
smiley = Emoji.find_by_alias("smiley")
|
||||
assert_equal false, smiley.skin_tones?
|
||||
assert_equal [], smiley.raw_skin_tone_variants
|
||||
|
||||
wave = Emoji.find_by_alias("wave")
|
||||
assert_equal true, wave.skin_tones?
|
||||
|
||||
wave = Emoji.find_by_unicode("\u{1f44b}\u{1f3ff}") # wave + dark skin tone
|
||||
assert_equal "wave", wave.name
|
||||
|
||||
woman_with_beard = Emoji.find_by_unicode("\u{1f9d4}\u{200d}\u{2640}\u{fe0f}")
|
||||
assert_equal [
|
||||
"1f9d4-1f3fb-200d-2640",
|
||||
"1f9d4-1f3fc-200d-2640",
|
||||
"1f9d4-1f3fd-200d-2640",
|
||||
"1f9d4-1f3fe-200d-2640",
|
||||
"1f9d4-1f3ff-200d-2640",
|
||||
], woman_with_beard.raw_skin_tone_variants.map { |u| Emoji::Character.hex_inspect(u) }
|
||||
end
|
||||
|
||||
test "no custom emojis" do
|
||||
custom = Emoji.all.select(&:custom?)
|
||||
assert 0, custom.size
|
||||
|
||||
8914
vendor/unicode-emoji-test.txt
vendored
8914
vendor/unicode-emoji-test.txt
vendored
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user