negarmoji 0.1.5 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +42 -60
- data/.rubocop.yml +6 -4
- data/Gemfile +0 -3
- data/Rakefile +0 -16
- data/db/filenames.json +3499 -0
- data/db/negarmoji.json +13011 -4886
- data/lib/negarmoji/character.rb +2 -1
- data/lib/negarmoji/emoji.rb +1 -1
- data/lib/negarmoji/version.rb +1 -1
- data/negarmoji.gemspec +7 -7
- data/script/dev_release.py +5 -3
- data/script/downloader.sh +29 -0
- data/script/filename_generator.rb +11 -0
- data/script/json_generator.py +163 -0
- data/script/test.sh +2 -2
- data/script/updater.py +30 -0
- data/test/emoji_test.rb +58 -59
- data/test/test_helper.rb +1 -0
- data/vendor/unicode-emoji-test.txt +2173 -2021
- metadata +21 -19
- data/db/dump.rb +0 -67
- data/db/index.html +0 -113
- data/script/bootstrap +0 -10
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: negarmoji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mohammad Mahdi Baghbani Pourvahid
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,84 +16,84 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.2.3
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.2.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 5.14.4
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 5.14.4
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 13.0.6
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 13.0.6
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '3.
|
61
|
+
version: '3.10'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '3.
|
68
|
+
version: '3.10'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rubocop
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 1.18.3
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 1.18.3
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: simplecov
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.
|
89
|
+
version: 0.21.2
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.
|
96
|
+
version: 0.21.2
|
97
97
|
description: Character information and metadata for Unicode emoji.
|
98
98
|
email: MahdiBaghbani@protonmail.com
|
99
99
|
executables: []
|
@@ -117,9 +117,8 @@ files:
|
|
117
117
|
- ROADMAP.md
|
118
118
|
- Rakefile
|
119
119
|
- SUPPORT.md
|
120
|
-
- db/dump.rb
|
121
120
|
- db/emoji-test-parser.rb
|
122
|
-
- db/
|
121
|
+
- db/filenames.json
|
123
122
|
- db/negarmoji.json
|
124
123
|
- lib/negarmoji.rb
|
125
124
|
- lib/negarmoji/character.rb
|
@@ -127,13 +126,16 @@ files:
|
|
127
126
|
- lib/negarmoji/version.rb
|
128
127
|
- logo.svg
|
129
128
|
- negarmoji.gemspec
|
130
|
-
- script/bootstrap
|
131
129
|
- script/ci_rubygems.sh
|
132
130
|
- script/dev_release.py
|
133
131
|
- script/dev_revert_tag.py
|
132
|
+
- script/downloader.sh
|
133
|
+
- script/filename_generator.rb
|
134
|
+
- script/json_generator.py
|
134
135
|
- script/test.sh
|
135
136
|
- script/test_module.sh
|
136
137
|
- script/test_style.sh
|
138
|
+
- script/updater.py
|
137
139
|
- test/documentation_test.rb
|
138
140
|
- test/emoji_test.rb
|
139
141
|
- test/test_helper.rb
|
@@ -150,14 +152,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
150
152
|
requirements:
|
151
153
|
- - ">="
|
152
154
|
- !ruby/object:Gem::Version
|
153
|
-
version: 2.
|
155
|
+
version: 2.7.2
|
154
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
157
|
requirements:
|
156
158
|
- - ">="
|
157
159
|
- !ruby/object:Gem::Version
|
158
160
|
version: '0'
|
159
161
|
requirements: []
|
160
|
-
rubygems_version: 3.
|
162
|
+
rubygems_version: 3.2.3
|
161
163
|
signing_key:
|
162
164
|
specification_version: 4
|
163
165
|
summary: Unicode emoji library.
|
data/db/dump.rb
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "emoji"
|
4
|
-
require "json"
|
5
|
-
require_relative "./emoji-test-parser"
|
6
|
-
|
7
|
-
items = []
|
8
|
-
|
9
|
-
_, categories = EmojiTestParser.parse(File.expand_path("../vendor/unicode-emoji-test.txt", __dir__))
|
10
|
-
seen_existing = {}
|
11
|
-
|
12
|
-
categories.each do |category|
|
13
|
-
category[:emoji].each do |sub_category|
|
14
|
-
sub_category[:emoji].each do |emoji_item|
|
15
|
-
raw = emoji_item[:sequences][0]
|
16
|
-
existing_emoji = Emoji.find_by_unicode(raw) || Emoji.find_by_unicode("#{raw}\u{fe0f}")
|
17
|
-
if seen_existing.key?(existing_emoji)
|
18
|
-
existing_emoji = nil
|
19
|
-
else
|
20
|
-
seen_existing[existing_emoji] = true
|
21
|
-
end
|
22
|
-
description = emoji_item[:description].sub(/^E\d+(\.\d+)? /, "")
|
23
|
-
output_item = {
|
24
|
-
:emoji => raw,
|
25
|
-
:description => description,
|
26
|
-
:category => category[:name]
|
27
|
-
}
|
28
|
-
if existing_emoji
|
29
|
-
output_item.update(
|
30
|
-
:aliases => existing_emoji.aliases,
|
31
|
-
:tags => existing_emoji.tags,
|
32
|
-
:unicode_version => existing_emoji.unicode_version,
|
33
|
-
:ios_version => existing_emoji.ios_version
|
34
|
-
)
|
35
|
-
else
|
36
|
-
output_item.update(
|
37
|
-
:aliases => [description.gsub(%r{\W+}, "_").downcase],
|
38
|
-
:tags => [],
|
39
|
-
:unicode_version => "12.1",
|
40
|
-
:ios_version => "13.2"
|
41
|
-
)
|
42
|
-
end
|
43
|
-
output_item[:skin_tones] = true if emoji_item[:skin_tones]
|
44
|
-
items << output_item
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
missing_emoji = Emoji.all.reject { |e| e.custom? || seen_existing.key?(e) }
|
50
|
-
if missing_emoji.any?
|
51
|
-
warn "Error: these `negarmoji.json` entries were not matched:"
|
52
|
-
warn missing_emoji.map { |e| format("%s (%s)", e.hex_inspect, e.name) }
|
53
|
-
exit 1
|
54
|
-
end
|
55
|
-
|
56
|
-
Emoji.all.select(&:custom?).each do |emoji|
|
57
|
-
items << {
|
58
|
-
:aliases => emoji.aliases,
|
59
|
-
:tags => emoji.tags
|
60
|
-
}
|
61
|
-
end
|
62
|
-
|
63
|
-
trap(:PIPE) { abort }
|
64
|
-
|
65
|
-
puts JSON.pretty_generate(items)
|
66
|
-
.gsub("\n\n", "\n")
|
67
|
-
.gsub(%r{,\n( +)}) { format("\n%<regex>s, ", :regex => Regexp.last_match(1)[2..-1]) }
|
data/db/index.html
DELETED
@@ -1,113 +0,0 @@
|
|
1
|
-
<!doctype html>
|
2
|
-
<title>Emoji preview</title>
|
3
|
-
|
4
|
-
<style type="text/css">
|
5
|
-
body {
|
6
|
-
font: 14px/18px Verdana, Arial, sans-serif;
|
7
|
-
padding: 2em;
|
8
|
-
}
|
9
|
-
ol {
|
10
|
-
list-style: none;
|
11
|
-
padding-left: 0;
|
12
|
-
}
|
13
|
-
li {
|
14
|
-
margin-left: 0;
|
15
|
-
margin-top: 5px;
|
16
|
-
clear: left;
|
17
|
-
}
|
18
|
-
li:first-child { display: none; }
|
19
|
-
li > span {
|
20
|
-
display: block;
|
21
|
-
}
|
22
|
-
.emoji {
|
23
|
-
font-size: 50px;
|
24
|
-
line-height: 50px;
|
25
|
-
float: left;
|
26
|
-
margin-right: 20px;
|
27
|
-
}
|
28
|
-
.description {
|
29
|
-
font-style: italic;
|
30
|
-
color: gray;
|
31
|
-
}
|
32
|
-
.aliases span:before, .aliases span:after {
|
33
|
-
content: ":";
|
34
|
-
color: gray;
|
35
|
-
}
|
36
|
-
.tags {
|
37
|
-
font-size: 11px;
|
38
|
-
}
|
39
|
-
.tags span {
|
40
|
-
display: inline-block;
|
41
|
-
padding: 1px 5px 2px;
|
42
|
-
border-radius: 3px;
|
43
|
-
background: #dadada;
|
44
|
-
line-height: 11px;
|
45
|
-
}
|
46
|
-
</style>
|
47
|
-
|
48
|
-
<p><input type=search placeholder="Search..."></p>
|
49
|
-
|
50
|
-
<ol>
|
51
|
-
<li>
|
52
|
-
<span class="emoji"></span>
|
53
|
-
<span class="description"></span>
|
54
|
-
<span class="aliases"></span>
|
55
|
-
<span class="tags"></span>
|
56
|
-
</li>
|
57
|
-
</ol>
|
58
|
-
|
59
|
-
<script>
|
60
|
-
function renderEmoji(emojis) {
|
61
|
-
var item, els, template = document.querySelector('li')
|
62
|
-
for (var emoji, i=0; i < emojis.length; i++) {
|
63
|
-
emoji = emojis[i]
|
64
|
-
item = template.cloneNode(true)
|
65
|
-
els = item.querySelectorAll('span')
|
66
|
-
if (emoji.emoji) els[0].textContent = emoji.emoji
|
67
|
-
else {
|
68
|
-
var img = document.createElement('img')
|
69
|
-
img.src = "../images/" + emoji.aliases[0] + ".png"
|
70
|
-
els[0].appendChild(img)
|
71
|
-
}
|
72
|
-
els[1].textContent = emoji.description || ''
|
73
|
-
els[2].innerHTML = emoji.aliases.map(function(n){ return '<span>'+n+'</span>' }).join(' ')
|
74
|
-
els[3].innerHTML = emoji.tags.map(function(n){ return '<span>'+n+'</span>' }).join(' ')
|
75
|
-
template.parentNode.appendChild(item)
|
76
|
-
|
77
|
-
item._emojiText = (els[2].textContent + ' ' + els[3].textContent).replace(/_/g, '-')
|
78
|
-
}
|
79
|
-
}
|
80
|
-
|
81
|
-
xhr = new XMLHttpRequest
|
82
|
-
xhr.onreadystatechange = function() {
|
83
|
-
if (this.readyState == 4) {
|
84
|
-
json = JSON.parse(this.responseText)
|
85
|
-
renderEmoji(json)
|
86
|
-
}
|
87
|
-
}
|
88
|
-
xhr.open('GET', 'emoji.json', false)
|
89
|
-
xhr.send(null)
|
90
|
-
|
91
|
-
function searchEmoji(query) {
|
92
|
-
var el,
|
93
|
-
re = new RegExp('\\b' + query),
|
94
|
-
els = document.querySelectorAll('li')
|
95
|
-
|
96
|
-
for (var i=1; i < els.length; i++) {
|
97
|
-
el = els[i]
|
98
|
-
if ( !query || re.test(el._emojiText) ) {
|
99
|
-
el.style.display = 'list-item'
|
100
|
-
} else {
|
101
|
-
el.style.display = 'none'
|
102
|
-
}
|
103
|
-
}
|
104
|
-
}
|
105
|
-
|
106
|
-
var timeout, search = document.querySelector('input[type=search]')
|
107
|
-
search.addEventListener('input', function() {
|
108
|
-
var $this = this
|
109
|
-
if (timeout) clearTimeout(timeout)
|
110
|
-
timeout = setTimeout(function(){ searchEmoji($this.value) }, 200)
|
111
|
-
}, false)
|
112
|
-
search.focus()
|
113
|
-
</script>
|