unicode-emoji 0.9.3 β†’ 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22c271c4a3a51967c5b75b15a7ded0b61860df8b542ae66fdac8808df231e985
4
- data.tar.gz: 66bfe3ddd0a33ba69364c2a1293bb552253ef518a821a27174b431863b06be5d
3
+ metadata.gz: b6af04d4f8c8c5ec38b45e1b396af541a9b8c8a57e85651e1b7e472c8cfce28d
4
+ data.tar.gz: db9033bc0bfceacbede4c4ecbecae2358733539b9b0b4ce16622369fae8ca0ca
5
5
  SHA512:
6
- metadata.gz: 864f1e79d011112551bb5e6c45722649fcde2c43db3003e539eb868fa7d9994f3fc69ef320440c59e996792aa6f3eb204dd5de456e2334b44100fecb3f215362
7
- data.tar.gz: 18a8ab8577ba118a8bd4200e7ca656b2fc9870b2ed1ceea1d14c58030dc2572f012ce6465ae3260a97819d534e5c42561fc61313dd80df642e9dc8fe72e4e628
6
+ metadata.gz: ca0b1e5c9b5be9c77845755315ec5a639ba34ed349298f2430841cc5f650efc5a4dd5658b872712b68cec3239fb5d33735a1c52e55925e57ef8588d9555e7f5a
7
+ data.tar.gz: 001756b53f178b3be3e5625952e2985d9103d9b7324e640acb9aed591ff584c36c3c1e294b936233bce3823fec66649a33b672571679af20ed65b59af6e38736
data/.travis.yml CHANGED
@@ -3,23 +3,14 @@ language: ruby
3
3
 
4
4
  rvm:
5
5
  - ruby-head
6
- - 2.5.0
7
- - 2.4.3
8
- - 2.3.6
9
- - 2.2
10
- - 2.1
11
- - 2.0
6
+ - 2.5.1
7
+ - 2.4.4
8
+ - 2.3.7
12
9
  - jruby-head
13
- - jruby-9.1.15.0
14
-
15
- cache:
16
- - bundler
10
+ - jruby-9.1.16.0
17
11
 
18
12
  matrix:
19
13
  allow_failures:
20
14
  - rvm: jruby-head
21
15
  - rvm: ruby-head
22
- - rvm: 2.1
23
- - rvm: 2.0
24
16
  # fast_finish: true
25
-
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## CHANGELOG
2
2
 
3
+ ### 1.0.0
4
+
5
+ - Drop support for Ruby below 2.3, use 0.9 if you need to
6
+ - Internal refactorings, no API change
7
+
3
8
  ### 0.9.3
4
9
 
5
10
  - Implement native Emoji regex matchers, but do not activate or document, yet
data/README.md CHANGED
@@ -6,9 +6,9 @@ Also includes a categorized list of recommended Emoji.
6
6
 
7
7
  Emoji version: **5.0**
8
8
 
9
- Supported Rubies: **2.5**, **2.4**, **2.3**, **2.2**
9
+ Supported Rubies: **2.5**, **2.4**, **2.3**
10
10
 
11
- Unsupported Rubies, but may still work: **2.1**
11
+ If you are stuck on an older Ruby version, checkout the latest [0.9 version](https://rubygems.org/gems/unicode-emoji/versions/0.9.3) of this gem.
12
12
 
13
13
  ## Gemfile
14
14
 
data/lib/unicode/emoji.rb CHANGED
@@ -31,7 +31,7 @@ module Unicode
31
31
  RECOMMENDED_SUBDIVISION_FLAGS = INDEX[:TAGS].freeze
32
32
  RECOMMENDED_ZWJ_SEQUENCES = INDEX[:ZWJ].freeze
33
33
 
34
- LIST = INDEX[:LIST].freeze.each{ |_, sub_list| sub_list.freeze }
34
+ LIST = INDEX[:LIST].freeze.each_value(&:freeze)
35
35
 
36
36
  pack = ->(ord){ Regexp.escape(Array(ord).pack("U*")) }
37
37
  join = -> (*strings){ "(?:" + strings.join("|") + ")" }
@@ -138,15 +138,8 @@ module Unicode
138
138
  end
139
139
 
140
140
  def self.list(key = nil, sub_key = nil)
141
- if key
142
- if sub_key
143
- LIST[key][sub_key]
144
- else
145
- LIST[key]
146
- end
147
- else
148
- LIST
149
- end
141
+ return LIST unless key || sub_key
142
+ LIST.dig(*[key, sub_key].compact)
150
143
  end
151
144
 
152
145
  def self.get_codepoint_value(char)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Unicode
4
4
  module Emoji
5
- VERSION = "0.9.3".freeze
5
+ VERSION = "1.0.0".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
@@ -3,12 +3,12 @@ require "minitest/autorun"
3
3
 
4
4
  describe Unicode::Emoji do
5
5
  describe ".properties" do
6
- it "will return an Array with Emoji properties if codepoints has some" do
6
+ it "returns an Array for Emoji properties if has codepoints" do
7
7
  assert_equal ["Emoji", "Emoji_Presentation"], Unicode::Emoji.properties("😴")
8
8
  assert_equal ["Emoji"], Unicode::Emoji.properties("β™ ")
9
9
  end
10
10
 
11
- it "will return nil with Emoji properties if codepoints has some" do
11
+ it "returns nil for Emoji properties if has no codepoints" do
12
12
  assert_nil Unicode::Emoji.properties("A")
13
13
  end
14
14
  end
@@ -24,7 +24,7 @@ describe Unicode::Emoji do
24
24
  assert_equal "😴\u{FE0F}", $&
25
25
  end
26
26
 
27
- it "does not match singleton emoji when in combination with text variation selector" do
27
+ it "does not match singleton emoji in combination with text variation selector" do
28
28
  "😴\u{FE0E} sleeping face" =~ Unicode::Emoji::REGEX
29
29
  assert_nil $&
30
30
  end
@@ -34,7 +34,7 @@ describe Unicode::Emoji do
34
34
  assert_nil $&
35
35
  end
36
36
 
37
- it "does match textual singleton emoji in combination with emoji variation selector" do
37
+ it "matches textual singleton emoji in combination with emoji variation selector" do
38
38
  "β–Ά\u{FE0F} play button" =~ Unicode::Emoji::REGEX
39
39
  assert_equal "β–Ά\u{FE0F}", $&
40
40
  end
@@ -44,7 +44,7 @@ describe Unicode::Emoji do
44
44
  assert_nil $&
45
45
  end
46
46
 
47
- it "does match modified emoji if modifier base emoji is used" do
47
+ it "matches modified emoji if modifier base emoji is used" do
48
48
  "πŸ›ŒπŸ½ person in bed: medium skin tone" =~ Unicode::Emoji::REGEX
49
49
  assert_equal "πŸ›ŒπŸ½", $&
50
50
  end
@@ -54,7 +54,7 @@ describe Unicode::Emoji do
54
54
  assert_equal "🌡", $&
55
55
  end
56
56
 
57
- it "does match valid region flags" do
57
+ it "matches valid region flags" do
58
58
  "πŸ‡΅πŸ‡Ή Portugal" =~ Unicode::Emoji::REGEX
59
59
  assert_equal "πŸ‡΅πŸ‡Ή", $&
60
60
  end
@@ -64,27 +64,27 @@ describe Unicode::Emoji do
64
64
  assert_nil $&
65
65
  end
66
66
 
67
- it "does match emoji keycap sequences" do
67
+ it "matches emoji keycap sequences" do
68
68
  "2️⃣ keycap: 2" =~ Unicode::Emoji::REGEX
69
69
  assert_equal "2️⃣", $&
70
70
  end
71
71
 
72
- it "does match recommended tag sequences" do
72
+ it "matches recommended tag sequences" do
73
73
  "🏴󠁧󠁒󠁳󠁣󠁴󠁿 Scotland" =~ Unicode::Emoji::REGEX
74
74
  assert_equal "🏴󠁧󠁒󠁳󠁣󠁴󠁿", $&
75
75
  end
76
76
 
77
- it "does not match valid tag sequences which are not recommended" do
77
+ it "does not match valid tag sequences that are not recommended" do
78
78
  "🏴󠁧󠁒󠁑󠁧󠁒󠁿 GB AGB" =~ Unicode::Emoji::REGEX
79
79
  assert_equal "🏴", $& # only base flag is matched
80
80
  end
81
81
 
82
- it "does match recommended zwj sequences" do
82
+ it "matches recommended zwj sequences" do
83
83
  "πŸ€ΎπŸ½β€β™€οΈ woman playing handball: medium skin tone" =~ Unicode::Emoji::REGEX
84
84
  assert_equal "πŸ€ΎπŸ½β€β™€οΈ", $&
85
85
  end
86
86
 
87
- it "does not match valid zwj sequences which are not recommended" do
87
+ it "does not match valid zwj sequences that are not recommended" do
88
88
  "πŸ€ β€πŸ€’ vomiting cowboy" =~ Unicode::Emoji::REGEX
89
89
  assert_equal "🀠", $&
90
90
  end
@@ -111,7 +111,7 @@ describe Unicode::Emoji do
111
111
  assert_nil $&
112
112
  end
113
113
 
114
- it "does match textual singleton emoji in combination with emoji variation selector" do
114
+ it "matches textual singleton emoji in combination with emoji variation selector" do
115
115
  "β–Ά\u{FE0F} play button" =~ Unicode::Emoji::REGEX_VALID
116
116
  assert_equal "β–Ά\u{FE0F}", $&
117
117
  end
@@ -121,7 +121,7 @@ describe Unicode::Emoji do
121
121
  assert_nil $&
122
122
  end
123
123
 
124
- it "does match modified emoji if modifier base emoji is used" do
124
+ it "matches modified emoji if modifier base emoji is used" do
125
125
  "πŸ›ŒπŸ½ person in bed: medium skin tone" =~ Unicode::Emoji::REGEX_VALID
126
126
  assert_equal "πŸ›ŒπŸ½", $&
127
127
  end
@@ -131,7 +131,7 @@ describe Unicode::Emoji do
131
131
  assert_equal "🌡", $&
132
132
  end
133
133
 
134
- it "does match valid region flags" do
134
+ it "matches valid region flags" do
135
135
  "πŸ‡΅πŸ‡Ή Portugal" =~ Unicode::Emoji::REGEX_VALID
136
136
  assert_equal "πŸ‡΅πŸ‡Ή", $&
137
137
  end
@@ -141,17 +141,17 @@ describe Unicode::Emoji do
141
141
  assert_nil $&
142
142
  end
143
143
 
144
- it "does match emoji keycap sequences" do
144
+ it "matches emoji keycap sequences" do
145
145
  "2️⃣ keycap: 2" =~ Unicode::Emoji::REGEX_VALID
146
146
  assert_equal "2️⃣", $&
147
147
  end
148
148
 
149
- it "does match recommended tag sequences" do
149
+ it "matches recommended tag sequences" do
150
150
  "🏴󠁧󠁒󠁳󠁣󠁴󠁿 Scotland" =~ Unicode::Emoji::REGEX_VALID
151
151
  assert_equal "🏴󠁧󠁒󠁳󠁣󠁴󠁿", $&
152
152
  end
153
153
 
154
- it "does match valid tag sequences, even though they are not recommended" do
154
+ it "matches valid tag sequences, even though they are not recommended" do
155
155
  "🏴󠁧󠁒󠁑󠁧󠁒󠁿 GB AGB" =~ Unicode::Emoji::REGEX_VALID
156
156
  assert_equal "🏴󠁧󠁒󠁑󠁧󠁒󠁿", $&
157
157
  end
@@ -161,12 +161,12 @@ describe Unicode::Emoji do
161
161
  assert_equal "🏴", $&
162
162
  end
163
163
 
164
- it "does match recommended zwj sequences" do
164
+ it "matches recommended zwj sequences" do
165
165
  "πŸ€ΎπŸ½β€β™€οΈ woman playing handball: medium skin tone" =~ Unicode::Emoji::REGEX_VALID
166
166
  assert_equal "πŸ€ΎπŸ½β€β™€οΈ", $&
167
167
  end
168
168
 
169
- it "does match valid zwj sequences, even though they are not recommended" do
169
+ it "matches valid zwj sequences, even though they are not recommended" do
170
170
  "πŸ€ β€πŸ€’ vomiting cowboy" =~ Unicode::Emoji::REGEX_VALID
171
171
  assert_equal "πŸ€ β€πŸ€’", $&
172
172
  end
@@ -193,7 +193,7 @@ describe Unicode::Emoji do
193
193
  assert_nil $&
194
194
  end
195
195
 
196
- it "does match textual singleton emoji in combination with emoji variation selector" do
196
+ it "matches textual singleton emoji in combination with emoji variation selector" do
197
197
  "β–Ά\u{FE0F} play button" =~ Unicode::Emoji::REGEX
198
198
  assert_equal "β–Ά\u{FE0F}", $&
199
199
  end
@@ -240,12 +240,12 @@ describe Unicode::Emoji do
240
240
  assert_nil $&
241
241
  end
242
242
 
243
- it "does match singleton emoji in combination with text variation selector" do
243
+ it "matches singleton emoji in combination with text variation selector" do
244
244
  "😴\u{FE0E} sleeping face" =~ Unicode::Emoji::REGEX_TEXT
245
245
  assert_equal "😴\u{FE0E}", $&
246
246
  end
247
247
 
248
- it "does match textual singleton emoji" do
248
+ it "matches textual singleton emoji" do
249
249
  "β–Ά play button" =~ Unicode::Emoji::REGEX_TEXT
250
250
  assert_equal "β–Ά", $&
251
251
  end
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.3
4
+ version: 1.0.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-03-01 00:00:00.000000000 Z
11
+ date: 2018-04-01 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."