unicode-emoji 2.2.0 → 2.6.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: 19509b0d69c0a7936f00d86c857e09ce901fe8fe054ae218ef9f9a3fbeb83d02
4
- data.tar.gz: 47df3f9305acb0ddf24c7e6e53fb06bfa4cdc64e1b5c7d768522386719290b19
3
+ metadata.gz: 2fb3046ca8836aca666cb064f9adcab5bc4bc0a238c0442b269de0c055203c7b
4
+ data.tar.gz: 7fb3d7a6726cca61c400c7198f5b754a50cce8cb5dc5c7e74e037c7daea8e712
5
5
  SHA512:
6
- metadata.gz: 414b87bb48ef0796bec0febe837107c0500ee59c909b4648f396f5c77a657e77a97840ce7aaef66b9ad64744a6d5d0e678132e3e70b5e89d624313c52909f533
7
- data.tar.gz: d815de65334d9e52ea25754f921ad2a42aca585d1e1110e436886bf3568c2449fe3cd82b5dc4d2c763aeddc05cc37c40b1c6a455555185a68560cc5ee418ef98
6
+ metadata.gz: 6e89d3365011031037920d1a86e35316d54ea609f080c9e8625164c8782f85de1b14d2295858e3934e7baa6e1c27c8ccf8485ea0adf9632d34e8e8211d21b83a
7
+ data.tar.gz: 20f8dc2f79f3578510539ab5911beade994f22b666406a526ab90974c741db4bb11e710eac9c8fc4ae24a1a84061543f89af3f3bda1c4e94d131cc814a44832c
@@ -2,16 +2,19 @@ sudo: false
2
2
  language: ruby
3
3
 
4
4
  rvm:
5
- - 2.6.1
6
- - 2.5.3
7
- - 2.4.5
8
- - 2.3.8
5
+ - 2.7
6
+ - 2.6
7
+ - 2.5
8
+ - 2.4
9
+ - 2.3
9
10
  - ruby-head
10
- - jruby-head
11
- - jruby-9.2.6.0
11
+ - jruby-9.2.11.1
12
+ - truffleruby-20.2.0
12
13
 
13
14
  matrix:
14
15
  allow_failures:
15
- - rvm: jruby-head
16
+ - rvm: 2.4
17
+ - rvm: 2.3
16
18
  - rvm: ruby-head
19
+ - rvm: truffleruby-20.2.0
17
20
  # fast_finish: true
@@ -1,5 +1,26 @@
1
1
  ## CHANGELOG
2
2
 
3
+ ### 2.6.0
4
+
5
+ - Emoji 13.1
6
+
7
+ ### 2.5.0
8
+
9
+ - Use native Emoji regex properties when current Ruby's Emoji support is the same as our current Emoji version
10
+ - Update valid subdivisions to CLDR 37
11
+
12
+ ### 2.4.0
13
+
14
+ - Emoji 13.0
15
+
16
+ ### 2.3.1
17
+
18
+ - Fix index to actually include Emoji 12.1
19
+
20
+ ### 2.3.0
21
+
22
+ - Emoji 12.1
23
+
3
24
  ### 2.2.0
4
25
 
5
26
  - Update subdivisions to CLDR 36
data/Gemfile CHANGED
@@ -4,4 +4,4 @@ gemspec
4
4
 
5
5
  gem "minitest"
6
6
  gem "rake"
7
- gem "irb"
7
+ gem "irb" unless RUBY_ENGINE == "jruby"
@@ -1,4 +1,4 @@
1
- Copyright (c) 2017-2019 Jan Lelis, mail@janlelis.de
1
+ Copyright (c) 2017-2020 Jan Lelis, https://janlelis.com
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,14 +1,16 @@
1
1
  # Unicode::Emoji [![[version]](https://badge.fury.io/rb/unicode-emoji.svg)](https://badge.fury.io/rb/unicode-emoji) [![[travis]](https://travis-ci.org/janlelis/unicode-emoji.svg)](https://travis-ci.org/janlelis/unicode-emoji)
2
2
 
3
- A small Ruby library which provides Unicode Emoji data and regexes.
3
+ Provides Unicode Emoji data and regexes, incorporating the latest Unicode and Emoji standards.
4
4
 
5
5
  Also includes a categorized list of recommended Emoji.
6
6
 
7
- Emoji version: **12.0** (February 2019)
7
+ Emoji version: **13.1** (September 2020)
8
8
 
9
- CLDR version (used for sub-region flags): **36** (October 2019)
9
+ CLDR version (used for sub-region flags): **37** (April 2020)
10
10
 
11
- Supported Rubies: **2.6**, **2.5**, **2.4**, **2.3**
11
+ Supported Rubies: **2.7**, **2.6**, **2.5**
12
+
13
+ No longer supported Rubies, but might still work: **2.4**, **2.3**
12
14
 
13
15
  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.
14
16
 
@@ -114,22 +116,22 @@ Use `Unicode::Emoji::LIST` or the list method to get a grouped (and ordered) lis
114
116
 
115
117
  ```ruby
116
118
  Unicode::Emoji.list.keys
117
- # => ["Smileys & People", "Animals & Nature", "Food & Drink", "Travel & Places", "Activities", "Objects", "Symbols", "Flags"]
119
+ # => ["Smileys & Emotion", "People & Body", "Component", "Animals & Nature", "Food & Drink", "Travel & Places", "Activities", "Objects", "Symbols", "Flags"]
118
120
 
119
121
  Unicode::Emoji.list("Food & Drink").keys
120
- # => ["food-fruit", "food-vegetable", "food-prepared", "food-asian", "food-sweet", "drink", "dishware"]
122
+ # => ["food-fruit", "food-vegetable", "food-prepared", "food-asian", "food-marine", "food-sweet", "drink", "dishware"]
121
123
 
122
124
  Unicode::Emoji.list("Food & Drink", "food-asian")
123
- => ["🍱", "🍘", "🍙", "🍚", "🍛", "🍜", "🍝", "🍠", "🍢", "🍣", "🍤", "🍥", "🍡", "\u{1F95F}", "\u{1F960}", "\u{1F961}"]
125
+ => ["🍱", "🍘", "🍙", "🍚", "🍛", "🍜", "🍝", "🍠", "🍢", "🍣", "🍤", "🍥", "🥮", "🍡", "🥟", "🥠", "🥡"]
124
126
  ```
125
127
 
126
- Please note that categories might change with future versions of the Emoji standard. This gem will issue warnings when attemting to retrieve old categories using the `#list` method.
128
+ Please note that categories might change with future versions of the Emoji standard. This gem will issue warnings when attempting to retrieve old categories using the `#list` method.
127
129
 
128
130
  A list of all Emoji can be found at [character.construction](https://character.construction).
129
131
 
130
132
  ### Properties
131
133
 
132
- Allows you to access the codepoint data form Unicode's [emoji-data.txt](http://unicode.org/Public/emoji/11.0/emoji-data.txt) file:
134
+ Allows you to access the codepoint data form Unicode's [emoji-data.txt](https://www.unicode.org/Public/13.0.0/ucd/emoji/emoji-data.txt) file:
133
135
 
134
136
  ```ruby
135
137
  require "unicode/emoji"
@@ -139,13 +141,12 @@ Unicode::Emoji.properties "☝" # => ["Emoji", "Emoji_Modifier_Base"]
139
141
 
140
142
  ## Also See
141
143
 
142
- - [Unicode® Technical Standard #51](http://www.unicode.org/reports/tr51/proposed.html)
143
- - [Emoji data](http://unicode.org/Public/emoji/11.0/)
144
- - [Emoji categories](http://unicode.org/emoji/charts/emoji-ordering.html)
144
+ - [Unicode® Technical Standard #51](https://www.unicode.org/reports/tr51/proposed.html)
145
+ - [Emoji categories](https://unicode.org/emoji/charts/emoji-ordering.html)
145
146
  - Ruby gem which displays [Emoji sequence names](https://github.com/janlelis/unicode-sequence_name)
146
147
  - Part of [unicode-x](https://github.com/janlelis/unicode-x)
147
148
 
148
149
  ## MIT
149
150
 
150
- - Copyright (C) 2017-2019 Jan Lelis <http://janlelis.com>. Released under the MIT license.
151
- - Unicode data: http://www.unicode.org/copyright.html#Exhibit1
151
+ - Copyright (C) 2017-2020 Jan Lelis <https://janlelis.com>. Released under the MIT license.
152
+ - Unicode data: https://www.unicode.org/copyright.html#Exhibit1
Binary file
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "unicode/version"
4
+
3
5
  require_relative "emoji/constants"
4
6
  require_relative "emoji/index"
5
7
 
@@ -41,14 +43,13 @@ module Unicode
41
43
  LIST = INDEX[:LIST].freeze.each_value(&:freeze)
42
44
  LIST_REMOVED_KEYS = [
43
45
  "Smileys & People",
44
- "Component",
45
46
  ]
46
47
 
47
48
  pack = ->(ord){ Regexp.escape(Array(ord).pack("U*")) }
48
49
  join = -> (*strings){ "(?:" + strings.join("|") + ")" }
49
50
  pack_and_join = ->(ords){ join[*ords.map{ |ord| pack[ord] }] }
50
51
 
51
- if ENABLE_NATIVE_EMOJI_UNICODE_PROPERTIES
52
+ if EMOJI_VERSION == Unicode::Version.emoji_version
52
53
  emoji_character = "\\p{Emoji}"
53
54
  emoji_modifier = "\\p{Emoji Modifier}"
54
55
  emoji_modifier_base = "\\p{Emoji Modifier Base}"
@@ -2,13 +2,11 @@
2
2
 
3
3
  module Unicode
4
4
  module Emoji
5
- VERSION = "2.2.0"
6
- EMOJI_VERSION = "12.0"
7
- CLDR_VERSION = "36"
5
+ VERSION = "2.6.0"
6
+ EMOJI_VERSION = "13.1"
7
+ CLDR_VERSION = "37"
8
8
  DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + "/../../../data/").freeze
9
9
  INDEX_FILENAME = (DATA_DIRECTORY + "/emoji.marshal.gz").freeze
10
-
11
- ENABLE_NATIVE_EMOJI_UNICODE_PROPERTIES = false # As of Ruby 2.6.1, Emoji version 11 is included
12
10
  end
13
11
  end
14
12
 
@@ -88,6 +88,21 @@ describe Unicode::Emoji do
88
88
  "🤠‍🤢 vomiting cowboy" =~ Unicode::Emoji::REGEX
89
89
  assert_equal "🤠", $&
90
90
  end
91
+
92
+ it "matches 12.1 emoji" do
93
+ "🧑‍🦱 person: curly hair" =~ Unicode::Emoji::REGEX
94
+ assert_equal "🧑‍🦱", $&
95
+ end
96
+
97
+ it "matches 13.0 emoji" do
98
+ "👨‍🍼 man feeding baby" =~ Unicode::Emoji::REGEX
99
+ assert_equal "👨‍🍼", $&
100
+ end
101
+
102
+ it "matches 13.1 emoji" do
103
+ "❤️‍🔥 heart on fire" =~ Unicode::Emoji::REGEX
104
+ assert_equal "❤️‍🔥", $&
105
+ end
91
106
  end
92
107
 
93
108
  describe "REGEX_VALID" do
@@ -6,9 +6,9 @@ Gem::Specification.new do |gem|
6
6
  gem.name = "unicode-emoji"
7
7
  gem.version = Unicode::Emoji::VERSION
8
8
  gem.summary = "Retrieve Emoji data about Unicode codepoints."
9
- gem.description = "[Emoji #{Unicode::Emoji::EMOJI_VERSION}] Retrieve emoji data about Unicode codepoints. Also contains a regex to match emoji."
9
+ gem.description = "[Emoji #{Unicode::Emoji::EMOJI_VERSION}] A small Ruby library which provides Unicode Emoji data and regexes, incorporating the latest Unicode and Emoji standards. Includes a categorized list of recommended Emoji."
10
10
  gem.authors = ["Jan Lelis"]
11
- gem.email = ["mail@janlelis.de"]
11
+ gem.email = ["hi@ruby.consulting"]
12
12
  gem.homepage = "https://github.com/janlelis/unicode-emoji"
13
13
  gem.license = "MIT"
14
14
 
@@ -18,4 +18,6 @@ Gem::Specification.new do |gem|
18
18
  gem.require_paths = ["lib"]
19
19
 
20
20
  gem.required_ruby_version = "~> 2.3"
21
+
22
+ gem.add_dependency "unicode-version", "~> 1.0"
21
23
  end
metadata CHANGED
@@ -1,19 +1,34 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unicode-emoji
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.6.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: 2019-10-06 00:00:00.000000000 Z
12
- dependencies: []
13
- description: "[Emoji 12.0] Retrieve emoji data about Unicode codepoints. Also contains
14
- a regex to match emoji."
11
+ date: 2020-09-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: unicode-version
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ description: "[Emoji 13.1] A small Ruby library which provides Unicode Emoji data
28
+ and regexes, incorporating the latest Unicode and Emoji standards. Includes a categorized
29
+ list of recommended Emoji."
15
30
  email:
16
- - mail@janlelis.de
31
+ - hi@ruby.consulting
17
32
  executables: []
18
33
  extensions: []
19
34
  extra_rdoc_files: []
@@ -52,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
52
67
  - !ruby/object:Gem::Version
53
68
  version: '0'
54
69
  requirements: []
55
- rubygems_version: 3.0.3
70
+ rubygems_version: 3.1.2
56
71
  signing_key:
57
72
  specification_version: 4
58
73
  summary: Retrieve Emoji data about Unicode codepoints.