unicode-emoji 1.0.3 โ 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +5 -5
- data/data/emoji.marshal.gz +0 -0
- data/lib/unicode/emoji.rb +7 -3
- data/lib/unicode/emoji/constants.rb +2 -2
- data/lib/unicode/emoji/index.rb +7 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6cdca65a25735347a97f077a43c00b1b30c84fa2aa7b688b7072b1af8624d1f
|
4
|
+
data.tar.gz: e083a936a9f360ca0348fe6a3f76a12aa2fbf94826cbf30fd31db1abc23d9bc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d408fec5b09dd66db4ea61fb476cd5c74570d1cd9f43451732619ea303292afeb28e7d65d56eb012676ecbd2bda61e4e03912f3fae66bb26f51abde5ff85ba6b
|
7
|
+
data.tar.gz: 815d375a3de1d1cbedb64ced2530ee2c9c02a52223ced9bff0273231f8de09a135b7043f6159701c76af60046234b353ec14a5ae136aad36f998560e96988841
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@ A small Ruby library which provides Unicode Emoji data and regexes.
|
|
4
4
|
|
5
5
|
Also includes a categorized list of recommended Emoji.
|
6
6
|
|
7
|
-
Emoji version: **
|
7
|
+
Emoji version: **11.0**
|
8
8
|
|
9
9
|
Supported Rubies: **2.5**, **2.4**, **2.3**
|
10
10
|
|
@@ -48,7 +48,7 @@ Regex | Description | Example Matches | Example Non-Matc
|
|
48
48
|
`Unicode::Emoji::REGEX_TEXT` | Matches only textual singleton Emoji (except for singleton components, like digit 1) | `๐ด๏ธ`, `โถ` | `๐ด`, `โถ๏ธ`, `๐ป`, `๐๐ฝ`, `๐ต๐น`, `๐ต๐ต`,`2๏ธโฃ`, `๐ด๓ ง๓ ข๓ ณ๓ ฃ๓ ด๓ ฟ`, `๐ด๓ ง๓ ข๓ ก๓ ง๓ ข๓ ฟ`, `๐คพ๐ฝโโ๏ธ`, `๐ค โ๐คข`
|
49
49
|
`Unicode::Emoji::REGEX_ANY` | Matches any Emoji-related codepoint (but no variation selectors or tags) | `๐ด`, `โถ`, `๐ป`, `๐`, `๐ฝ`, `๐ต`, `๐น`, `2`, `๐ด`, `๐คพ`, `โ`, `๐ค `, `๐คข` | -
|
50
50
|
|
51
|
-
More info about valid vs. recommended
|
51
|
+
More info about valid vs. recommended Emoji in this [blog article on Emojipedia](http://blog.emojipedia.org/unicode-behind-the-curtain/).
|
52
52
|
|
53
53
|
### List
|
54
54
|
|
@@ -65,11 +65,11 @@ Unicode::Emoji.list("Food & Drink", "food-asian")
|
|
65
65
|
=> ["๐ฑ", "๐", "๐", "๐", "๐", "๐", "๐", "๐ ", "๐ข", "๐ฃ", "๐ค", "๐ฅ", "๐ก", "\u{1F95F}", "\u{1F960}", "\u{1F961}"]
|
66
66
|
```
|
67
67
|
|
68
|
-
A markdown file with all recommended
|
68
|
+
A markdown file with all recommended Emoji can be found [in this gist](https://gist.github.com/janlelis/72f9be1f0ecca07372c64cf13894b801).
|
69
69
|
|
70
70
|
### Properties
|
71
71
|
|
72
|
-
Allows you to access the codepoint data form Unicode's [emoji-data.txt](http://unicode.org/Public/emoji/
|
72
|
+
Allows you to access the codepoint data form Unicode's [emoji-data.txt](http://unicode.org/Public/emoji/11.0/emoji-data.txt) file:
|
73
73
|
|
74
74
|
```ruby
|
75
75
|
require "unicode/emoji"
|
@@ -80,7 +80,7 @@ Unicode::Emoji.properties "โ" # => ["Emoji", "Emoji_Modifier_Base"]
|
|
80
80
|
## Also See
|
81
81
|
|
82
82
|
- [Unicodeยฎ Technical Standard #51](http://www.unicode.org/reports/tr51/proposed.html)
|
83
|
-
- [Emoji data](http://unicode.org/Public/emoji/
|
83
|
+
- [Emoji data](http://unicode.org/Public/emoji/11.0/)
|
84
84
|
- [Emoji categories](http://unicode.org/emoji/charts/emoji-ordering.html)
|
85
85
|
- Ruby gem which displays [Emoji sequence names](https://github.com/janlelis/unicode-sequence_name)
|
86
86
|
- Part of [unicode-x](https://github.com/janlelis/unicode-x)
|
data/data/emoji.marshal.gz
CHANGED
Binary file
|
data/lib/unicode/emoji.rb
CHANGED
@@ -6,10 +6,12 @@ require_relative "emoji/index"
|
|
6
6
|
module Unicode
|
7
7
|
module Emoji
|
8
8
|
PROPERTY_NAMES = {
|
9
|
+
E: "Emoji",
|
9
10
|
B: "Emoji_Modifier_Base",
|
10
11
|
M: "Emoji_Modifier",
|
11
12
|
C: "Emoji_Component",
|
12
13
|
P: "Emoji_Presentation",
|
14
|
+
X: "Extended_Pictographic",
|
13
15
|
}
|
14
16
|
|
15
17
|
EMOJI_VARIATION_SELECTOR = 0xFE0F
|
@@ -19,12 +21,14 @@ module Unicode
|
|
19
21
|
EMOJI_KEYCAP_SUFFIX = 0x20E3
|
20
22
|
ZWJ = 0x200D
|
21
23
|
|
22
|
-
EMOJI_CHAR = INDEX[:PROPERTIES].keys.freeze
|
24
|
+
EMOJI_CHAR = INDEX[:PROPERTIES].select{ |ord, props| props.include?(:E) }.keys.freeze
|
23
25
|
EMOJI_PRESENTATION = INDEX[:PROPERTIES].select{ |ord, props| props.include?(:P) }.keys.freeze
|
24
|
-
TEXT_PRESENTATION = INDEX[:PROPERTIES].select{ |ord, props| !props.include?(:P) }.keys.freeze
|
26
|
+
TEXT_PRESENTATION = INDEX[:PROPERTIES].select{ |ord, props| props.include?(:E) && !props.include?(:P) }.keys.freeze
|
25
27
|
EMOJI_COMPONENT = INDEX[:PROPERTIES].select{ |ord, props| props.include?(:C) }.keys.freeze
|
26
28
|
EMOJI_MODIFIER_BASES = INDEX[:PROPERTIES].select{ |ord, props| props.include?(:B) }.keys.freeze
|
27
29
|
EMOJI_MODIFIERS = INDEX[:PROPERTIES].select{ |ord, props| props.include?(:M) }.keys.freeze
|
30
|
+
# Not needed right now:
|
31
|
+
# EXTENDED_PICTOGRAPHIC = INDEX[:PROPERTIES].select{ |ord, props| props.include?(:X) }.keys.freeze
|
28
32
|
EMOJI_KEYCAPS = INDEX[:KEYCAPS].freeze
|
29
33
|
VALID_REGION_FLAGS = INDEX[:FLAGS].freeze
|
30
34
|
VALID_SUBDIVISIONS = INDEX[:SD].freeze
|
@@ -131,7 +135,7 @@ module Unicode
|
|
131
135
|
props = INDEX[:PROPERTIES][ord]
|
132
136
|
|
133
137
|
if props
|
134
|
-
|
138
|
+
props.map{ |prop| PROPERTY_NAMES[prop] }
|
135
139
|
else
|
136
140
|
# nothing
|
137
141
|
end
|
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
module Unicode
|
4
4
|
module Emoji
|
5
|
-
VERSION = "1.0
|
6
|
-
EMOJI_VERSION = "
|
5
|
+
VERSION = "1.1.0".freeze
|
6
|
+
EMOJI_VERSION = "11.0".freeze
|
7
7
|
DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + '/../../../data/').freeze
|
8
8
|
INDEX_FILENAME = (DATA_DIRECTORY + '/emoji.marshal.gz').freeze
|
9
9
|
|
data/lib/unicode/emoji/index.rb
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require_relative
|
3
|
+
require "zlib"
|
4
|
+
require_relative "constants"
|
5
5
|
|
6
6
|
module Unicode
|
7
7
|
module Emoji
|
8
|
-
|
8
|
+
File.open(INDEX_FILENAME, "rb") do |file|
|
9
|
+
serialized_data = Zlib::GzipReader.new(file).read
|
10
|
+
serialized_data.force_encoding Encoding::BINARY
|
11
|
+
INDEX = Marshal.load(serialized_data)
|
12
|
+
end
|
9
13
|
end
|
10
14
|
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicode-emoji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Lelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: "[Emoji
|
13
|
+
description: "[Emoji 11.0] Retrieve emoji data about Unicode codepoints. Also contains
|
14
14
|
a regex to match emoji."
|
15
15
|
email:
|
16
16
|
- mail@janlelis.de
|