From 0f9400398ec5715a1e241a224cb6a902dfacf5c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Sun, 5 May 2019 02:20:09 +0200 Subject: [PATCH] :fire: extractor logic We no longer ship any images to extract. --- .gitignore | 1 - README.md | 13 +---------- bin/gemoji | 5 ----- gemoji.gemspec | 4 +--- lib/emoji.rb | 4 ---- lib/emoji/cli.rb | 58 ------------------------------------------------ 6 files changed, 2 insertions(+), 83 deletions(-) delete mode 100755 bin/gemoji delete mode 100644 lib/emoji/cli.rb diff --git a/.gitignore b/.gitignore index 40b89d2..cce1fd7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /bin/* -!/bin/gemoji .bundle .ruby-version Gemfile.lock diff --git a/README.md b/README.md index ea0c257..4f43828 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 fe62da7..0000000 --- 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/gemoji.gemspec b/gemoji.gemspec index e1b4cd3..43200c3 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/lib/emoji.rb b/lib/emoji.rb index eb02ae0..cb4b62a 100644 --- a/lib/emoji.rb +++ b/lib/emoji.rb @@ -11,10 +11,6 @@ module Emoji 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 33c127a..0000000 --- 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