We no longer ship any images to extract.
This commit is contained in:
Mislav Marohnić 2019-05-05 02:20:09 +02:00
Π ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒ 040aebef64
ΠšΠΎΠΌΠΌΠΈΡ‚ 0f9400398e
6 ΠΈΠ·ΠΌΠ΅Π½Ρ‘Π½Π½Ρ‹Ρ… Ρ„Π°ΠΉΠ»ΠΎΠ²: 2 Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠΉ ΠΈ 83 ΡƒΠ΄Π°Π»Π΅Π½ΠΈΠΉ

1
.gitignore поставляСмый
ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -1,5 +1,4 @@
/bin/*
!/bin/gemoji
.bundle
.ruby-version
Gemfile.lock

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -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
--------------------

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -1,5 +0,0 @@
#!/usr/bin/env ruby
require 'emoji/cli'
exit_code = Emoji::CLI.dispatch(ARGV)
exit exit_code

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -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",
]

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -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 = []

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -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
Usage: gemoji extract <path>
EOF
end
end
end