emoji-datasource 14.0.1 → 14.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/lib/emoji_datasource/emoji.rb +14 -3
- data/lib/emoji_datasource/version.rb +1 -1
- data/lib/emoji_datasource.rb +3 -1
- 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: 705920a1ffdf8ca2028830eeb6420d94d23955b1c189613011e666c6028b9a45
|
4
|
+
data.tar.gz: bb399eaa99c6448fdda1826fae0921c86ad1f261aa2ec892e4de4815e70e197d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6518b1ac91acc735b23a63bc7405dab7ed4d1c8928a0f850656b9278cd1e32a007d1ded4568b06a68849067faad2e8b7ee52131e1cc1912498ea555ab7aece8e
|
7
|
+
data.tar.gz: fa032904d287a9bd0d8a9e1614c6e86dc2f6e90b1b162bcdc357b328e6b187ba2ff0f3069d3bc4836453eb21acaa6688b6bb58db314ed767f4db2019807c8348
|
data/.rubocop.yml
CHANGED
@@ -33,8 +33,19 @@ module EmojiDatasource
|
|
33
33
|
def short_names
|
34
34
|
return @data['short_names'] unless @variation
|
35
35
|
|
36
|
-
@data['short_names'].
|
37
|
-
"#{short_name}::#{variation_emojis.map(&:short_name).join('::')}"
|
36
|
+
@short_names ||= @data['short_names'].flat_map do |short_name|
|
37
|
+
full_short_name = "#{short_name}::#{variation_emojis.map(&:short_name).join('::')}"
|
38
|
+
|
39
|
+
# Allow to find complex emojis with multiple equal skin tone codes by single skin tone
|
40
|
+
# For some emojis (like :women_holding_hands:) there are special single skin tone emojis.
|
41
|
+
# but for others (like :people_holding_hands:) there are no such versions.
|
42
|
+
# However, some implementations in the wild (e.g. Slack and EmojiMart) understand codes
|
43
|
+
# containing only single skin tone (e.g. `:people_holding_hands::skin-tone-N:`)
|
44
|
+
if variation_emojis.size > 1 && variation_emojis.uniq.size == 1
|
45
|
+
abbr_short_name = "#{short_name}::#{variation_emojis.first.short_name}"
|
46
|
+
end
|
47
|
+
|
48
|
+
[full_short_name, abbr_short_name].compact
|
38
49
|
end
|
39
50
|
end
|
40
51
|
|
@@ -90,7 +101,7 @@ module EmojiDatasource
|
|
90
101
|
def variation_emojis
|
91
102
|
return [] unless @variation
|
92
103
|
|
93
|
-
@variation.split('-').map do |unified|
|
104
|
+
@variation_emojis ||= @variation.split('-').map do |unified|
|
94
105
|
EmojiDatasource.find_by_unified(unified)
|
95
106
|
end
|
96
107
|
end
|
data/lib/emoji_datasource.rb
CHANGED
@@ -73,7 +73,9 @@ module EmojiDatasource
|
|
73
73
|
@short_name_lookup_map ||= data.each_with_object({}) do |emoji, result|
|
74
74
|
emoji.short_names.each { |short_name| result[short_name] = emoji }
|
75
75
|
emoji.variations.each do |emoji_variant|
|
76
|
-
emoji_variant.short_names.each
|
76
|
+
emoji_variant.short_names.each do |short_name|
|
77
|
+
result[short_name] = emoji_variant
|
78
|
+
end
|
77
79
|
end
|
78
80
|
end
|
79
81
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emoji-datasource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 14.0.
|
4
|
+
version: 14.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justas Palumickas
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
132
|
- !ruby/object:Gem::Version
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
|
-
rubygems_version: 3.
|
135
|
+
rubygems_version: 3.4.8
|
136
136
|
signing_key:
|
137
137
|
specification_version: 4
|
138
138
|
summary: Emoji data from emoji-datasource npm package
|