Skip to content

Latest commit

 

History

History
98 lines (74 loc) · 2.35 KB

README.md

File metadata and controls

98 lines (74 loc) · 2.35 KB

mruby-lolcat

mruby fork of the lolcat.

Powerd by mruby, will build a standalone binary for OS X, Linux, or maybe for any other *NIX platforms.

Build Status

Special Thanks

The command line program

Installation

Prerequisites

To compile out of the source code you need the following tools:

  • C Compiler (i.e. gcc)
  • Linker (i.e. gcc)
  • Archive utility (i.e. ar)
  • Parser generator (i.e. bison)
  • Ruby 1.8 or 1.9 (i.e. ruby or jruby)

Read mruby's document for more infomation.

Get the code

git clone https://github.com/dorentus/mruby-lolcat.git
cd mruby-lolcat

Or if you'd prefer downloading tarballs, navigate to: https://github.com/dorentus/mruby-lolcat/releases

Build

The following command will build and install lolcat to /usr/local/bin/lolcat:

make -C binutils install PREFIX=/usr/local APPNAME=lolcat

Or you could just run:

make -C binutils install

If you're using OS X and homebrew

Ignore previous instructions and just do:

brew install dorentus/recipes/lolcat_mruby

Usage

Run lolcat -h for details and examples.

usage screenshot

As a mruby gem

Build

  • add conf.gem line to build_config.rb
MRuby::Build.new do |conf|

    # ... (snip) ...

    conf.gem :github => 'iij/mruby-io'
    conf.gem :github => 'iij/mruby-regexp-pcre'
    conf.gem :github => 'matsumoto-r/mruby-sleep'
    conf.gem :github => 'dorentus/mruby-lolcat'
end

Usage

opts = {
  :animate => false,
  :duration => 12,
  :os => 0,
  :speed => 20,
  :spread => 8.0,
  :freq => 0.3,
  :colored => true
}

Lol.println 'RAINBOWS AN UNICORNS! '

Lol.cat! ['/etc/hosts', '/etc/fstab'], opts

Lol.cat $stdin, opts

fd = File.open('/etc/hosts')
Lol.cat fd, opts
fd.close

License

The MIT LICENSE