unicode-emoji 0.9.1 โ 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +13 -11
- data/lib/unicode/emoji.rb +1 -1
- data/lib/unicode/emoji/constants.rb +1 -1
- data/spec/unicode_emoji_spec.rb +5 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8df3bb4dced2b4a7c36f11f331e562a3a841324d
|
4
|
+
data.tar.gz: 067d77562f9271d1b02a30fc20bf5c62e7fb9376
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1b1d6a88ffc93560d2e07923dc3fc8cd410ed8fd28adc26f5665c6bbb4d544d3e0b648afd3642a0cd4cafb578be39ffb1d5552515181dec37e93436d2a1db97
|
7
|
+
data.tar.gz: 5e7f632b49306b0bee09e7702aa2ad32d5283898a2192c8920913ea47cfe7e95da3b39dc87ab9851eb7b3bc767b24808ef5ca5ff4b55f7d9622f68639142f4ea
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -16,16 +16,6 @@ gem "unicode-emoji"
|
|
16
16
|
|
17
17
|
## Usage
|
18
18
|
|
19
|
-
### Properties
|
20
|
-
|
21
|
-
Allows you to access the codepoint data form Unicode's [emoji-data.txt](http://unicode.org/Public/emoji/5.0/emoji-data.txt) file:
|
22
|
-
|
23
|
-
```ruby
|
24
|
-
require "unicode/emoji"
|
25
|
-
|
26
|
-
Unicode::Emoji.properties "โ" # => ["Emoji", "Emoji_Modifier_Base"]
|
27
|
-
```
|
28
|
-
|
29
19
|
### Regex
|
30
20
|
|
31
21
|
Five Emoji regexes are included, which are compiled out of various Emoji Unicode data.
|
@@ -56,7 +46,9 @@ Regex | Description | Example Matches | Example Non-Matc
|
|
56
46
|
`Unicode::Emoji::REGEX_TEXT` | Matches only textual singleton Emoji (except for singleton components, like digit 1) | `๐ด๏ธ`, `โถ` | `๐ด`, `โถ๏ธ`, `๐ป`, `๐๐ฝ`, `๐ต๐น`, `๐ต๐ต`,`2๏ธโฃ`, `๐ด๓ ง๓ ข๓ ณ๓ ฃ๓ ด๓ ฟ`, `๐ด๓ ง๓ ข๓ ก๓ ง๓ ข๓ ฟ`, `๐คพ๐ฝโโ๏ธ`, `๐ค โ๐คข`
|
57
47
|
`Unicode::Emoji::REGEX_ANY` | Matches any Emoji-related codepoint (but no variation selectors or tags) | `๐ด`, `โถ`, `๐ป`, `๐`, `๐ฝ`, `๐ต`, `๐น`, `2`, `๐ด`, `๐คพ`, `โ`, `๐ค `, `๐คข` | -
|
58
48
|
|
59
|
-
|
49
|
+
More info about valid vs. recommended emoji in this [blog article on Emojipedia](http://blog.emojipedia.org/unicode-behind-the-curtain/).
|
50
|
+
|
51
|
+
### List
|
60
52
|
|
61
53
|
Use `Unicode::Emoji::LIST` or the list method to get a grouped (and ordered) list of Emoji:
|
62
54
|
|
@@ -73,6 +65,16 @@ Unicode::Emoji.list("Food & Drink", "food-asian")
|
|
73
65
|
|
74
66
|
A markdown file with all recommended emoji can be found [in this gist](https://gist.github.com/janlelis/72f9be1f0ecca07372c64cf13894b801).
|
75
67
|
|
68
|
+
### Properties
|
69
|
+
|
70
|
+
Allows you to access the codepoint data form Unicode's [emoji-data.txt](http://unicode.org/Public/emoji/5.0/emoji-data.txt) file:
|
71
|
+
|
72
|
+
```ruby
|
73
|
+
require "unicode/emoji"
|
74
|
+
|
75
|
+
Unicode::Emoji.properties "โ" # => ["Emoji", "Emoji_Modifier_Base"]
|
76
|
+
```
|
77
|
+
|
76
78
|
## Also See
|
77
79
|
|
78
80
|
- [Unicodeยฎ Technical Standard #51](http://www.unicode.org/reports/tr51/proposed.html)
|
data/lib/unicode/emoji.rb
CHANGED
@@ -48,7 +48,7 @@ module Unicode
|
|
48
48
|
|
49
49
|
text_presentation_sequence = \
|
50
50
|
join[
|
51
|
-
pack_and_join[TEXT_PRESENTATION]+ "(?!" +
|
51
|
+
pack_and_join[TEXT_PRESENTATION]+ "(?!" + pack_and_join[EMOJI_MODIFIERS + [EMOJI_VARIATION_SELECTOR]] + ")" + pack[TEXT_VARIATION_SELECTOR] + "?",
|
52
52
|
pack_and_join[EMOJI_PRESENTATION] + pack[TEXT_VARIATION_SELECTOR]
|
53
53
|
]
|
54
54
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Unicode
|
4
4
|
module Emoji
|
5
|
-
VERSION = "0.9.
|
5
|
+
VERSION = "0.9.2".freeze
|
6
6
|
EMOJI_VERSION = "5.0".freeze
|
7
7
|
DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + '/../../../data/').freeze
|
8
8
|
INDEX_FILENAME = (DATA_DIRECTORY + '/emoji.marshal.gz').freeze
|
data/spec/unicode_emoji_spec.rb
CHANGED
@@ -255,6 +255,11 @@ describe Unicode::Emoji do
|
|
255
255
|
assert_nil $&
|
256
256
|
end
|
257
257
|
|
258
|
+
it "does not match textual singleton emoji in combination with emoji modifiers" do
|
259
|
+
"โ๐ป victory hand" =~ Unicode::Emoji::REGEX_TEXT
|
260
|
+
assert_nil $&
|
261
|
+
end
|
262
|
+
|
258
263
|
it "does not match singleton 'component' emoji codepoints" do
|
259
264
|
"๐ป light skin tone" =~ Unicode::Emoji::REGEX_TEXT
|
260
265
|
assert_nil $&
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicode-emoji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Lelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: "[Emoji 5.0] Retrieve emoji data about Unicode codepoints. Also contains
|
14
14
|
a regex to match emoji."
|
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
53
|
version: '0'
|
54
54
|
requirements: []
|
55
55
|
rubyforge_project:
|
56
|
-
rubygems_version: 2.6.
|
56
|
+
rubygems_version: 2.6.11
|
57
57
|
signing_key:
|
58
58
|
specification_version: 4
|
59
59
|
summary: Retrieve Emoji data about Unicode codepoints.
|