NATOPhone
Simple tool to encode/decode NATO alphabet.
This was an exercise in making a Ruby CLI app following a set of constraints.
Installation
CLI
gem install natophone
Library
Add this line to your application's Gemfile:
gem 'natophone'
And then execute:
bundle
Usage
CLI
natophone encode Hello world.
natophone -E Hello world.
natophone -E 'Hello world.' 'Goodbye!'
natophone -E --yell Hello world.
natophone -E --json Hello world.
natophone decode hotel echo lima lima oscar - whiskey oscar romeo lima delta stop
natophone -D hotel echo lima lima oscar - whiskey oscar romeo lima delta stop
natophone -D 'hotel echo lima lima oscar' 'whiskey oscar romeo lima delta stop'
natophone -D --yell hotel echo lima lima oscar
natophone -D --json hotel echo lima lima oscar
Library
require 'natophone'
enc_by_string = NATOPhone::Encoder.new('hello world')
enc_by_array = NATOPhone::Encoder.new(['hello', 'world'])
dec_by_string = NATOPhone::Decoder.new('hotel echo lima lima oscar - whiskey oscar romeo lima delta')
dec_by_array = NATOPhone::Decoder.new(%w{hotel echo lima lima oscar - whiskey oscar romeo lima delta})