RainbowLiquid
RainbowLiquid is a Ruby gem that leverages Liquid templates to neatly style and colorize your command line tools with a touch of rainbow.
Installation
gem 'rainbow_liquid'
Usage
RainbowLiquid offers two simple approaches to render styled output.
Example 1: Using refinements
require 'rainbow_liquid'
using RainbowLiquid
render <<~MSG
-------------------------------
{% bright -%}
{%- green -%}
Welcome to 🌈 Rainbow Liquid 💧
{%- endgreen -%}
{%- endbright %}
-------------------------------
MSG
Example 2: Using the namespace
require 'rainbow_liquid'
RainbowLiquid.render <<~MSG
-------------------------------
{% bright -%}
{%- green -%}
Welcome to 🌈 Rainbow Liquid 💧
{%- endgreen -%}
{%- endbright %}
-------------------------------
MSG
Development
To work on RainbowLiquid locally:
-
Setup dependencies:
Run the setup script:bin/setup
-
Run tests:
Execute:bundle exec rake test
-
Interactive console:
Launch an interactive Ruby prompt:bin/console
-
Local gem installation:
Install the gem on your system:bundle exec rake install
-
Release a new version:
Update the version number inlib/rainbow_liquid/version.rb
, then run:bundle exec rake release
This process creates a git tag, pushes your commits and tag, and uploads the gem to RubyGems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/karreiro/rainbow_liquid. We appreciate collaboration in a respectful and pragmatic environment. Please review the code of conduct before contributing.
License
RainbowLiquid is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting with the RainbowLiquid project—whether via codebases, issue trackers, chat rooms, or mailing lists—is expected to adhere to the code of conduct.