Project

kokki

0.0
No commit activity in last 3 years
No release in over 3 years
Convert a country name / code & IP address to an emoji flag
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 0.8
~> 13.0
~> 3.9
~> 5.0
~> 3.7
 Project Readme

kokki

Gem Version Build Status Coverage Status CodeFactor

A Ruby gem for converting a country name / code & IP address to an emoji flag.

Install

gem install kokki
# or
docker pull ninoseki/kokki

Usage

As a CLI

$ kokki TW
πŸ‡ΉπŸ‡Ό
$ kokki USA
πŸ‡ΊπŸ‡Έ
$ kokki japan
πŸ‡―πŸ‡΅
$ kokki 202.214.194.147
πŸ‡―πŸ‡΅
# it suports a defanged ip as an input
$ kokki 1.1.1[.]1
πŸ‡¦πŸ‡Ί
$ kokki "1.1.1(.)1"
πŸ‡¦πŸ‡Ί

# or
$ docker run --rm ninoseki/kokki Japan
πŸ‡―πŸ‡΅

As a library

require "kokki"

puts "JP: #{Kokki.flagize('JP')}"
# => JP: πŸ‡―πŸ‡΅
puts "JPN: #{Kokki.flagize('JPN')}"
# => JPN: πŸ‡―πŸ‡΅
puts "Japan: #{Kokki.flagize('Japan')}"
# => Japan: πŸ‡―πŸ‡΅
puts "202.214.194.147: #{Kokki.flagize('202.214.194.147')}"
# => 202.214.194.147: πŸ‡―πŸ‡΅

begin
  Kokki.flagize("test")
rescue Kokki::InvalidInputError => e
  puts e.message
  # => invalid input: test
end