Skip to content

kojix2/lolcat.cr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What?


build

🐈‍⬛ Crystal implementation of the lolcat

Installation

Download from GitHub Release

From source code:

git clone https://github.com/kojix2/lolcat.cr
cd lolcat.cr
shards build --release
mv bin/lolcat /usr/local/bin/ # or any directory in your PATH

Homebrew:

brew install kojix2/brew/lolcat

Usage

lolcat README.md
lolcat --help

As a library

You can use lolcat.cr as a library in your Crystal projects:

# Add to your shard.yml
dependencies:
  lolcat:
    github: kojix2/lolcat.cr

Basic usage:

require "lolcat"

# Use the Lol module directly
include Lolcat::Lol

# Create options with default values
options = Lolcat::Options.new

# Apply rainbow colors to a string
colored_text = rainbow_line("Hello, colorful world!", options, 0.0)
puts colored_text

# Or process an entire IO stream
io = IO::Memory.new("Multiple\nLines\nOf\nText")
lol_cat(io, options)

For more examples, see examples

Development

This project was created as an example of a command line tool. Use only standard libraries and keep it simple.

Contributing

Pull requests and issues are welcome.

License

The original lolcat is licensed under the BSD 3-Clause "New" or "Revised" License. Thus, the same is true for this project.