Compare commits

..

274 Commits

Author SHA1 Message Date
Zack Koppert
0eca75db93 Merge pull request #273 from github/dependabot-c67993ba-56b8-4f4e-a911-22640b185a14
Enable Dependabot
2024-04-02 10:52:47 -07:00
Zack Koppert
4e8e6b07eb Create dependabot.yaml 2024-01-09 21:17:56 -08:00
Mislav Marohnić
5476a66d27 gemoji 4.1.0 2023-03-29 14:56:48 +02:00
Mislav Marohnić
ee6e06c648 Merge pull request #262 from github/skin-tones-couple
Support skin tones for 🧑‍🤝‍🧑 emoji
2023-03-29 14:50:39 +02:00
Mislav Marohnić
da33f740a3 Support skin tones for 🧑‍🤝‍🧑 emoji 2023-03-29 14:47:00 +02:00
Mislav Marohnić
07b49d7de7 Merge pull request #261 from github/unicode-15
Import Emoji 15.0 characters
2023-03-29 12:17:44 +02:00
Mislav Marohnić
cb5c514d47 Import Emoji 15.0 characters 2023-03-29 12:14:38 +02:00
Mislav Marohnić
ed57eb86fd gemoji 4.0.1 2022-11-22 12:08:59 +01:00
Per Lundberg
33caddce20 Fix Ruby 2.6 breakage (#255)
Beginless ranges are a Ruby 2.7 feature and should be avoided in this gem which has `required_ruby_version = '> 1.9'`.
2022-11-22 12:02:59 +01:00
Mislav Marohnić
ac35c33c44 gemoji 4.0.0 2022-11-16 14:35:13 +01:00
Mislav Marohnić
70eb18cf81 Merge pull request #165 from github/skin-tones
Add skin tones support
2022-11-15 21:03:30 +01:00
Mislav Marohnić
d04fd7701e Merge pull request #253 from github/tests-refresh
Touch up emoji integrity tests
2022-11-15 21:01:09 +01:00
Mislav Marohnić
744495f776 Expand skin tones support
- Lookup emoji by unicode that contains a skin tone modifier
- Generate skin tone variants from an emoji
2022-11-15 20:41:33 +01:00
Mislav Marohnić
ea4d73899a People holding hands emoji doesn't seem to support skin tones rendering (macOS) 2022-11-15 20:40:52 +01:00
Mislav Marohnić
d7ca116556 Merge remote-tracking branch 'origin' into skin-tones 2022-11-15 19:21:39 +01:00
Mislav Marohnić
f7a6bb68c0 🔥 unused variable 2022-11-15 18:46:47 +01:00
Mislav Marohnić
a8d55fd539 Disallow dashes in new emoji aliases 2022-11-15 18:46:23 +01:00
Mislav Marohnić
5f3415f5fe Account for the addition of 🫃 2022-11-15 18:45:45 +01:00
Mislav Marohnić
9917299963 Merge pull request #244 from kardeslik/import-emoji-14
Import Emoji 14.0 characters
2022-11-15 18:30:26 +01:00
Mislav Marohnić
e13ac61ebd Merge pull request #252 from github/ci-update
Update Ruby CI testing setup
2022-11-15 18:29:27 +01:00
Mislav Marohnić
6af51fcecd Add tags to Unicode 14 2022-11-15 18:25:34 +01:00
Mislav Marohnić
a166a06499 Update Ruby CI testing setup 2022-11-15 18:03:48 +01:00
Mislav Marohnić
44c22eac93 🔥 Travis CI 2022-11-15 18:03:43 +01:00
Emmar Kardeslik
1c3519c6bb Import Emoji 14.0 characters 2022-07-26 12:43:16 +03:00
Kristján Oddsson
55bb37afa4 gemoji 4.0.0.rc3 2021-07-26 12:08:11 +01:00
Kristján Oddsson
64cd0e9ccf Merge pull request #209 from imageneratext/master
Import Emoji 13.1 characters
2021-07-26 12:00:14 +01:00
franciscorode
0f2f9ce047 Import Emoji 13.1 characters 2021-04-17 21:37:45 +02:00
Mislav Marohnić
b1c7878afe Change envelope and email alias (#185) 2020-10-07 17:08:43 +02:00
Job
ce6c4ab12a Changed canonical alias for email emoji 2020-08-26 09:49:07 +02:00
Job
4c47a26900 Added email tag to envelope for compatibility 2020-08-20 11:59:49 +02:00
Job
2a97e7e98c Fix indent 2020-08-20 11:57:23 +02:00
Job
f6fa963350 Move email alias from envelope to e-mail 2020-08-20 11:53:04 +02:00
Mislav Marohnić
2eb30abcd1 Merge pull request #181 from PurpleBooth/piñata-to-pinata
Safely transliterate international characters for aliases
2020-07-31 17:19:59 +02:00
Mislav Marohnić
59ef859169 Set up CI via GitHub Actions (#183) 2020-07-31 17:15:15 +02:00
Billie Thompson
be99618db3 Convert none ascii characters safely to their ASCII representation
Relates-to: github/gemoji#180
2020-07-30 22:06:23 +02:00
Kristján Oddsson
3675a8781f Merge pull request #182 from PurpleBooth/only-pinjata
Remove underscore from Pinata
2020-07-30 10:48:03 +01:00
Billie Thompson
7f6550fe73 Remove underscore from Pinata
Relates-to: github/gemoji#180
2020-07-30 08:46:57 +02:00
Mislav Marohnić
5361b5639f gemoji 4.0.0.rc2 2020-01-31 03:29:58 +01:00
Mislav Marohnić
955be747f2 Merge branch 'charvp/master' 2020-01-31 03:29:23 +01:00
Mislav Marohnić
d98617abf2 Bring back bride_with_veil for backwards compatibility 2020-01-31 03:26:58 +01:00
Charlotte Van Petegem
bf598c57fc Import Emoji 13.0 characters
https://emojipedia.org/emoji-13.0/
2020-01-30 14:16:34 +01:00
Mislav Marohnić
d371b81198 gemoji 4.0.0.rc1 2019-11-29 18:38:34 +01:00
Mislav Marohnić
cefc4b015e Merge branch 'unicode-12.1' 2019-11-29 18:37:18 +01:00
Mislav Marohnić
d1002aa48c Simplify emoji-test-parser 2019-11-29 17:44:55 +01:00
Mislav Marohnić
3cde479627 Import Unicode 12.1 characters
https://emojipedia.org/emoji-12.1/
2019-11-29 13:24:35 +01:00
Mislav Marohnić
cbf7fb30b9 Revert "Merge pull request #164 from github/mislav/text-glyphs"
This reverts commit d48b0d90ac, reversing
changes made to 03dea3bd7d.
2019-11-29 13:24:35 +01:00
Kristján Oddsson
59b3fde91e Merge pull request #169 from JuanitoFatas/fix-emoji-test-parser
Fix ArgumentError in emoji-test-parser
2019-09-16 09:29:00 +01:00
Juanito Fatas
f9e41a8739 Fix ArgumentError in emoji-test-parser 2019-09-16 14:32:34 +09:00
Mislav Marohnić
0a24792305 gemoji 4.0.0.pre0 2019-07-05 10:32:29 +02:00
Mislav Marohnić
d48b0d90ac Merge pull request #164 from github/mislav/text-glyphs
Prefer `emoji.raw` without VARIATION SELECTOR 16
2019-07-03 20:11:32 +02:00
Mislav Marohnić
a5865153a2 Add Emoji::Character#skin_tones? 2019-07-03 18:28:34 +02:00
Mislav Marohnić
37b14e495b Ensure that emoji can't be looked up by their text glyph 2019-07-03 18:26:48 +02:00
Mislav Marohnić
fd84af55cf Regenerate emoji.json with shorter sequences 2019-07-03 17:57:25 +02:00
Mislav Marohnić
b37659ccd8 Use shortest possible sequence as emoji.raw representation 2019-07-03 17:57:25 +02:00
Mislav Marohnić
5766d15e27 Explicitly list glyphs to render as text when no VARIATION_SELECTOR_16 2019-07-03 17:37:56 +02:00
Mislav Marohnić
03dea3bd7d Merge pull request #161 from jhawthorn/dedup
Freeze and dedup strings
2019-07-03 15:34:12 +02:00
John Hawthorn
69009d4c1e Freeze and dedup strings 2019-05-15 16:16:37 -07:00
Mislav Marohnić
22b920f8bd Merge pull request #158 from github/rm-custom-emoji
Remove custom emoji
2019-05-06 18:47:57 +02:00
Mislav Marohnić
55a00803d8 Merge pull request #159 from github/unicode-12
Add Unicode 12 emoji
2019-05-05 03:47:38 +02:00
Mislav Marohnić
6f5518a9ed Add new Unicode 12 emoji 2019-05-05 03:26:18 +02:00
Mislav Marohnić
ff9b85268e Reorder existing emoji based on Unicode 12 2019-05-05 03:13:27 +02:00
Mislav Marohnić
c8cebe22eb Ensure that dump.rb accounts for all existing emoji.json entries 2019-05-05 03:12:43 +02:00
Mislav Marohnić
28a179180b Skip emoji-test.txt entries that are variations of skin tones 2019-05-05 03:11:46 +02:00
Mislav Marohnić
b801800935 Pull in emoji-test.txt for Unicode 12 2019-05-05 03:04:09 +02:00
Mislav Marohnić
16c382b744 Remove obsolete information 2019-05-05 02:28:19 +02:00
Mislav Marohnić
0f9400398e 🔥 extractor logic
We no longer ship any images to extract.
2019-05-05 02:28:19 +02:00
Mislav Marohnić
040aebef64 🔥 custom emoji
On GitHub.com, people predominantly use `:octocat:` and `:shipit:`, but
other custom emoji not as much. These two most used custom emoji also
happen to be specific to the GitHub brand, so it makes more sense that
we add them as custom emoji in the app itself rather than shipping them
with the gemoji library.
2019-05-05 02:28:19 +02:00
Mislav Marohnić
4b2d44d272 🔥 integrity tests
These were tied to the logic that extracts PNG images from Apple font
2019-05-05 02:02:03 +02:00
Mislav Marohnić
987463b50b 🔥 obsolete scripts 2019-05-05 01:58:35 +02:00
Mislav Marohnić
3bc9fe0694 Merge pull request #155 from github/no-apple
Deprecate Apple Palette and upgrade to Emoji 11.
2019-05-05 01:47:18 +02:00
Mislav Marohnić
e55d1457ab Vendor emoji-test.txt from Unicode.org so it can be used in tests 2019-05-05 01:27:01 +02:00
Mislav Marohnić
444ad5b1f4 Fix tests 2019-05-05 01:05:06 +02:00
Mislav Marohnić
e2911b66f2 Generate sequences with alternate VARIATION_SELECTOR_16 positioning 2019-05-05 01:05:06 +02:00
Mislav Marohnić
3e67cc2a60 Regenerate emoji.json 2019-05-05 01:05:06 +02:00
Mislav Marohnić
e5eb1e8bcf Cleanup in constants 2019-05-04 17:50:33 +02:00
Mislav Marohnić
f00846a597 Avoid reusing existing emoji in dump.rb 2019-05-04 17:49:45 +02:00
Mislav Marohnić
4301394495 Symbolize keys when parsing data file 2019-05-02 15:08:04 +02:00
Mislav Marohnić
294b5c4c5c Clean up hacks around gendered emoji 2019-05-02 14:54:06 +02:00
Mislav Marohnić
6ac95753f0 Remove palette method
This represented Apple's palette of characters before, but now has no
purpose since the `Emoji.all` list plus categories represents the
character palette recommendation from Unicode.
2019-05-02 14:52:12 +02:00
Mislav Marohnić
3e7a9bebe2 Parse emoji-test.txt from Unicode 2019-05-02 14:30:27 +02:00
Kristján Oddsson
70b65c3b10 Unicode 11 emojis 2019-05-02 14:30:27 +02:00
Mislav Marohnić
d582f48cbf Merge pull request #137 from nicolasleger/patch-1
Test build on new Ruby versions
2019-05-02 10:36:17 +02:00
Mislav Marohnić
a3cefa60de Ruby versions in CI without patch numbers 2019-05-02 10:23:16 +02:00
Mislav Marohnić
3668746720 Merge pull request #156 from ashmaroli/interpolate-regex-once
Interpolate gender-variation regex just once
2019-05-02 10:20:46 +02:00
Mislav Marohnić
1a652be3dc Merge pull request #152 from ashmaroli/frozen-string-literals
Freeze string literals when using a modern Ruby
2019-05-02 09:51:51 +02:00
Mislav Marohnić
df9d9491e8 Merge pull request #154 from ashmaroli/module-private-constant
Use Module#private_constant to hide constants
2019-05-02 09:51:26 +02:00
Ashwin Maroli
667d62c1a6 Interpolate gender-variation regex just once 2019-04-28 11:59:19 +05:30
Kristján Oddsson
8d7c6fa4e3 bump version 2019-04-25 11:19:03 +01:00
Kristján Oddsson
21c4e27ee2 Merge pull request #151 from github/policewoman-is-also-a-cop
👮‍♀️ Add "police", "law" and "cop" as tags for 👮‍♀️
2019-04-25 11:18:16 +01:00
Ashwin Maroli
7c91775a0b Use Module#private_constant to hide constants 2019-04-22 15:50:47 +05:30
Ashwin Maroli
afc91a5235 Freeze string literals when using a modern Ruby 2019-04-22 14:47:59 +05:30
Kristján Oddsson
aed88bb347 add "police", "law" and "cop" as tags for 👮‍♀️ 2019-04-18 08:38:24 +01:00
Mike McQuaid
b04991b001 Merge pull request #140 from github/contributing-license
CONTRIBUTING: note license.
2018-02-16 09:30:59 +00:00
Mike McQuaid
8d6aff3fc6 CONTRIBUTING: note license.
This is to be more explicit about the contribution process and license.
2018-02-16 09:09:16 +00:00
Nicolas Leger
3f8feffc48 Test build on new Ruby versions 2018-01-08 10:23:45 +01:00
Joshua Peek
3f6057146c Merge pull request #125 from github/sass
Add "sassy" alias to information desk people
2017-05-22 09:32:14 -07:00
Joshua Peek
61e16ae891 Add "sassy" alias to information desk people 2017-05-20 19:47:16 -07:00
Mislav Marohnić
9b8ad85de0 Merge branch 'unicode-aliases'
Fixes #122
2017-04-21 16:32:11 +02:00
Mislav Marohnić
09125ab983 Fix rendering of custom emoji in db/index.html 2017-04-21 16:31:32 +02:00
Mislav Marohnić
b9ce241bf1 Regenerate emoji.json with minimal raw representations
If a raw representation of emoji includes VARIATION SELECTOR 16, but a
browser would render it as a color emoji even without that character,
drop the VARIATION SELECTOR 16 from the raw representation.
2017-04-21 16:31:32 +02:00
Mislav Marohnić
ed954928d7 Improve script for detecting supported unicode aliases 2017-04-21 16:31:31 +02:00
Mislav Marohnić
7858e79566 Merge pull request #116 from skunkmb/master
Add a laugh alias and a hooray alias to 😄 and 🎉
2017-02-16 12:00:55 +01:00
Skunk
7bdd3f657f Use tags instead of aliases for laugh and hooray
As mentioned by @mislav in github/gemoji#116, too many aliases can be
tricky, but tags don’t need to be unique. Therefore, replace new aliases
with new tags for the recently changed 😄 and 🎉 emoji.
2017-02-15 16:23:33 -08:00
Skunk
68af9e3320 Add a laugh alias and a hooray alias to 😄 and 🎉
In the GitHub Reactions menu, there are six emoji: 👍, 👎, 😄, 🎉, 😕, and
❤️. However, two out of the six (😄 and 🎉) have descriptions (“Laugh”
and “Hooray”) that do not actually correspond to Gemoji aliases. Add new
aliases to those two Gemoji so that they directly correspond to the
GitHub Reactions.
2017-02-12 08:41:46 -08:00
Mislav Marohnić
7d27517382 gemoji 3.0.0 2016-12-21 17:14:05 +01:00
Mislav Marohnić
53325ab398 Allow specifying image size to extract 2016-12-21 17:12:58 +01:00
Mislav Marohnić
09f66fc38a gemoji 3.0.0.rc2 2016-12-20 17:36:21 +01:00
Mislav Marohnić
342b76f06e Merge branch 'ios-10.2' 2016-12-20 17:34:49 +01:00
Mislav Marohnić
6b556ba8b2 Update integrity test
These images are finally no longer identical.
2016-12-20 17:34:00 +01:00
Mislav Marohnić
74a321c07a Fix filling in emoji that historically had default gender
Now in iOS 10.2 there are gendered emoji that don't have a default
genderless unicode variant.
2016-12-20 17:34:00 +01:00
Mislav Marohnić
7e10d1a38a Change egg in a pan to "fried_egg" since "egg" is now an emoji 2016-12-20 17:34:00 +01:00
Mislav Marohnić
8ff20db97f Add new iOS 10.2 emoji 2016-12-20 17:34:00 +01:00
Mislav Marohnić
492e18f849 Reorder existing emoji according to iOS 10.2 palette 2016-12-20 17:34:00 +01:00
Mislav Marohnić
cf852befd9 Improve dump script for new emoji 2016-12-20 17:33:52 +01:00
Mislav Marohnić
9d313238bd Remove Gemfile.lock from version control
I don't like that Bundler now makes Gemfile.lock change whenever I bump
up gemoji version. There aren't many dependencies, so a missing
Gemfile.lock won't slow down CI too much.
2016-12-20 15:15:28 +01:00
Alexander Kotov
840655ad6b Fix NoMethodError in multithreading
Fixes #109, closes #111
2016-12-20 15:13:35 +01:00
Mislav Marohnić
f394c85d80 Fix Gemfile.lock 2016-09-30 13:18:43 -04:00
Mislav Marohnić
42a606c804 Merge pull request #99 from mikeastock/fix-sierra-typo
Fix typo in README of Sierra
2016-09-30 08:17:27 -09:00
Michael Stock
21c4cfe247 Fix typo in README of Sierra 2016-09-29 23:14:17 -07:00
Mislav Marohnić
31a6c8b97b gemoji 3.0.0.rc1 2016-09-29 17:48:13 -04:00
Mislav Marohnić
36d295f2b7 There are no more Apple images included in the project
References #61
2016-09-29 17:21:16 -04:00
Mislav Marohnić
d3b9f412c9 Merge branch 'ios-10'
Closes #96, closes #93, closes #77, closes #61

References #72
2016-09-29 17:11:06 -04:00
Mislav Marohnić
a71ba68b6d Expose extra Emoji::Character metadata fields
`category`, `description`, `ios_version`, `unicode_version`
2016-09-29 17:04:39 -04:00
Mislav Marohnić
380fd48cfd Skip image integrity tests on non-macOS platforms
Only run integrity tests if the local `images/unicode` directory exists.
2016-09-29 16:50:19 -04:00
Mislav Marohnić
1e485abfe0 images/emoji/*.pngimages/*.png 2016-09-29 16:50:19 -04:00
Mislav Marohnić
537ccc48ed Replace rake emoji task with a new gemoji executable
The availability of `gemoji extract` command allows easy extraction of
emoji assets into non-Rails applications.
2016-09-29 16:50:19 -04:00
Mislav Marohnić
9cf53bf513 Strip zero-width joiner from Emoji::Character#image_filename 2016-09-29 15:41:51 -04:00
Mislav Marohnić
0e72fb70cc Improve test for invalid or duplicate aliases 2016-09-29 15:41:51 -04:00
Mislav Marohnić
8db519ecbe Add unicode alias for emoji that has implicit gender
Some emoji have gendered variants, but their default rendering (when
they don't include a gender symbol) is using a specific gender for
historic reasons. Ensure that these emoji contain a representation with
explicit gender symbol in their `unicode_aliases`.

Example: ensures that "sleuth or spy" (1F575) is also found as:

    1F575: sleuth or spy
     FE0F: variation selector-16
     200D: zero width joiner
     2642: male sign
     FE0F: variation selector-16
2016-09-29 15:41:51 -04:00
Mislav Marohnić
d0d9227065 Finalize new extractor script mapping glyphs to emoji 2016-09-29 15:41:51 -04:00
Mislav Marohnić
72e9749225 Fix images extractor for macOS Sierra
The TTFunk dependency didn't have support for parsing `ttc` files. Now
parsing is done manually and there is no dependencies.
2016-09-29 15:39:45 -04:00
Mislav Marohnić
16c7e21e5e Remove images extracted from Apple Color Emoji font
These won't ship with the library anymore. Instead, the library ships
with a script that extracts these from macOS Sierra.
2016-09-29 15:39:45 -04:00
Mislav Marohnić
cb3ab19847 Provide public API for Apple's character palette data 2016-09-29 15:39:44 -04:00
Mislav Marohnić
9ffd0e63aa Import emoji up to and including iOS 10 2016-09-29 15:39:44 -04:00
Mislav Marohnić
50865e8895 Merge pull request #86 from marconilanna/patch-1
🍊 tangerine aliases: orange and mandarin
2016-02-26 15:58:37 +09:00
Mislav Marohnić
a76d5f02f4 Try Ruby "2.3.0" instead of just "2.3"
https://travis-ci.org/github/gemoji/jobs/111940056
2016-02-26 15:54:30 +09:00
Mislav Marohnić
be21932d23 Run on new Travis infrastructure 2016-02-26 15:51:35 +09:00
Mislav Marohnić
ee403f0b7d Test against Ruby 2.3.x in CI 2016-02-05 14:52:43 +11:00
Mislav Marohnić
75d8b4374b Tweak script/bootstrap 2016-02-05 14:52:21 +11:00
Marconi Lanna
6de1de2fa1 🍊 tangerine aliases: orange and mandarin
Reference: http://emojipedia.org/tangerine/

> Also Known As
>
> Mandarin Emoji
> Orange Emoji
2016-02-04 09:01:31 -05:00
Mislav Marohnić
be21f6efc6 Merge pull request #82 from github/alias_ng_woman_for_no_good
consistency with 🙆‍♀️
2015-11-13 20:13:20 -05:00
Jason Salaz
f21379209f consistency with 🙆‍♀️ 2015-10-29 20:46:41 -06:00
Mislav Marohnić
b84bf23a5b Merge pull request #81 from jeffmcneill/master
Add "pout" as an alias to the "pouting face" emoji
2015-10-05 14:30:01 +02:00
Jeff McNeill
b05ddab3b9 Merge pull request #1 from jeffmcneill/jeffmcneill-patch-1
Add "pout" as an alias to the "pouting face" emoji
2015-10-05 18:37:21 +07:00
Jeff McNeill
365c7a184c Add "pout" as an alias to the "pouting face" emoji
The use of the term "rage" is not the same semantically, though the Apple implementation of "pouting face" is essentially the "angry face" plus color red. However, other implementations have more "pouting"-like visages, and so use of "pout" would be helpful.
2015-10-05 18:36:58 +07:00
Mislav Marohnić
3db7811891 Merge pull request #79 from gavingmiller/master
Escape mkdir paths for rake emoji task
2015-08-03 14:22:35 -07:00
Gavin Miller
22e198644d Escape mkdir paths for rake emoji task
In the event that someone tries to copy the gemoji emoji's into their
project using the rake emoji task, if that person has braces ( or ) in
the path, the task will fail. Example of error:

sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `mkdir -p /Users/gmiller/Dropbox (Personal)/projects/gavinmiller.io/public/images &&
  cp -Rp /Users/gmiller/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/gemoji-2.1.0/images/emoji
  /Users/gmiller/Dropbox (Personal)/projects/gavinmiller.io/public/images'

By escaping the paths in the rake task, this problem no longer occurs.
2015-08-03 12:10:09 -06:00
Mislav Marohnić
677084b5ed Merge pull request #78 from mixmaxhq/jeff/fix_skin_tone_emoji
Fix image filename lookups for default emoji.
2015-07-21 12:31:18 -07:00
Jeff Wear
859778cc4b Fix image filename lookups for default emoji.
"Default emoji" == emoji that can be modified with skin tone modifiers.
2015-07-21 12:03:30 -07:00
Brandon Keepers
a8204fd8d3 Merge pull request #76 from github/code-of-conduct
Add code of conduct to contributing guidelines
2015-07-20 10:02:26 -07:00
Brandon Keepers
694f862f73 Add code of conduct to contributing guidelines 2015-07-08 14:19:45 -04:00
Mislav Marohnić
11b4f69f5a Merge pull request #68 from github/taco
🌮
2015-02-28 15:02:47 +13:00
Mislav Marohnić
4e6ce27ed6 Merge pull request #69 from janko-m/patch-1
Use image_path instead of asset_path in readme
2015-01-26 15:17:40 -08:00
Janko Marohnić
9308a10b52 Use image_path instead of asset_path in readme
In Rails 4.2 `#asset_path` has changed. Prior to Rails 4.2,
`#asset_path` would search all asset directories, and prepend the
appropriate asset type directory name to the result:

  asset_path("emoji/unicode/<id>.png")
  #=> "/images/emoji/unicode/<id>.png"

However, In Rails 4.2 `#asset_path` doesn't do that anymore, and assumes
that you've specified the correct folder. Since Emoji images are copied
to public/images/emoji/unicode, `#asset_path` would then generate the
wrong URL path:

  asset_path("emoji/unicode/<id>.png")
  #=> "/emoji/unicode/<id>.png"

Using `#image_path` fixes that, because that method looks specifically
for images/ folder, so it will find the Emoji images.
2015-01-26 23:53:48 +01:00
Mislav Marohnić
b841e20394 Merge pull request #67 from elektronaut/add-gif-support
Add support for non-PNG assets
2014-12-12 13:53:39 -08:00
Inge Jørgensen
ac3620cf89 Make image_filename customizable 2014-12-12 22:31:34 +01:00
Mislav Marohnić
60a473bfe5 🌮
http://www.glitchthegame.com/items/food/cold-taco/

Released under the public domain: http://www.glitchthegame.com/licensing/
2014-12-11 23:01:13 -08:00
Joshua Peek
df1b6fac6e Merge pull request #66 from asianmack/basecamp
Add emoji for :basecamp: and :basecampy:
2014-11-06 12:36:50 -08:00
Jamie Dihiansan
eda537e1a9 Add :basecamp: and :basecampy: to emoji.json 2014-11-06 12:49:49 -06:00
Jamie Dihiansan
9967b2ef28 Add emoji for :basecamp: and :basecampy: 2014-11-06 12:25:44 -06:00
Javan Makhmali
d41a53d459 Merge pull request #65 from tricknotes/ruby-2.2
Test against Ruby 2.2 on Travis CI
2014-10-23 09:44:44 -05:00
Ryunosuke SATO
06a2df3427 Test against Ruby 2.2 on Travis CI 2014-10-21 00:21:16 +09:00
Mislav Marohnić
757584d2b9 Merge pull request #63 from github/extractor
Extract PNG images from Apple's "Apple Color Emoji.ttf" font
2014-10-16 15:50:52 +02:00
Mislav Marohnić
f5092b7aa4 Tweak extractor.rb code style 2014-10-16 13:06:20 +02:00
Mislav Marohnić
8a9a8572aa Run the rest of the PNGs through ImageOptim
Command used:

    $ imageOptim -a -d images/emoji/
2014-09-25 10:19:41 -07:00
Mislav Marohnić
3d35b9f862 Simplify special case for "black_medium_square" in checksum test 2014-09-25 10:19:41 -07:00
Javan Makhmali
5dea160045 Update test for expected identical emoji checksums 2014-09-25 10:19:41 -07:00
Javan Makhmali
6984758915 Extract and optimize PNGs from "Apple Color Emoji.ttf"
Commands used:

    $ rake images:extract
    $ imageOptim -a -d images/emoji/unicode/

This required both ImageOptim and ImageAlpha to be installed as OS X apps.
2014-09-25 10:17:30 -07:00
Javan Makhmali
29c25127d0 Automate extracting PNG images from "Apple Color Emoji.ttf" 2014-09-25 10:17:29 -07:00
Mislav Marohnić
701f434b60 gemoji 2.1.0 2014-08-06 17:56:17 -07:00
Mislav Marohnić
112cc8fb8b Replace MAINTAINING with CONTRIBUTING 2014-08-06 17:54:19 -07:00
Mislav Marohnić
5162959546 Refactor test to remove Ruby syntax warning 2014-08-06 17:38:26 -07:00
Mislav Marohnić
75ada7cc89 Merge pull request #60 from github/resolve-unicode-aliases
Resolve the emoji.json "unicodes" mess
2014-08-06 17:24:48 -07:00
Mislav Marohnić
0bb789e3e6 Convert applescript to plain text format
So that it's readable and diffable from the web interface

[ci skip]
2014-08-06 07:51:55 -07:00
Mislav Marohnić
9beb9c0172 Remove need for explicit "unicodes" aliases in emoji.json
We now operate on a new set of assumptions:

- Characters with VARIATION_SELECTOR_15 shouldn't render as emoji, even
  if OS X doesn't respect that currently. This removes explicit aliases
  that include VARIATION_SELECTOR_15.

- VARIATION_SELECTOR_16 is optional for most characters to render as
  emoji on OS X. For those that *don't* have it optional, we include
  VARIATION_SELECTOR_16 in their raw representation in `emoji.json`.
  Other characters list their form including VARIATION_SELECTOR_16
  implicitly in `unicode_aliases`.

- For emoji that consist of 2 characters + variation selector, we assume
  that the selector can come between the 2 characters or *after* them,
  so `find_by_unicode` now supports both forms.

- The `db/aliases.html` script ensures that `emoji.json` only contains
  characters that Safari on OS X actually renders as emojis.
2014-08-06 00:08:47 -07:00
Mislav Marohnić
ea70c98946 Only create canvas elements of just the size required to create an emoji
Otherwise canvas element defaults to a larger size.
2014-08-06 00:08:47 -07:00
Mislav Marohnić
7d416739ba Merge pull request #59 from github/script-tools
Add useful tools to `script/*`
2014-08-06 00:08:11 -07:00
Mislav Marohnić
96295d7871 Add script/release 2014-08-05 23:51:22 -07:00
Mislav Marohnić
584939127e Add script/regenerate to rebuild db/emoji.json database
Uses AppleScript to open Safari and filter the emojis by whether they
render as actual emoji on OS X or not.
2014-08-05 23:25:35 -07:00
Mislav Marohnić
680d1bc59b Add script/console for experimentation from Ruby 2014-08-05 23:08:01 -07:00
Mislav Marohnić
2c58377420 Configure Travis CI to use script/test 2014-08-05 23:07:39 -07:00
Mislav Marohnić
3bb3cea8d3 Add script/bootstrap & script/test 2014-08-05 23:06:52 -07:00
Mislav Marohnić
5e6dcae949 Merge pull request #58 from github/plain-copyright
Don't treat plain "(c)" symbol or similar as emoji
2014-08-05 22:29:50 -07:00
Mislav Marohnić
2aaf9693a9 Ruby 1.9 compat in tests 2014-08-05 22:27:01 -07:00
Mislav Marohnić
0d1a82dc6a Don't treat plain "(c)" symbol or similar as emoji
Unless these characters are followed by VARIATION SELECTOR-16, which
indicates that the should be rendered as emoji, OS X renders these
characters using plain font glyphs.

Previously we assumed that the emoji list we get from
`Category-Emoji.json` (OS X emoji character picker) are all valid emoji,
but for some reason some plain Unicode characters are included in there
without being suffixed with VARIATION SELECTOR-16.
2014-08-05 22:16:54 -07:00
Mislav Marohnić
6b9cdd6eb5 Rename PNGs on disk to not contain VARIATION_SELECTOR_16
Even if the emoji contains it, the filename on disk doesn't have to.
This will reduce having to keep renaming PNGs on disk while we tweak the
emoji database in the future in regard to which are required to have
VARIATION_SELECTOR_16 and which are not.
2014-08-05 22:16:27 -07:00
Mislav Marohnić
75f837e6b5 Improve failure message for images on disk test 2014-08-05 22:16:27 -07:00
Mislav Marohnić
c2286e7c5b Fix failure message in tests
This got broken by Emoji::Character API change in
3935375ca8
2014-08-05 20:29:17 -07:00
Adam Roben
3e21d95409 Merge pull request #56 from github/match-osx-behavior
Use the same unicode aliases as Safari 7.0.5 on OS X 10.9.4
2014-08-01 23:06:51 -04:00
Adam Roben
a86999a7f1 Fix tests 2014-08-01 14:11:13 -04:00
Adam Roben
b7c2b8e4d8 Remove incorrect unicode aliases
db/aliases.html now clears out any incorrect aliases it finds.
2014-08-01 13:56:38 -04:00
Adam Roben
1212951bc6 Use the same unicode aliases as Safari 7.0.5 on OS X 10.9.4
Category-Emoji.json contains many code point sequences ending in U+FE0F
VARIATION SELECTOR-16. OS X renders some of these code point sequences
as color emoji even if you strip off VARIATION SELECTOR-16. (And in fact
it even renders some of them as color emoji if you replace VARIATION
SELECTOR-16 with VARIATION SELECTOR-15, even though that is explicitly
requesting a "text" variant of the character).

We used to assume that VARIATION SELECTOR-16 was optional for all emoji.
But this doesn't match OS X's behavior. This could cause problems, e.g.,
if you were to use the unicode_aliases property to detect Unicode emoji
and replace them with images for browsers that don't support emoji
natively.

The Ruby code no longer does anything special with VARIATION SELECTOR-16
other than to remove it from the description of each emoji. The new
db/aliases.html file can be used to determine which the correct Unicode
aliases for each emoji are. That page takes each emoji, generates a set
of variants using VARIATION SELECTOR-16 and VARIATION SELECTOR-15,
and renders each variant into a <canvas> element twice: once with a red
font color, and once with a green font color. If the variant renders the
same way, the OS is rendering the variant as a color emoji, and we add
it to the "unicodes" array for that emoji.

So the new process for generating db/emoji.json is:

1. rake db:dump > tmp
2. mv tmp db/emoji.json
3. open -a Safari db/aliases.html
4. Copy the resulting JSON from Safari
5. pbpaste > db/emoji.json

This ensures that unicode_aliases only contains those code point
sequences which actually render as color emoji on OS X.
2014-08-01 13:37:40 -04:00
Joshua Peek
b1736a387c Merge pull request #54 from jeremy/nil_style_find_api
Change find_by_* to return nil rather than raise an exception
2014-07-19 13:14:51 -07:00
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
Jeremy Kemper
2741be5eb6 Reflect current 2.0.0 release in Gemfile.lock 2014-07-17 17:50:05 -07:00
Mislav Marohnić
58f2f068c1 gemoji 2.0.0 2014-07-04 17:41:23 +08:00
Mislav Marohnić
c5ee5ebb29 Assert that our PNG images are 64x64 px
`shipit.png` is 75 px for some reason, though.
2014-07-04 12:41:27 +08:00
Mislav Marohnić
2b26bb9b0d Fix MD5 checksumming in test that detect duplicates
`Digest::MD5.file` returns an Digest::MD5 instance, not a string
representing the checksum.
2014-07-04 12:09:49 +08:00
Mislav Marohnić
be4946fbbe Actually allow installing the gem on Ruby 2.x you know 2014-07-04 12:09:11 +08:00
Mislav Marohnić
3b65ee2f15 Merge pull request #49 from github/edit-emoji
Add API for adding new / editing existing emoji
2014-07-04 11:54:55 +08:00
Mislav Marohnić
0bea2df7ba Add ability to use Emoji.create without a block 2014-07-04 11:51:20 +08:00
Mislav Marohnić
e9480a983b Merge pull request #51 from phoet/patch-1
fix formatting
2014-07-04 11:43:31 +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
Peter Schröder
77ff183d85 fix formatting 2014-07-02 22:17:35 -04:00
Mislav Marohnić
06c5d0993b Fix some emoji images
/cc @charliesome because I only discovered these mismatches because of
his trains
2014-07-03 00:23:02 +08:00
Mislav Marohnić
f73921aacd Add test that images on disk don't have duplicates 2014-07-02 19:51:36 +08:00
Mislav Marohnić
e2ae300270 Merge pull request #50 from github/preview
HTML page to preview the emoji database
2014-06-28 09:13:41 +08:00
Mislav Marohnić
bbfae32663 HTML page to preview the emoji database 2014-06-28 07:50:16 +08:00
Mislav Marohnić
65031cfcd2 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.
2014-06-28 07:19:58 +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ć
ef06de5305 Merge pull request #48 from github/fire-old-api
🔥 old gemoji API
2014-06-28 06:08:09 +08:00
Mislav Marohnić
097fbafcb7 🔥 old API 2014-06-27 19:09:59 +08:00
Mislav Marohnić
608ddd58fd Update gemspec to fix warnings
- Specifying `licenses` is recommended
- More helpful `summary` and `description`
2014-06-27 19:03:27 +08:00
Mislav Marohnić
72aecc9105 Actually give up on 1.8.7 compatbility
Gemoji implementation depends on `codepoints` and test depend on some
more Ruby 1.9-only features, so don't pretend that the library will be
1.8 compatible anytime soon. Probably never.

This reverts commit 6a781b6474.
2014-06-27 19:02:05 +08:00
Mislav Marohnić
6a781b6474 Add json gem for 1.8.7 test compatibility 2014-06-27 18:52:36 +08:00
Mislav Marohnić
cb55354db9 Set up minitest gem for 1.8.7 test compatibility 2014-06-27 18:43:58 +08:00
Mislav Marohnić
490b07b49e Disable spam 2014-06-27 18:43:09 +08:00
Mislav Marohnić
1a7a23fd46 Enable Travis CI 2014-06-27 18:36:36 +08:00
Mislav Marohnić
d7b020fd16 Merge pull request #47 from github/no-symlinks
Get emoji list & aliases from data file instead of symlinks
2014-06-27 18:33:17 +08:00
Mislav Marohnić
a9112090fa Tweak tags for some emoji
Ensure that tags accurately describe the original meaning of the emoji
(with respect to its definition from Unicode spec).
2014-06-27 18:25:56 +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ć
2530b24121 Update usage examples in the README with the new API 2014-06-27 11:21:45 +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ć
70db910026 Add dump script to inspect Unicode descriptions & aliases
This script was used to construct the initial `emoji.json` file.

Example:

    rake db:dump | less -r
2014-06-27 11:21:45 +08:00
Mislav Marohnić
0845c3898a Add task to download Unicode 6.3 names list
This list contains textual descriptions for emoji characters.
2014-06-27 11:21:45 +08:00
Mislav Marohnić
07e15fde99 Remove duplicate image for shipit squirrel 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
Mislav Marohnić
c8c9805bfc 🔥 image symlinks
Emoji aliases as symlinks didn't scale.
2014-06-03 02:25:14 +07:00
Mislav Marohnić
f1d0bfedaf Simplify db:generate task and have JSON be human-readable 2014-03-12 12:16:15 +01:00
Trevor Turk
204ace76da Merge pull request #40 from github/use-extant-emoji-in-readme-example
Use extant emoji in the example
2014-02-24 13:34:32 -06:00
Rob Rix
824a0ee189 Use extant emoji in the example 2014-02-24 13:50:01 -05:00
Javan Makhmali
4536894c48 Merge pull request #39 from TheRakken/patch-1
Fixed typo in README.md
2014-02-01 15:12:14 -08:00
TheRakken
28983a9ea9 Fixed typo in README.md 2014-02-02 02:06:43 +03: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
Joshua Peek
73f48e4b57 Merge pull request #38 from github/knife-alias
Alias 🔪 to the same as 🔪
2014-01-30 09:48:00 -08:00
Coby Chapple
633bd4ff33 alias 🔪 to the same as 🔪 2014-01-30 17:10:31 +00:00
Javan Makhmali
8c96cb878f Document unicode mapping 2013-11-16 13:37:41 -05:00
Javan Makhmali
dc06bc9a6b Recursively copy the whole emoji dir, preserving symlinks 2013-11-16 13:10:04 -05:00
Javan Makhmali
7755a8a181 Gemoji 1.5.0 2013-11-10 21:45:17 -05:00
Javan Makhmali
69f625f36c Merge pull request #37 from github/unicode-mapping
Unicode mapping, codepoint fixes, and tests!
2013-11-10 18:43:45 -08:00
Javan Makhmali
13bcea9b4a Make mappings private pending better names 2013-11-10 11:09:48 -05:00
Javan Makhmali
19ddee2bdc Fix up incorrect/mising speaker emojis 2013-11-10 11:05:52 -05:00
Javan Makhmali
9cd56f6e3d Add missing train emoji 2013-11-10 10:49:01 -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
c180447c5b Compare our emoji to emoji straight from the horse's mouth 2013-11-06 09:22:12 -05:00
Javan Makhmali
150c509735 Add missing 🌃 2013-11-05 22:26:25 -05:00
Javan Makhmali
8e098547ad Fix incorrect codepoint for 🌠 2013-11-05 20:50:02 -05:00
Javan Makhmali
968373beae Merge branch 'keycaps' of git://github.com/lautis/gemoji into unicode-mapping 2013-11-05 20:26:19 -05:00
Javan Makhmali
cb85b7b105 Tests to ensure the gem is in good shape. Leave the unicode tests intentionally failing. Fix to follow. 2013-11-05 20:07:56 -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
Ted Nyman
2d799338d9 Update LICENSE for the source code 2013-06-24 14:25:43 -06:00
Joshua Peek
8b45468c6e Merge pull request #28 from rick/master
A more proper take on this 🐬 -> 🐬 thing
2013-02-11 08:19:11 -08:00
Rick Bradley
d7f9549261 Ah -- do the 🐬 symlink thing 2013-02-11 10:15:56 -06:00
Rick Bradley
17946e381b Alias 🐬 -> 🐬
Is this how this works?
2013-02-10 23:45:28 -06:00
Ville Lautanala
f9f0527fbe Fix digit/keycap unicode code points
Emoji digits and # are normal ASCII digits followed by COMBINING ENCLOSING KEYCAP (0x20e3). http://www.unicode.org/~scherer/emoji4unicode/20091221/emojidata.html
2013-01-26 13:40:11 +02:00
Joshua Peek
a844c2c1f7 Gemoji 1.4.0 2013-01-14 22:07:39 -08:00
Joshua Peek
ece49a0f11 Merge pull request #24 from danthompson/non_rails_support
Add non rails support
2013-01-09 13:39:39 -08:00
Dan Thompson
27e6ef7bc0 Remove external dependencies 2013-01-09 16:25:21 -05:00
Jamie Dihiansan
b67f98a130 Merge branch 'master' of https://github.com/github/gemoji 2013-01-08 13:29:03 -06:00
Jamie Dihiansan
282ae85ea0 updated 🖕 to be more explicit 2013-01-08 13:28:49 -06:00
Trevor Turk
baa55a8eda Gemoji 1.3.1 2013-01-08 11:41:55 -06:00
Jamie Dihiansan
4db892b66b Changed dates to 2013 2013-01-08 08:17:28 -06:00
Jamie Dihiansan
8db84353e4 Merge pull request #25 from github/fu
added 🖕
2013-01-08 06:14:14 -08:00
Jamie Dihiansan
7f9b0eaca9 cleaned up fu image 2013-01-08 08:09:15 -06:00
Jamie Dihiansan
3e9c7cc8fb added 🖕 2013-01-07 16:23:38 -06:00
Dan Thompson
808cb099de Remove 'Rails' as rake task no longer requires it 2013-01-07 10:03:43 -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
Julia West
88fce2aa9e Merge pull request #22 from danthompson/typo
Fix readme typo
2013-01-03 14:39:19 -08:00
Dan Thompson
b9fa07e0e2 Fix readme typo 2013-01-03 17:24:44 -05:00
Joshua Peek
6723776d77 Merge pull request #21 from rsenk330/rakefile-desc
Add a description to the emoji rake task.
2012-12-05 05:59:25 -08: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
198d829f42 Load tasks 2012-11-29 11:30:57 -06:00
1753 changed files with 29685 additions and 971 deletions

11
.github/dependabot.yaml vendored Normal file
View File

@@ -0,0 +1,11 @@
---
version: 2
updates:
- package-ecosystem: 'bundler'
directory: '/'
schedule:
interval: 'weekly'
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'

24
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: Test
on: [push, pull_request]
jobs:
test:
strategy:
fail-fast: false
matrix:
ruby: ["2.7", "3.0", "3.1"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
bundler-cache: true
- name: Run tests
run: bundle exec rake

6
.gitignore vendored Normal file
View File

@@ -0,0 +1,6 @@
/bin/*
.bundle
.ruby-version
Gemfile.lock
vendor/*
!vendor/unicode-emoji-test.txt

31
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,31 @@
Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](LICENSE).
Some useful tools in development are:
```
script/bootstrap
```
Sets up the development environment. The prerequisites are:
* Ruby 1.9+
* Bundler
```
script/test
```
Runs the test suite.
```
script/console
```
Opens `irb` console with gemoji library preloded for experimentation.
```
script/release
```
For maintainers only: after the gemspec has been edited, this commits the
change, tags a release, and pushes it to both GitHub and RubyGems.org.

7
Gemfile Normal file
View File

@@ -0,0 +1,7 @@
source "https://rubygems.org"
gem "rake", "~> 10.3.2"
gem "minitest", "~> 5.3.5"
gem "i18n", "~> 1.8.5"
gemspec

25
Gemfile.lock Normal file
View File

@@ -0,0 +1,25 @@
PATH
remote: .
specs:
gemoji (4.1.0)
GEM
remote: https://rubygems.org/
specs:
concurrent-ruby (1.1.7)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
minitest (5.3.5)
rake (10.3.2)
PLATFORMS
ruby
DEPENDENCIES
gemoji!
i18n (~> 1.8.5)
minitest (~> 5.3.5)
rake (~> 10.3.2)
BUNDLED WITH
2.4.10

30
LICENSE
View File

@@ -1,14 +1,22 @@
octocat, squirrel, shipit
Copyright (c) 2012 GitHub Inc. All rights reserved.
Copyright (c) 2019 GitHub, Inc.
bowtie, neckbeard
Copyright (c) 2012 37signals, LLC. All rights reserved.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
feelsgood, finnadie, goberserk, godmode, hurtrealbad, rage 1-4, suspect
Copyright (c) 2012 id Software. All rights reserved.
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
trollface
Copyright (c) 2012 whynne@deviantart. All rights reserved.
All other images
Copyright (c) 2012 Apple Inc. All rights reserved.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,27 +0,0 @@
# Maintainers
## Releasing a new gem
If you are just adding new emoji or making a small fix, only increment the patch level "1.0.x". If you need to rename a ton of emojis or making any other radical (but still mostly backwards compatible changes), bump the minor version "1.x.x".
### Make a release commit
To prepare the release commit, edit the [gemoji.gemspec](https://github.com/github/gemoji/blob/master/gemoji.gemspec) `version` value. Then make a single commit with the description as "Gemoji 1.x.x". Finally, tag the commit with `v1.x.x`.
Example commit https://github.com/github/gemoji/commit/v1.0.0
```
$ git ci -m "Gemoji 1.0.0"
$ git tag v1.0.0
$ git push
$ git push --tags
```
### Publish the gem
Build and push the new gem with
```
$ gem build gemoji.gemspec
$ gem push gemoji-1.0.0.gem
```

100
README.md
View File

@@ -1,54 +1,32 @@
gemoji
======
Emoji images and names. See the LICENSE for copyright information.
This library contains character information about native emojis.
Installation
------------
Add `gemoji` to you Gemfile.
Add `gemoji` to your Gemfile.
``` ruby
gem 'gemoji'
```
**Sync images**
Images can be copied to your public directory with `rake emoji` in your Rails app. This is the recommended approach since the images will be available at a consistent location. This works best with cached formatted user content generated by tools like [html-pipeline](https://github.com/jch/html-pipeline).
**Assets Precompiling**
If you must, you can manually add all the images to your asset load path.
``` ruby
# config/application.rb
config.assets.paths << Emoji.images_path
```
Then have them compiled to public on deploy.
``` ruby
# config/application.rb
config.assets.precompile << "emoji/*.png"
```
**WARNING** Since there are a ton of images, just adding the path may slow down other lookups if you aren't using it. Compiling all the emojis on deploy will add overhead to your deploy if even the images haven't changed. Theres just so many more superfluous files to iterate over. Also, the urls will be fingerprinted which many not be ideal for referencing from cached content.
Example Rails Helper
--------------------
This would allow emojifying content such as: `it's raining :cats: and :dogs:!`
This would allow emojifying content such as: `it's raining :cat:s and :dog:s!`
See the [Emoji cheat sheet](http://www.emoji-cheat-sheet.com) for more examples.
```ruby
module EmojiHelper
def emojify(content)
h(content).to_str.gsub(/:([a-z0-9\+\-_]+):/) do |match|
if Emoji.names.include?($1)
'<img alt="' + $1 + '" height="20" src="' + asset_path("emoji/#{$1}.png") + '" style="vertical-align:middle" width="20" />'
def emojify(content)
h(content).to_str.gsub(/:([\w+-]+):/) do |match|
if emoji = Emoji.find_by_alias($1)
%(<img alt="#$1" src="#{image_path("emoji/#{emoji.image_filename}")}" style="vertical-align:middle" width="20" height="20" />)
else
match
end
@@ -56,3 +34,67 @@ module EmojiHelper
end
end
```
Unicode mapping
---------------
Translate emoji names to unicode and vice versa.
```ruby
>> Emoji.find_by_alias("cat").raw
=> "🐱" # Don't see a cat? That's U+1F431.
>> Emoji.find_by_unicode("\u{1f431}").name
=> "cat"
```
Adding new emoji
----------------
You can add new emoji characters to the `Emoji.all` list:
```ruby
emoji = Emoji.create("music") do |char|
char.add_alias "song"
char.add_unicode_alias "\u{266b}"
char.add_tag "notes"
end
emoji.name #=> "music"
emoji.raw #=> "♫"
emoji.image_filename #=> "unicode/266b.png"
# Creating custom emoji (no Unicode aliases):
emoji = Emoji.create("music") do |char|
char.add_tag "notes"
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.
You can customize `image_filename` with:
```ruby
emoji = Emoji.create("music") do |char|
char.image_filename = "subdirectory/my_emoji.gif"
end
```
For existing emojis, you can edit the list of aliases or add new tags in an edit block:
```ruby
emoji = Emoji.find_by_alias "musical_note"
Emoji.edit_emoji(emoji) do |char|
char.add_alias "music"
char.add_unicode_alias "\u{266b}"
char.add_tag "notes"
end
Emoji.find_by_alias "music" #=> emoji
Emoji.find_by_unicode "\u{266b}" #=> emoji
```

View File

@@ -1,7 +1,24 @@
desc "Checks for missing aliases to unicode sources"
task :unnamed do
unicodes = Dir["./images/emoji/unicode/*.png"].map { |fn| File.basename(fn) }
aliases = Dir["./images/emoji/*.png"].select { |fn| File.symlink?(fn) }.map { |fn| File.basename(fn) }
used_unicodes = aliases.map { |name| File.basename(File.readlink("./images/emoji/#{name}")) }.uniq
puts unicodes - used_unicodes
require 'rake/testtask'
task :default => :test
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList["test/*_test.rb"]
end
namespace :db do
desc %(Generate Emoji data files needed for development)
task :generate => [
'vendor/unicode-emoji-test.txt',
]
desc %(Dump a list of supported Emoji with Unicode descriptions and aliases)
task :dump => :generate do
system 'ruby', '-Ilib', 'db/dump.rb'
end
end
file 'vendor/unicode-emoji-test.txt' do |t|
system 'curl', '-fsSL', 'http://unicode.org/Public/emoji/15.0/emoji-test.txt', '-o', t.name
end

69
db/dump.rb Normal file
View File

@@ -0,0 +1,69 @@
# frozen_string_literal: true
require "i18n"
require 'emoji'
require 'json'
require_relative './emoji-test-parser'
I18n.config.available_locales = :en
items = []
_, categories = EmojiTestParser.parse(File.expand_path("../../vendor/unicode-emoji-test.txt", __FILE__))
seen_existing = {}
for category in categories
for sub_category in category[:emoji]
for emoji_item in sub_category[:emoji]
raw = emoji_item[:sequences][0]
existing_emoji = Emoji.find_by_unicode(raw) || Emoji.find_by_unicode("#{raw}\u{fe0f}")
if seen_existing.key?(existing_emoji)
existing_emoji = nil
else
seen_existing[existing_emoji] = true
end
description = emoji_item[:description].sub(/^E\d+(\.\d+)? /, '')
output_item = {
emoji: raw,
description: description,
category: category[:name],
}
if existing_emoji
output_item.update(
aliases: existing_emoji.aliases,
tags: existing_emoji.tags,
unicode_version: existing_emoji.unicode_version,
ios_version: existing_emoji.ios_version,
)
else
output_item.update(
aliases: [I18n.transliterate(description).gsub(/\W+/, '_').downcase],
tags: [],
unicode_version: "15.0",
ios_version: "16.4",
)
end
output_item[:skin_tones] = true if emoji_item[:skin_tones]
items << output_item
end
end
end
missing_emoji = Emoji.all.reject { |e| e.custom? || seen_existing.key?(e) }
if missing_emoji.any?
$stderr.puts "Error: these `emoji.json` entries were not matched:"
$stderr.puts missing_emoji.map { |e| "%s (%s)" % [e.hex_inspect, e.name] }
exit 1
end
for emoji in Emoji.all.select(&:custom?)
items << {
aliases: emoji.aliases,
tags: emoji.tags,
}
end
trap(:PIPE) { abort }
puts JSON.pretty_generate(items)
.gsub("\n\n", "\n")
.gsub(/,\n( +)/) { "\n%s, " % $1[2..-1] }

117
db/emoji-test-parser.rb Normal file
View File

@@ -0,0 +1,117 @@
# frozen_string_literal: true
module EmojiTestParser
VARIATION_SELECTOR_16 = "\u{fe0f}"
SKIN_TONES = [
"\u{1F3FB}", # light skin tone
"\u{1F3FC}", # medium-light skin tone
"\u{1F3FD}", # medium skin tone
"\u{1F3FE}", # medium-dark skin tone
"\u{1F3FF}", # dark skin tone
]
SKIN_TONES_RE = /(#{SKIN_TONES.join("|")})/o
SKIP_TYPES = ["unqualified", "component"]
module_function
def parse(filename)
File.open(filename, "r:UTF-8") do |file|
parse_file(file)
end
end
def parse_file(io)
data = []
emoji_map = {}
category = nil
sub_category = nil
io.each do |line|
begin
if line.start_with?("# group: ")
_, group_name = line.split(":", 2)
category = {
name: group_name.strip,
emoji: [],
}
data << category
sub_category = nil
elsif line.start_with?("# subgroup: ")
_, group_name = line.split(":", 2)
sub_category = {
name: group_name.strip,
emoji: [],
}
category[:emoji] << sub_category
elsif line.start_with?("#") || line.strip.empty?
next
else
row, desc = line.split("#", 2)
desc = desc.strip.split(" ", 2)[1]
codepoints, qualification = row.split(";", 2)
next if SKIP_TYPES.include?(qualification.strip)
emoji_raw = codepoints.strip.split.map { |c| c.hex }.pack("U*")
emoji_normalized = emoji_raw
.gsub(VARIATION_SELECTOR_16, "")
.gsub(SKIN_TONES_RE, "")
emoji_item = emoji_map[emoji_normalized]
if SKIN_TONES.any? { |s| emoji_raw.include?(s) }
emoji_item[:skin_tones] = true if emoji_item
next
end
if emoji_item
emoji_item[:sequences] << emoji_raw
else
emoji_item = {
sequences: [emoji_raw],
description: desc,
}
emoji_map[emoji_normalized] = emoji_item
sub_category[:emoji] << emoji_item
end
end
rescue
warn "line: %p" % line
raise
end
end
[emoji_map, data]
end
end
if $0 == __FILE__
html_output = false
if ARGV[0] == "--html"
ARGV.shift
html_output = true
end
_, categories = EmojiTestParser.parse(File.expand_path("../../vendor/unicode-emoji-test.txt", __FILE__))
trap(:PIPE) { abort }
if html_output
puts "<!doctype html>"
puts "<meta charset=utf-8>"
for category in categories
puts "<h2>#{category[:name]}</h2>"
for sub_category in category[:emoji]
puts "<h3>#{sub_category[:name]}</h3>"
puts "<ol>"
for char in sub_category[:emoji]
puts "<li>"
for sequence in char[:sequences]
codepoints = sequence.unpack("U*").map { |c| c.to_s(16).upcase }.join(" ")
printf '<span class=emoji title="%s">%s</span> ', codepoints, sequence
end
puts "#{char[:description]}</li>"
end
puts "</ol>"
end
end
else
require "json"
puts JSON.pretty_generate(categories)
end
end

23479
db/emoji.json Normal file
View File

File diff suppressed because it is too large Load Diff

113
db/index.html Normal file
View File

@@ -0,0 +1,113 @@
<!doctype html>
<title>Emoji preview</title>
<style type="text/css">
body {
font: 14px/18px Verdana, Arial, sans-serif;
padding: 2em;
}
ol {
list-style: none;
padding-left: 0;
}
li {
margin-left: 0;
margin-top: 5px;
clear: left;
}
li:first-child { display: none; }
li > span {
display: block;
}
.emoji {
font-size: 50px;
line-height: 50px;
float: left;
margin-right: 20px;
}
.description {
font-style: italic;
color: gray;
}
.aliases span:before, .aliases span:after {
content: ":";
color: gray;
}
.tags {
font-size: 11px;
}
.tags span {
display: inline-block;
padding: 1px 5px 2px;
border-radius: 3px;
background: #dadada;
line-height: 11px;
}
</style>
<p><input type=search placeholder="Search..."></p>
<ol>
<li>
<span class="emoji"></span>
<span class="description"></span>
<span class="aliases"></span>
<span class="tags"></span>
</li>
</ol>
<script>
function renderEmoji(emojis) {
var item, els, template = document.querySelector('li')
for (var emoji, i=0; i < emojis.length; i++) {
emoji = emojis[i]
item = template.cloneNode(true)
els = item.querySelectorAll('span')
if (emoji.emoji) els[0].textContent = emoji.emoji
else {
var img = document.createElement('img')
img.src = "../images/" + emoji.aliases[0] + ".png"
els[0].appendChild(img)
}
els[1].textContent = emoji.description || ''
els[2].innerHTML = emoji.aliases.map(function(n){ return '<span>'+n+'</span>' }).join(' ')
els[3].innerHTML = emoji.tags.map(function(n){ return '<span>'+n+'</span>' }).join(' ')
template.parentNode.appendChild(item)
item._emojiText = (els[2].textContent + ' ' + els[3].textContent).replace(/_/g, '-')
}
}
xhr = new XMLHttpRequest
xhr.onreadystatechange = function() {
if (this.readyState == 4) {
json = JSON.parse(this.responseText)
renderEmoji(json)
}
}
xhr.open('GET', 'emoji.json', false)
xhr.send(null)
function searchEmoji(query) {
var el,
re = new RegExp('\\b' + query),
els = document.querySelectorAll('li')
for (var i=1; i < els.length; i++) {
el = els[i]
if ( !query || re.test(el._emojiText) ) {
el.style.display = 'list-item'
} else {
el.style.display = 'none'
}
}
}
var timeout, search = document.querySelector('input[type=search]')
search.addEventListener('input', function() {
var $this = this
if (timeout) clearTimeout(timeout)
timeout = setTimeout(function(){ searchEmoji($this.value) }, 200)
}, false)
search.focus()
</script>

View File

@@ -1,12 +1,20 @@
Gem::Specification.new do |s|
s.name = "gemoji"
s.version = "1.3.0"
s.summary = "Emoji Assets"
s.description = "Emoji assets"
s.version = "4.1.0"
s.summary = "Unicode emoji library"
s.description = "Character information and metadata for Unicode emoji."
s.required_ruby_version = '> 1.9'
s.authors = ["GitHub"]
s.email = "support@github.com"
s.homepage = "https://github.com/github/gemoji"
s.licenses = ["MIT"]
s.files = Dir["README.md", "images/**/*.png", "lib/**/*.rb", "lib/tasks/*.rake"]
s.files = Dir[
"README.md",
"LICENSE",
"db/emoji.json",
"lib/**/*.rb",
]
end

View File

@@ -1 +0,0 @@
unicode/1f44d.png

View File

@@ -1 +0,0 @@
unicode/1f44e.png

View File

@@ -1 +0,0 @@
unicode/1f4af.png

View File

@@ -1 +0,0 @@
unicode/1f522.png

View File

@@ -1 +0,0 @@
unicode/1f3b1.png

View File

@@ -1 +0,0 @@
unicode/1f170.png

View File

@@ -1 +0,0 @@
unicode/1f18e.png

View File

@@ -1 +0,0 @@
unicode/1f524.png

View File

@@ -1 +0,0 @@
unicode/1f521.png

View File

@@ -1 +0,0 @@
unicode/1f251.png

View File

@@ -1 +0,0 @@
unicode/1f6a1.png

View File

@@ -1 +0,0 @@
unicode/2708.png

View File

@@ -1 +0,0 @@
unicode/23f0.png

View File

@@ -1 +0,0 @@
unicode/1f47d.png

View File

@@ -1 +0,0 @@
unicode/1f691.png

View File

@@ -1 +0,0 @@
unicode/2693.png

View File

@@ -1 +0,0 @@
unicode/1f47c.png

View File

@@ -1 +0,0 @@
unicode/1f4a2.png

View File

@@ -1 +0,0 @@
unicode/1f620.png

View File

@@ -1 +0,0 @@
unicode/1f627.png

View File

@@ -1 +0,0 @@
unicode/1f41c.png

View File

@@ -1 +0,0 @@
unicode/1f34e.png

View File

@@ -1 +0,0 @@
unicode/2652.png

View File

@@ -1 +0,0 @@
unicode/2648.png

View File

@@ -1 +0,0 @@
unicode/25c0.png

View File

@@ -1 +0,0 @@
unicode/23ec.png

View File

@@ -1 +0,0 @@
unicode/23eb.png

View File

@@ -1 +0,0 @@
unicode/2b07.png

View File

@@ -1 +0,0 @@
unicode/1f53d.png

View File

@@ -1 +0,0 @@
unicode/25b6.png

View File

@@ -1 +0,0 @@
unicode/2935.png

View File

@@ -1 +0,0 @@
unicode/2934.png

View File

@@ -1 +0,0 @@
unicode/2b05.png

View File

@@ -1 +0,0 @@
unicode/2199.png

View File

@@ -1 +0,0 @@
unicode/2198.png

View File

@@ -1 +0,0 @@
unicode/27a1.png

View File

@@ -1 +0,0 @@
unicode/21aa.png

View File

@@ -1 +0,0 @@
unicode/2b06.png

View File

@@ -1 +0,0 @@
unicode/2195.png

View File

@@ -1 +0,0 @@
unicode/1f53c.png

View File

@@ -1 +0,0 @@
unicode/2196.png

View File

@@ -1 +0,0 @@
unicode/2197.png

View File

@@ -1 +0,0 @@
unicode/1f503.png

View File

@@ -1 +0,0 @@
unicode/1f504.png

View File

@@ -1 +0,0 @@
unicode/1f3a8.png

View File

@@ -1 +0,0 @@
unicode/1f69b.png

View File

@@ -1 +0,0 @@
unicode/1f632.png

View File

@@ -1 +0,0 @@
unicode/1f45f.png

View File

@@ -1 +0,0 @@
unicode/1f3e7.png

View File

@@ -1 +0,0 @@
unicode/1f171.png

View File

@@ -1 +0,0 @@
unicode/1f476.png

View File

@@ -1 +0,0 @@
unicode/1f37c.png

View File

@@ -1 +0,0 @@
unicode/1f424.png

View File

@@ -1 +0,0 @@
unicode/1f6bc.png

View File

@@ -1 +0,0 @@
unicode/1f519.png

View File

@@ -1 +0,0 @@
unicode/1f6c4.png

View File

@@ -1 +0,0 @@
unicode/1f388.png

View File

@@ -1 +0,0 @@
unicode/2611.png

View File

@@ -1 +0,0 @@
unicode/1f38d.png

View File

@@ -1 +0,0 @@
unicode/1f34c.png

View File

@@ -1 +0,0 @@
unicode/203c.png

View File

@@ -1 +0,0 @@
unicode/1f3e6.png

View File

@@ -1 +0,0 @@
unicode/1f4ca.png

View File

@@ -1 +0,0 @@
unicode/1f488.png

View File

@@ -1 +0,0 @@
unicode/26be.png

View File

@@ -1 +0,0 @@
unicode/1f3c0.png

View File

@@ -1 +0,0 @@
unicode/1f6c0.png

View File

@@ -1 +0,0 @@
unicode/1f6c1.png

View File

@@ -1 +0,0 @@
unicode/1f50b.png

View File

@@ -1 +0,0 @@
unicode/1f43b.png

View File

@@ -1 +0,0 @@
unicode/1f41d.png

View File

@@ -1 +0,0 @@
unicode/1f37a.png

View File

@@ -1 +0,0 @@
unicode/1f37b.png

View File

@@ -1 +0,0 @@
unicode/1f41e.png

View File

@@ -1 +0,0 @@
unicode/1f530.png

View File

@@ -1 +0,0 @@
unicode/1f514.png

View File

@@ -1 +0,0 @@
unicode/1f371.png

View File

@@ -1 +0,0 @@
unicode/1f6b4.png

View File

@@ -1 +0,0 @@
unicode/1f6b2.png

View File

@@ -1 +0,0 @@
unicode/1f459.png

View File

@@ -1 +0,0 @@
unicode/1f426.png

View File

@@ -1 +0,0 @@
unicode/1f382.png

View File

@@ -1 +0,0 @@
unicode/26ab.png

View File

@@ -1 +0,0 @@
unicode/1f0cf.png

View File

@@ -1 +0,0 @@
unicode/2b1b.png

Some files were not shown because too many files have changed in this diff Show More