No release in over a year
Emoji data from emoji-datasource (https://github.com/iamcal/emoji-data) npm package
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.14
~> 13.0
~> 3.12
~> 0.22
~> 1.45
 Project Readme

emoji-datasource

Ruby gem for emoji-datasource from NPM package https://github.com/iamcal/emoji-data

Installation

Add this line to your application's Gemfile:

gem 'emoji-datasource'

Usage

Return all emoji data

EmojiDatasource.data

Find emoji by short name

EmojiDatasource.find_by_short_name('+1')
#=> EmojiDatasource::Emoji: :+1: (👍)

Find emoji by raw string:

EmojiDatasource.find_by_char('👍🏾')
#=> EmojiDatasource::Emoji: :+1::skin-tone-5: (👍🏾)

Find emoji by unicode hex character code:

EmojiDatasource.find_by_unified("1F469-200D-2764-FE0F-200D-1F468")
#=> EmojiDatasource::Emoji: :woman-heart-man: (👩‍❤️‍👨)

Convert emoji short name to character

EmojiDatasource.short_name_to_char('+1') # => 👍

this also supports skin variations

EmojiDatasource.short_name_to_char('+1::skin-tone-2') # => 👍🏻

Get base emoji for skin variation:

emoji = EmojiDatasource.find_by_short_name(':+1::skin-tone-5:')
#=> EmojiDatasource::Emoji: :+1::skin-tone-5: (👍🏾)
emoji.base
#=> EmojiDatasource::Emoji: :+1: (👍)

Supported Ruby Versions

This library aims to support and is tested against the following Ruby implementations:

  • Ruby 2.6.0
  • Ruby 2.7.0
  • Ruby 3.0.0
  • Ruby 3.1.0

License

The gem is available as open source under the terms of the MIT License.