Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Guardfile
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 string-irc.gemspec
README.md

String::IRC

String::IRC is a module to IRC-friendlily colorize text.

Installation

Add this line to your application's Gemfile:

gem 'string-irc'

And then execute:

$ bundle

Or install it yourself as:

$ gem install string-irc

Usage

Use String::IRC module

require 'string/irc'

Strint::IRC.colorize 'Hello', :white, :red
#=> Text whose foreground color is white and background color is red

Strint::IRC.colorize 'Hello', :red
#=> Text whose foreground color is red and background color is not designated

Strint::IRC.colorize 'Hello', nil, :red
#=> Nothing changes.

Strint::IRC.bold 'Hello'
#=> Makes the text bold.

Strint::IRC.underline 'Hello'
#=> Makes the text underlined.

Strint::IRC.italic 'Hello'
#=> Makes the text italic.

Use String extension

require 'string/irc/core_ext/string'

'Hello'.irc_colorize :white, :red
#=> Same as above.

'Hello'.irc_bold
#=> Same as above.

'Hello'.irc_underline
#=> Same as above.

'Hello'.irc_italic
#=> Same as above.

Supported Colors

  • white
  • black
  • blue
  • navy
  • green
  • red
  • brown
  • maroon
  • purple
  • orange
  • olive
  • yellow
  • light
  • green
  • lime
  • teal
  • light_cyan
  • cyan
  • aqua
  • light_blue
  • royal
  • pink
  • light_purple
  • fuchsia
  • grey
  • light_grey
  • silver

See Also

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Something went wrong with that request. Please try again.