Commit Graph

84 Commits

Author SHA1 Message Date
Jeremy Kemper
f9aba615af Change find_by_* to return nil rather than raise an exception.
This is a breaking API change.

You probably have code that looks like
  if emoji = Emoji.find_by_alias($1) { nil }
that you can change to
  if emoji = Emoji.find_by_alias($1)
2014-07-18 09:16:21 -07:00
Mislav Marohnić
0bea2df7ba Add ability to use Emoji.create without a block 2014-07-04 11:51:20 +08:00
Mislav Marohnić
3935375ca8 Change emoji creation API to take name as 1st argument
It's more likely that someone will want to add a new emoji with a custom
image rather than a character that has a Unicode representation.

Also move the VARIATION_SELECTOR_16 logic outside of Emoji::Character
since it doesn't need to be concerned with it.
2014-07-03 18:13:55 +08:00
Mislav Marohnić
7477247802 Add API for adding new / editing existing emoji
- Emoji.create(raw) => yields to block
- Emoji.edit_emoji(emoji) => yields to block

The block forms are so that the list of aliases & unicode_aliases is
re-indexed after the update.
2014-06-28 07:19:58 +08:00
Mislav Marohnić
097fbafcb7 🔥 old API 2014-06-27 19:09:59 +08:00
Mislav Marohnić
01394ed139 Have unicode_aliases include emoji's raw representation as well
This brings it up to par with `aliases`, which includes `name` as well.
2014-06-27 11:21:46 +08:00
Mislav Marohnić
5d2401222a Improve emoji lookup fallback behavior
Instead of an unfriendly LocalJumpError, raise the Emoji::NotFound
exception with a helpful message if the block was not given.

If a fallback block was given, yield the value for which the lookup failed.
2014-06-27 11:21:45 +08:00
Mislav Marohnić
2fad57ed49 Get emoji list & aliases from data file instead of symlinks
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.
2014-06-27 11:21:45 +08:00
Javan Makhmali
11c08bdd2f Shell out to cp ourself.
The output from using FileUtil's `cp_r` with the previous options was `cp -rp --remove-destination`, which aren't even valid options.
2014-01-30 17:31:09 -05:00
Trevor Turk
c77cd152ba Use old hash syntax for Ruby 1.8 compatibility 2014-01-30 15:12:37 -06:00
Javan Makhmali
dc06bc9a6b Recursively copy the whole emoji dir, preserving symlinks 2013-11-16 13:10:04 -05:00
Javan Makhmali
13bcea9b4a Make mappings private pending better names 2013-11-10 11:09:48 -05:00
Javan Makhmali
56da9a86e3 Add support for the unicode variation selector (fe0f) added to 107 emojis in iOS 7 / OS X 10.9.
http://www.unicode.org/L2/L2011/11438-emoji-var.pdf
http://unicode.org/reports/tr28/tr28-3.html#13_7_variation_selectors
2013-11-10 10:04:11 -05:00
Javan Makhmali
bfbc8c5e98 Convert emoji names to unicode and vice versa. Add some *gasp* tests. h/t @mbillard 2013-11-05 20:00:37 -05:00
Dan Thompson
27e6ef7bc0 Remove external dependencies 2013-01-09 16:25:21 -05:00
Dan Thompson
8441803d17 Update target path to not rely on Rails constant 2013-01-07 09:57:37 -05:00
Dan Thompson
8781d47ddb add environment task
appends to or creates when not already present (no-op)
2013-01-07 09:41:40 -05:00
Ryan Senkbeil
5179cd8159 Add a description to the emoji rake task.
This makes it show up when using `rake -T`.
2012-12-04 13:42:50 -06:00
Joshua Peek
6d538220a2 🔥 railtie 2012-11-29 10:42:52 -06:00
Joshua Peek
cf1632ef7a railtie 2012-11-29 10:23:41 -06:00
Joshua Peek
892ac6274d Copy unicode images too 2012-11-14 17:50:21 -06:00
Joshua Peek
91a5a025ca Add emoji path to assets group
Closes #15
2012-11-12 12:49:29 -06:00
Joshua Peek
24cb142c5e Fix rake task path 2012-10-02 17:05:39 -05:00
Joshua Peek
ed273dee14 Fix config paths 2012-10-02 16:28:39 -05:00
Joshua Peek
b5542d5075 Assets not, config 2012-10-02 16:24:21 -05:00
Joshua Peek
e21a63645c Add images path directly 2012-10-02 16:20:53 -05:00
Joshua Peek
971bcd6236 Separate railtie file 2012-10-02 16:20:51 -05:00
Joshua Peek
38731ced7e Stub gemoji require 2012-10-02 15:15:41 -05:00
Trevor Turk
bd929a9ee0 require emoji in the task 2012-10-01 16:57:41 -05:00
Trevor Turk
436209c12f require environment instead of emoji 2012-10-01 16:51:21 -05:00
Trevor Turk
24d9881f20 move rake task so we can require it in our apps 2012-10-01 16:42:43 -05:00
Joshua Peek
e46c8207fc Just images/emoji 2012-09-28 10:00:59 -05:00
Joshua Peek
8c15ced399 Add rake copy task 2012-09-28 09:53:41 -05:00
Joshua Peek
765df113e1 Remove stuff 2012-09-28 09:36:54 -05:00
Trevor Turk
ffaef44107 use replace for sprite and emojify for images 2012-08-01 11:45:06 -05:00
Joshua Peek
2f1da81b8c Fix dir again 2012-08-01 11:43:43 -05:00
Joshua Peek
092e292fd5 Use real images dir for names listing 2012-08-01 11:39:30 -05:00
Trevor Turk
e9f37b4d57 emoji images instead of sprite for apps using asset pipeline 2012-07-31 14:49:27 -05:00
Trevor Turk
458ab7b45f rake for asset updates 2012-07-31 11:46:49 -05:00
Trevor Turk
35b0491318 rake for new stuff 2012-07-31 11:29:49 -05:00
Julia West
ca875c651f Resizing some new emoji. 2012-07-30 14:59:53 -04:00
Julia West
441ab8ea2b Making mailbox emoji more consistent. 2012-07-30 13:27:57 -04:00
Julia West
5eb7314407 Renaming new emoji.
- Cat smilies are equivalent smilies with 'cat' appended.
- Following conventions for arrows, clocks, etc.
- Removing unnecessary modifiers (squared, circled, monkey, etc)
- Adding alias running for runner.
- Removing duplicate hourglass, house, etc.
2012-07-30 13:14:59 -04:00
Julia West
65c7dde87a Making new emoji transparent.
- Removing new sparkle, same as old sparkle.
2012-07-27 18:00:52 -04:00
Julia West
dddaab6479 Updating assets. 2012-07-27 11:28:28 -04:00
Trevor Turk
f7841e2b6e ruby 1.8 compat hash syntax 2012-07-02 17:09:17 -05:00
Trevor Turk
9b1a8de856 updates from running rake to update emoji names 2012-07-02 15:20:09 -05:00
Trevor Turk
ed8e5d08d7 never gonna get it 2012-05-17 16:52:55 -05:00
Trevor Turk
b5d46bd018 space 2012-05-17 16:04:06 -05:00
Trevor Turk
c3204d815c allow emoji with sprite and with standalone images for now 2012-05-17 16:01:52 -05:00