Sha256: 7a79217493f289c6fc9586ef09d9ef2f227421b64a7317669ecb6a1cd50a0570

Contents?: true

Size: 586 Bytes

Versions: 4

Compression:

Stored size: 586 Bytes

Contents

#!/usr/bin/env ruby
require 'ruby_figlet'
using RubyFiglet

unless (ARGV & %w(help --help -h)).empty?
  puts <<HELP

`list`: to see all fonts available.
Type anything in citation marks to show it in ASCII art form.
`-f`: and a font name to change the font
`-h`, `--help` or `help`: to show this menu.

HELP
  exit 0
end
puts RubyFiglet::Figlet.available if ARGV[0] == 'list'
exit 0 if ARGV[0] == 'list'

font = 'standard'
if ARGV.include? '-f'
  font = ARGV[ARGV.index('-f') + 1]
  ARGV.delete('-f')
  ARGV.delete(font)
end
first_arg = ARGV[0].gsub("\\n", "\n")
puts first_arg.art font

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby_figlet-0.4.5 bin/ruby-figlet
ruby_figlet-0.2.4 bin/ruby-figlet
ruby_figlet-0.2.3 bin/ruby-figlet
ruby_figlet-0.2.2 bin/ruby-figlet