Sha256: e40a539143c3a6b40dd468fe04b35cde6024c6ec0e72301ebc9294bd3c6431b0

Contents?: true

Size: 664 Bytes

Versions: 4

Compression:

Stored size: 664 Bytes

Contents

#!/usr/bin/evn ruby

unless ARGV.size == 1
  abort <<-D
usage: emoji name
       emoji -l
  D
end 

require 'named_emoji'

case ARGV[0]
when '-l'
  max_name_size = NamedEmoji::ALL.keys.map {|i| i.size}.max
  %w(PEOPLE NATURE OBJECTS PLACES SYMBOLS).each do |category|
    puts category + ":"
    puts
    emojis = NamedEmoji.const_get(category.upcase)
    emojis.keys.each_slice(4) do |keys|
      keys.each do |key|
        value = emojis[key]
        print "#{value ? value : '  '}  #{key.to_s.ljust(max_name_size)}"
      end
      puts
    end
    puts
  end
else
  if emoji = NamedEmoji[ARGV[0]]
    print emoji
  else
    warn "Emoji not found :("
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
named_emoji-1.0.3 bin/emoji
named_emoji-1.0.2 bin/emoji
named_emoji-1.0.1 bin/emoji
named_emoji-1.0.0 bin/emoji