{"id":13400117,"url":"https://github.com/github/gemoji","last_synced_at":"2025-05-15T09:00:17.302Z","repository":{"id":2044097,"uuid":"2981455","full_name":"github/gemoji","owner":"github","description":"Emoji images and names.","archived":false,"fork":false,"pushed_at":"2024-07-22T14:47:03.000Z","size":25920,"stargazers_count":4450,"open_issues_count":15,"forks_count":787,"subscribers_count":487,"default_branch":"master","last_synced_at":"2025-05-10T12:01:48.140Z","etag":null,"topics":["emoji","ruby","rubygem","unicode"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/github.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-12-14T17:04:35.000Z","updated_at":"2025-05-09T09:57:24.000Z","dependencies_parsed_at":"2024-01-11T17:42:26.821Z","dependency_job_id":"d68f1cf9-f68f-4118-a62a-4216a083ae87","html_url":"https://github.com/github/gemoji","commit_stats":{"total_commits":370,"total_committers":49,"mean_commits":7.551020408163265,"dds":0.6918918918918919,"last_synced_commit":"0eca75db9301421efc8710baf7a7576793ae452a"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fgemoji","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fgemoji/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fgemoji/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fgemoji/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github","download_url":"https://codeload.github.com/github/gemoji/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253568243,"owners_count":21928899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emoji","ruby","rubygem","unicode"],"created_at":"2024-07-30T19:00:48.549Z","updated_at":"2025-05-15T09:00:17.141Z","avatar_url":"https://github.com/github.png","language":"Ruby","readme":"gemoji\n======\n\nThis library contains character information about native emojis.\n\n\nInstallation\n------------\n\nAdd `gemoji` to your Gemfile.\n\n``` ruby\ngem 'gemoji'\n```\n\n\nExample Rails Helper\n--------------------\n\nThis would allow emojifying content such as: `it's raining :cat:s and :dog:s!`\n\nSee the [Emoji cheat sheet](http://www.emoji-cheat-sheet.com) for more examples.\n\n```ruby\nmodule EmojiHelper\n  def emojify(content)\n    h(content).to_str.gsub(/:([\\w+-]+):/) do |match|\n      if emoji = Emoji.find_by_alias($1)\n        %(\u003cimg alt=\"#$1\" src=\"#{image_path(\"emoji/#{emoji.image_filename}\")}\" style=\"vertical-align:middle\" width=\"20\" height=\"20\" /\u003e)\n      else\n        match\n      end\n    end.html_safe if content.present?\n  end\nend\n```\n\nUnicode mapping\n---------------\n\nTranslate emoji names to unicode and vice versa.\n\n```ruby\n\u003e\u003e Emoji.find_by_alias(\"cat\").raw\n=\u003e \"🐱\"  # Don't see a cat? That's U+1F431.\n\n\u003e\u003e Emoji.find_by_unicode(\"\\u{1f431}\").name\n=\u003e \"cat\"\n```\n\nAdding new emoji\n----------------\n\nYou can add new emoji characters to the `Emoji.all` list:\n\n```ruby\nemoji = Emoji.create(\"music\") do |char|\n  char.add_alias \"song\"\n  char.add_unicode_alias \"\\u{266b}\"\n  char.add_tag \"notes\"\nend\n\nemoji.name #=\u003e \"music\"\nemoji.raw  #=\u003e \"♫\"\nemoji.image_filename #=\u003e \"unicode/266b.png\"\n\n# Creating custom emoji (no Unicode aliases):\nemoji = Emoji.create(\"music\") do |char|\n  char.add_tag \"notes\"\nend\n\nemoji.custom? #=\u003e true\nemoji.image_filename #=\u003e \"music.png\"\n```\n\nAs you create new emoji, you must ensure that you also create and put the images\nthey reference by their `image_filename` to your assets directory.\n\nYou can customize `image_filename` with:\n\n```ruby\nemoji = Emoji.create(\"music\") do |char|\n  char.image_filename = \"subdirectory/my_emoji.gif\"\nend\n```\n\nFor existing emojis, you can edit the list of aliases or add new tags in an edit block:\n\n```ruby\nemoji = Emoji.find_by_alias \"musical_note\"\n\nEmoji.edit_emoji(emoji) do |char|\n  char.add_alias \"music\"\n  char.add_unicode_alias \"\\u{266b}\"\n  char.add_tag \"notes\"\nend\n\nEmoji.find_by_alias \"music\"       #=\u003e emoji\nEmoji.find_by_unicode \"\\u{266b}\"  #=\u003e emoji\n```\n","funding_links":[],"categories":["Ruby","emoji","Video Usage","Gems","Emojis"],"sub_categories":["8. Emoji Usage","Rails"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fgemoji","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub%2Fgemoji","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fgemoji/lists"}