unicode-emoji 1.0.3 โ†’ 1.1.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: 554e71677ee392a78e98e91cf7e6c18fc6f640c5ff9dfc8f3c6b7292276f9488
4
- data.tar.gz: 16bb3e0678d0e7af64d42e128abafca4655f137c37ec54deaeb4f93071256605
3
+ metadata.gz: c6cdca65a25735347a97f077a43c00b1b30c84fa2aa7b688b7072b1af8624d1f
4
+ data.tar.gz: e083a936a9f360ca0348fe6a3f76a12aa2fbf94826cbf30fd31db1abc23d9bc7
5
5
  SHA512:
6
- metadata.gz: 70013e0fee1c503a11bab6ea3782eab8f75bad9889f713aad8d0bf58927296e27410534143b2deb625be13378600b719ad6ac4596975ad96ee7ac65489e3fc79
7
- data.tar.gz: 864ea258665e62242e1a1cc6462a3ed367dfc86302d45a2291f5e7c92657cd7bd919afde0076690a3228b30c2f005847adc6475981ea90c4df036a312afc7669
6
+ metadata.gz: d408fec5b09dd66db4ea61fb476cd5c74570d1cd9f43451732619ea303292afeb28e7d65d56eb012676ecbd2bda61e4e03912f3fae66bb26f51abde5ff85ba6b
7
+ data.tar.gz: 815d375a3de1d1cbedb64ced2530ee2c9c02a52223ced9bff0273231f8de09a135b7043f6159701c76af60046234b353ec14a5ae136aad36f998560e96988841
@@ -1,5 +1,10 @@
1
1
  ## CHANGELOG
2
2
 
3
+ ### 1.1.0
4
+
5
+ - Emoji 11.0
6
+ - Do not depend on rubygems (only use zlib stdlib for unzipping)
7
+
3
8
  ### 1.0.3
4
9
 
5
10
  - Explicitly load rubygems/util, fixes regression in 1.2.1
data/README.md CHANGED
@@ -4,7 +4,7 @@ A small Ruby library which provides Unicode Emoji data and regexes.
4
4
 
5
5
  Also includes a categorized list of recommended Emoji.
6
6
 
7
- Emoji version: **5.0**
7
+ Emoji version: **11.0**
8
8
 
9
9
  Supported Rubies: **2.5**, **2.4**, **2.3**
10
10
 
@@ -48,7 +48,7 @@ Regex | Description | Example Matches | Example Non-Matc
48
48
  `Unicode::Emoji::REGEX_TEXT` | Matches only textual singleton Emoji (except for singleton components, like digit 1) | `๐Ÿ˜ด๏ธŽ`, `โ–ถ` | `๐Ÿ˜ด`, `โ–ถ๏ธ`, `๐Ÿป`, `๐Ÿ›Œ๐Ÿฝ`, `๐Ÿ‡ต๐Ÿ‡น`, `๐Ÿ‡ต๐Ÿ‡ต`,`2๏ธโƒฃ`, `๐Ÿด๓ ง๓ ข๓ ณ๓ ฃ๓ ด๓ ฟ`, `๐Ÿด๓ ง๓ ข๓ ก๓ ง๓ ข๓ ฟ`, `๐Ÿคพ๐Ÿฝโ€โ™€๏ธ`, `๐Ÿค โ€๐Ÿคข`
49
49
  `Unicode::Emoji::REGEX_ANY` | Matches any Emoji-related codepoint (but no variation selectors or tags) | `๐Ÿ˜ด`, `โ–ถ`, `๐Ÿป`, `๐Ÿ›Œ`, `๐Ÿฝ`, `๐Ÿ‡ต`, `๐Ÿ‡น`, `2`, `๐Ÿด`, `๐Ÿคพ`, `โ™€`, `๐Ÿค `, `๐Ÿคข` | -
50
50
 
51
- More info about valid vs. recommended emoji in this [blog article on Emojipedia](http://blog.emojipedia.org/unicode-behind-the-curtain/).
51
+ More info about valid vs. recommended Emoji in this [blog article on Emojipedia](http://blog.emojipedia.org/unicode-behind-the-curtain/).
52
52
 
53
53
  ### List
54
54
 
@@ -65,11 +65,11 @@ Unicode::Emoji.list("Food & Drink", "food-asian")
65
65
  => ["๐Ÿฑ", "๐Ÿ˜", "๐Ÿ™", "๐Ÿš", "๐Ÿ›", "๐Ÿœ", "๐Ÿ", "๐Ÿ ", "๐Ÿข", "๐Ÿฃ", "๐Ÿค", "๐Ÿฅ", "๐Ÿก", "\u{1F95F}", "\u{1F960}", "\u{1F961}"]
66
66
  ```
67
67
 
68
- A markdown file with all recommended emoji can be found [in this gist](https://gist.github.com/janlelis/72f9be1f0ecca07372c64cf13894b801).
68
+ A markdown file with all recommended Emoji can be found [in this gist](https://gist.github.com/janlelis/72f9be1f0ecca07372c64cf13894b801).
69
69
 
70
70
  ### Properties
71
71
 
72
- Allows you to access the codepoint data form Unicode's [emoji-data.txt](http://unicode.org/Public/emoji/5.0/emoji-data.txt) file:
72
+ Allows you to access the codepoint data form Unicode's [emoji-data.txt](http://unicode.org/Public/emoji/11.0/emoji-data.txt) file:
73
73
 
74
74
  ```ruby
75
75
  require "unicode/emoji"
@@ -80,7 +80,7 @@ Unicode::Emoji.properties "โ˜" # => ["Emoji", "Emoji_Modifier_Base"]
80
80
  ## Also See
81
81
 
82
82
  - [Unicodeยฎ Technical Standard #51](http://www.unicode.org/reports/tr51/proposed.html)
83
- - [Emoji data](http://unicode.org/Public/emoji/5.0/)
83
+ - [Emoji data](http://unicode.org/Public/emoji/11.0/)
84
84
  - [Emoji categories](http://unicode.org/emoji/charts/emoji-ordering.html)
85
85
  - Ruby gem which displays [Emoji sequence names](https://github.com/janlelis/unicode-sequence_name)
86
86
  - Part of [unicode-x](https://github.com/janlelis/unicode-x)
Binary file
@@ -6,10 +6,12 @@ require_relative "emoji/index"
6
6
  module Unicode
7
7
  module Emoji
8
8
  PROPERTY_NAMES = {
9
+ E: "Emoji",
9
10
  B: "Emoji_Modifier_Base",
10
11
  M: "Emoji_Modifier",
11
12
  C: "Emoji_Component",
12
13
  P: "Emoji_Presentation",
14
+ X: "Extended_Pictographic",
13
15
  }
14
16
 
15
17
  EMOJI_VARIATION_SELECTOR = 0xFE0F
@@ -19,12 +21,14 @@ module Unicode
19
21
  EMOJI_KEYCAP_SUFFIX = 0x20E3
20
22
  ZWJ = 0x200D
21
23
 
22
- EMOJI_CHAR = INDEX[:PROPERTIES].keys.freeze
24
+ EMOJI_CHAR = INDEX[:PROPERTIES].select{ |ord, props| props.include?(:E) }.keys.freeze
23
25
  EMOJI_PRESENTATION = INDEX[:PROPERTIES].select{ |ord, props| props.include?(:P) }.keys.freeze
24
- TEXT_PRESENTATION = INDEX[:PROPERTIES].select{ |ord, props| !props.include?(:P) }.keys.freeze
26
+ TEXT_PRESENTATION = INDEX[:PROPERTIES].select{ |ord, props| props.include?(:E) && !props.include?(:P) }.keys.freeze
25
27
  EMOJI_COMPONENT = INDEX[:PROPERTIES].select{ |ord, props| props.include?(:C) }.keys.freeze
26
28
  EMOJI_MODIFIER_BASES = INDEX[:PROPERTIES].select{ |ord, props| props.include?(:B) }.keys.freeze
27
29
  EMOJI_MODIFIERS = INDEX[:PROPERTIES].select{ |ord, props| props.include?(:M) }.keys.freeze
30
+ # Not needed right now:
31
+ # EXTENDED_PICTOGRAPHIC = INDEX[:PROPERTIES].select{ |ord, props| props.include?(:X) }.keys.freeze
28
32
  EMOJI_KEYCAPS = INDEX[:KEYCAPS].freeze
29
33
  VALID_REGION_FLAGS = INDEX[:FLAGS].freeze
30
34
  VALID_SUBDIVISIONS = INDEX[:SD].freeze
@@ -131,7 +135,7 @@ module Unicode
131
135
  props = INDEX[:PROPERTIES][ord]
132
136
 
133
137
  if props
134
- ["Emoji"] + props.map{ |prop| PROPERTY_NAMES[prop] }
138
+ props.map{ |prop| PROPERTY_NAMES[prop] }
135
139
  else
136
140
  # nothing
137
141
  end
@@ -2,8 +2,8 @@
2
2
 
3
3
  module Unicode
4
4
  module Emoji
5
- VERSION = "1.0.3".freeze
6
- EMOJI_VERSION = "5.0".freeze
5
+ VERSION = "1.1.0".freeze
6
+ EMOJI_VERSION = "11.0".freeze
7
7
  DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + '/../../../data/').freeze
8
8
  INDEX_FILENAME = (DATA_DIRECTORY + '/emoji.marshal.gz').freeze
9
9
 
@@ -1,10 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rubygems/util'
4
- require_relative 'constants'
3
+ require "zlib"
4
+ require_relative "constants"
5
5
 
6
6
  module Unicode
7
7
  module Emoji
8
- INDEX = Marshal.load(Gem::Util.gunzip(File.binread(INDEX_FILENAME)))
8
+ File.open(INDEX_FILENAME, "rb") do |file|
9
+ serialized_data = Zlib::GzipReader.new(file).read
10
+ serialized_data.force_encoding Encoding::BINARY
11
+ INDEX = Marshal.load(serialized_data)
12
+ end
9
13
  end
10
14
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unicode-emoji
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.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-04-19 00:00:00.000000000 Z
11
+ date: 2018-06-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: "[Emoji 5.0] Retrieve emoji data about Unicode codepoints. Also contains
13
+ description: "[Emoji 11.0] Retrieve emoji data about Unicode codepoints. Also contains
14
14
  a regex to match emoji."
15
15
  email:
16
16
  - mail@janlelis.de