lib/unicode/emoji.rb in unicode-emoji-2.4.0 vs lib/unicode/emoji.rb in unicode-emoji-2.5.0
- old
+ new
@@ -1,7 +1,9 @@
# frozen_string_literal: true
+require "unicode/version"
+
require_relative "emoji/constants"
require_relative "emoji/index"
module Unicode
module Emoji
@@ -45,10 +47,10 @@
pack = ->(ord){ Regexp.escape(Array(ord).pack("U*")) }
join = -> (*strings){ "(?:" + strings.join("|") + ")" }
pack_and_join = ->(ords){ join[*ords.map{ |ord| pack[ord] }] }
- if ENABLE_NATIVE_EMOJI_UNICODE_PROPERTIES
+ if EMOJI_VERSION == Unicode::Version.emoji_version
emoji_character = "\\p{Emoji}"
emoji_modifier = "\\p{Emoji Modifier}"
emoji_modifier_base = "\\p{Emoji Modifier Base}"
emoji_component = "\\p{Emoji Component}"
emoji_presentation = "\\p{Emoji Presentation}"