Permalink
Browse files

Add documentation note about images for added emoji

It comes down to: if you add new emoji, you must add images for them as
well. That's the whole point.
  • Loading branch information...
1 parent 7477247 commit 65031cfcd2b70f5e11d58027463a3a062b7f8de9 @mislav mislav committed Jun 27, 2014
Showing with 13 additions and 0 deletions.
  1. +12 −0 README.md
  2. +1 −0 test/emoji_test.rb
View
@@ -93,8 +93,20 @@ end
emoji.name #=> "music"
emoji.raw #=> "♫"
+emoji.image_filename #=> "unicode/266b.png"
+
+# Creating custom emoji (not in Unicode spec):
+emoji = Emoji.create(nil) do |char|
+ char.add_alias "music"
+end
+
+emoji.custom? #=> true
+emoji.image_filename #=> "music.png"
```
+As you create new emoji, you must ensure that you also create and put the images
+they reference by their `image_filename` to your assets directory.
+
For existing emojis, you can edit the list of aliases or add new tags in an edit block:
```ruby
View
@@ -100,6 +100,7 @@ class EmojiTest < TestCase
assert_equal emoji, Emoji.find_by_unicode("\u{266b}")
assert_equal "\u{266b}", emoji.raw
+ assert_equal "unicode/266b.png", emoji.image_filename
assert_equal %w[music], emoji.aliases
assert_equal %w[notes eighth], emoji.tags
ensure

0 comments on commit 65031cf

Please sign in to comment.