diff --git a/.gitignore b/.gitignore index 40b89d24..cce1fd74 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /bin/* -!/bin/gemoji .bundle .ruby-version Gemfile.lock diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 95e75fd0..9665c0d2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,11 +1,5 @@ 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). -This project adheres to the [Open Code of Conduct][code-of-conduct]. By participating, you are expected to uphold this code. -[code-of-conduct]: http://todogroup.org/opencodeofconduct/#gemoji/opensource@github.com - -Our emoji set is based off Apple's emoji character palette, plus some custom -emoji such as :octocat: :shipit: :metal:. - Some useful tools in development are: ``` @@ -17,28 +11,11 @@ Sets up the development environment. The prerequisites are: * Ruby 1.9+ * Bundler -``` -rake db:generate -``` - -On OS X, this will rebuild the `db/Category-Emoji.json` file from the system -one, pulling in any new emoji that Apple may have added in the meantime. - ``` script/test ``` -Runs the test suite, including the integrity test where we assert that we have -covered each of Apple's emoji. - -``` -script/regenerate -``` - -Rebuilds the `db/emoji.json` file which is our main list of emoji: their -canonical representations, descriptions, aliases, and tags. This requires OS X -because Safari is used in the process to verify which character render as emoji -and which render as ordinary Unicode glyphs from the current font. +Runs the test suite. ``` script/console diff --git a/LICENSE b/LICENSE index af157626..bfc6c46e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,18 +1,4 @@ -octocat, squirrel, shipit -Copyright (c) 2013 GitHub Inc. All rights reserved. - -bowtie, neckbeard, fu -Copyright (c) 2013 37signals, LLC. All rights reserved. - -feelsgood, finnadie, goberserk, godmode, hurtrealbad, rage 1-4, suspect -Copyright (c) 2013 id Software. All rights reserved. - -trollface -Copyright (c) 2013 whynne@deviantart. All rights reserved. - -Source code: - -Copyright (c) 2013 GitHub, Inc. +Copyright (c) 2019 GitHub, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/README.md b/README.md index ea0c2576..4f438287 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ gemoji ====== -This library contains character information about native emoji, as well as image -files for a few custom emoji. +This library contains character information about native emojis. Installation @@ -14,16 +13,6 @@ Add `gemoji` to your Gemfile. gem 'gemoji' ``` -### Extract images - -``` sh -bundle exec gemoji extract public/images/emoji -``` - -This will extract images into filenames such as: - -* `public/images/emoji/octocat.png` - Example Rails Helper -------------------- diff --git a/bin/gemoji b/bin/gemoji deleted file mode 100755 index fe62da7d..00000000 --- a/bin/gemoji +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env ruby -require 'emoji/cli' - -exit_code = Emoji::CLI.dispatch(ARGV) -exit exit_code diff --git a/db/emoji.json b/db/emoji.json index 6b493349..6efe6244 100644 --- a/db/emoji.json +++ b/db/emoji.json @@ -20612,124 +20612,4 @@ , "unicode_version": "11.0" , "ios_version": "12.1" } -, { - "aliases": [ - "basecamp" - ] - , "tags": [ - ] - } -, { - "aliases": [ - "basecampy" - ] - , "tags": [ - ] - } -, { - "aliases": [ - "bowtie" - ] - , "tags": [ - ] - } -, { - "aliases": [ - "feelsgood" - ] - , "tags": [ - ] - } -, { - "aliases": [ - "finnadie" - ] - , "tags": [ - ] - } -, { - "aliases": [ - "goberserk" - ] - , "tags": [ - ] - } -, { - "aliases": [ - "godmode" - ] - , "tags": [ - ] - } -, { - "aliases": [ - "hurtrealbad" - ] - , "tags": [ - ] - } -, { - "aliases": [ - "neckbeard" - ] - , "tags": [ - ] - } -, { - "aliases": [ - "octocat" - ] - , "tags": [ - ] - } -, { - "aliases": [ - "rage1" - ] - , "tags": [ - ] - } -, { - "aliases": [ - "rage2" - ] - , "tags": [ - ] - } -, { - "aliases": [ - "rage3" - ] - , "tags": [ - ] - } -, { - "aliases": [ - "rage4" - ] - , "tags": [ - ] - } -, { - "aliases": [ - "shipit" - , "squirrel" - ] - , "tags": [ - ] - } -, { - "aliases": [ - "suspect" - ] - , "tags": [ - ] - } -, { - "aliases": [ - "trollface" - ] - , "tags": [ - ] - } ] diff --git a/gemoji.gemspec b/gemoji.gemspec index e1b4cd3e..43200c30 100644 --- a/gemoji.gemspec +++ b/gemoji.gemspec @@ -3,7 +3,6 @@ Gem::Specification.new do |s| s.version = "3.0.1" s.summary = "Emoji library" s.description = "Character information and metadata for standard and custom emoji." - s.executables = ["gemoji"] s.required_ruby_version = '> 1.9' @@ -14,8 +13,7 @@ Gem::Specification.new do |s| s.files = Dir[ "README.md", - "bin/gemoji", - "images/*.png", + "LICENSE", "db/emoji.json", "lib/**/*.rb", ] diff --git a/images/basecamp.png b/images/basecamp.png deleted file mode 100644 index d0267fb8..00000000 Binary files a/images/basecamp.png and /dev/null differ diff --git a/images/basecampy.png b/images/basecampy.png deleted file mode 100644 index 806d013f..00000000 Binary files a/images/basecampy.png and /dev/null differ diff --git a/images/bowtie.png b/images/bowtie.png deleted file mode 100644 index 5616d691..00000000 Binary files a/images/bowtie.png and /dev/null differ diff --git a/images/feelsgood.png b/images/feelsgood.png deleted file mode 100644 index 891ec43e..00000000 Binary files a/images/feelsgood.png and /dev/null differ diff --git a/images/finnadie.png b/images/finnadie.png deleted file mode 100644 index 90266e24..00000000 Binary files a/images/finnadie.png and /dev/null differ diff --git a/images/goberserk.png b/images/goberserk.png deleted file mode 100644 index e617a9df..00000000 Binary files a/images/goberserk.png and /dev/null differ diff --git a/images/godmode.png b/images/godmode.png deleted file mode 100644 index 551111a7..00000000 Binary files a/images/godmode.png and /dev/null differ diff --git a/images/hurtrealbad.png b/images/hurtrealbad.png deleted file mode 100644 index 60558415..00000000 Binary files a/images/hurtrealbad.png and /dev/null differ diff --git a/images/neckbeard.png b/images/neckbeard.png deleted file mode 100644 index 69ccffc7..00000000 Binary files a/images/neckbeard.png and /dev/null differ diff --git a/images/octocat.png b/images/octocat.png deleted file mode 100644 index f9050b93..00000000 Binary files a/images/octocat.png and /dev/null differ diff --git a/images/rage1.png b/images/rage1.png deleted file mode 100644 index 99a28f26..00000000 Binary files a/images/rage1.png and /dev/null differ diff --git a/images/rage2.png b/images/rage2.png deleted file mode 100644 index e91813c9..00000000 Binary files a/images/rage2.png and /dev/null differ diff --git a/images/rage3.png b/images/rage3.png deleted file mode 100644 index 36f07333..00000000 Binary files a/images/rage3.png and /dev/null differ diff --git a/images/rage4.png b/images/rage4.png deleted file mode 100644 index d1b87ba9..00000000 Binary files a/images/rage4.png and /dev/null differ diff --git a/images/shipit.png b/images/shipit.png deleted file mode 100644 index 2d018e65..00000000 Binary files a/images/shipit.png and /dev/null differ diff --git a/images/suspect.png b/images/suspect.png deleted file mode 100644 index c4fd15c2..00000000 Binary files a/images/suspect.png and /dev/null differ diff --git a/images/trollface.png b/images/trollface.png deleted file mode 100644 index ee463dc6..00000000 Binary files a/images/trollface.png and /dev/null differ diff --git a/lib/emoji.rb b/lib/emoji.rb index eb02ae01..cb4b62a2 100644 --- a/lib/emoji.rb +++ b/lib/emoji.rb @@ -11,10 +11,6 @@ def data_file File.expand_path('../../db/emoji.json', __FILE__) end - def images_path - File.expand_path("../../images", __FILE__) - end - def all return @all if defined? @all @all = [] diff --git a/lib/emoji/cli.rb b/lib/emoji/cli.rb deleted file mode 100644 index 33c127ac..00000000 --- a/lib/emoji/cli.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -require 'fileutils' -require 'optparse' - -module Emoji - module CLI - extend self - - InvalidUsage = Class.new(RuntimeError) - - def dispatch(argv) - cmd = argv[0] - argv = argv[1..-1] - - case cmd - when "extract" - public_send(cmd, argv) - when "help", "--help", "-h" - help - else - raise InvalidUsage - end - - return 0 - rescue InvalidUsage, OptionParser::InvalidArgument, OptionParser::InvalidOption => err - unless err.message == err.class.to_s - $stderr.puts err.message - $stderr.puts - end - $stderr.puts usage_text - return 1 - end - - def help - puts usage_text - end - - def extract(argv) - # OptionParser.new do |opts| - # opts.on("--size=64", Integer) do |size| - # end.parse!(argv) - - raise InvalidUsage unless argv.size == 1 - path = argv[0] - - Dir["#{Emoji.images_path}/*.png"].each do |png| - FileUtils.cp(png, File.join(path, File.basename(png))) - end - end - - def usage_text - < -EOF - end - end -end diff --git a/test/emoji_test.rb b/test/emoji_test.rb index 1b1312fe..5bbac5b7 100644 --- a/test/emoji_test.rb +++ b/test/emoji_test.rb @@ -8,7 +8,7 @@ class EmojiTest < TestCase end test "unicodes set contains the unicodes" do - min_size = Emoji.all.reject(&:custom?).size + min_size = Emoji.all.size count = Emoji.all.map(&:unicode_aliases).flatten.size assert count > min_size, "there were too few unicode mappings: #{count}" end @@ -112,7 +112,7 @@ class EmojiTest < TestCase end test "emoji have category" do - missing = Emoji.all.select { |e| !e.custom? && e.category.to_s.empty? } + missing = Emoji.all.select { |e| e.category.to_s.empty? } assert_equal [], missing.map(&:name), "some emoji don't have a category" emoji = Emoji.find_by_alias('family_man_woman_girl') @@ -120,7 +120,7 @@ class EmojiTest < TestCase end test "emoji have description" do - missing = Emoji.all.select { |e| !e.custom? && e.description.to_s.empty? } + missing = Emoji.all.select { |e| e.description.to_s.empty? } assert_equal [], missing.map(&:name), "some emoji don't have a description" emoji = Emoji.find_by_alias('family_man_woman_girl') @@ -133,27 +133,16 @@ class EmojiTest < TestCase end test "emoji have iOS version" do - missing = Emoji.all.select { |e| !e.custom? && e.ios_version.to_s.empty? } + missing = Emoji.all.select { |e| e.ios_version.to_s.empty? } assert_equal [], missing.map(&:name), "some emoji don't have an iOS version" emoji = Emoji.find_by_alias('family_man_woman_girl') assert_equal '8.3', emoji.ios_version end - test "custom emojis" do + test "no custom emojis" do custom = Emoji.all.select(&:custom?) - assert custom.size > 0 - - custom.each do |emoji| - assert_nil emoji.raw - assert_equal [], emoji.unicode_aliases - end - end - - test "custom emoji names" do - custom_names = Emoji.all.select(&:custom?).map(&:name) - assert custom_names.include?("shipit") - assert !custom_names.include?("+1") + assert 0, custom.size end test "create" do