Skip to content

Commit

Permalink
Get emoji list & aliases from data file instead of symlinks
Browse files Browse the repository at this point in the history
Previously, emoji name & unicode aliases were determined by following
symlinks among `images/emoji/*.png`. This led to nontrivial code for
resolving these aliases, made it tricky for contributors to add new
aliases and inspect existing ones, and didn't leave room for adding
metadata to emojis such as tags or descriptions from the Unicode spec.

Moreover, the aliases as symlinks led to duplication of image assets in
users' applications, with `hocho.png` and `knife.png` representing the
same emoji but being two separate images. Users were also unsure what to
do with `unicode/{HEX-NAME}.png` files, which would end up among their
images after running the `:emoji` task.

This change removes the symlinks support and creates the list of emojis
and their aliases in `emoji.json`. A single emoji is now represented with
an Emoji::Character instance, which has the `image_filename` method to
determine the path to the corresponding image instead of having to
construct it manually.
  • Loading branch information
mislav committed Jun 27, 2014
1 parent c8c9805 commit 2fad57e
Show file tree
Hide file tree
Showing 7 changed files with 8,458 additions and 54 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,3 @@ Translate emoji names to unicode and vice versa.
>> Emoji.name_for("\u{1f431}")
=> "cat"
```

Note: These will only work if you install gemoji from github. In your Gemfile, for example: `gem 'gemoji', github: 'github/gemoji'`.
Loading

0 comments on commit 2fad57e

Please sign in to comment.