Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/banyan/string-irc
Add color codes for mIRC compatible client.
https://github.com/banyan/string-irc
Last synced: 19 days ago
JSON representation
Add color codes for mIRC compatible client.
- Host: GitHub
- URL: https://github.com/banyan/string-irc
- Owner: banyan
- License: mit
- Created: 2011-08-28T15:15:12.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-05-07T18:19:40.000Z (almost 12 years ago)
- Last Synced: 2024-12-21T00:23:16.821Z (about 2 months ago)
- Language: Ruby
- Homepage:
- Size: 130 KB
- Stars: 15
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# string-irc - Add color codes for mIRC compatible client.
[![Build Status](https://secure.travis-ci.org/banyan/string-irc.png)](http://travis-ci.org/banyan/string-irc)## Description
Port of http://search.cpan.org/~hirose/String-IRC-0.04/ from Perl to Ruby.
## Compatibility
* Ruby 2.0.0
* Ruby 1.9.3
* Ruby 1.8.7## Getting Started
```
$ gem install string-irc
``````ruby
require 'string-irc'si1 = StringIrc.new('hello')
si1.red.underline.to_s
si2 = StringIrc.new('world').yellow('green').bold.to_s
message = "#{si1} #{si2}"
p message # => "\u001F\u000304hello\u000F \u0002\u000308,03world\u000F"
```### Caveats
* To strigfy StringIrc instance, you have to add #to_s method. This API is diffrence from original one.
### Try with IRC
* There is example code in `example` directory, try with IRC how looks it.
## Usage
```
string_irc_instance.COLOR([BG_COLOR])
```* Color scheme
foreground, and background
white
black
blue, navy
green
red
brown, maroon
purple
orange, olive
yellow
light_green, lime
teal, a_green, blue_cyan
light_cyan, cyan, aqua
light_blue, royal
pink, light_purple, fuchsia
grey
light_grey, silver
* Decorate method
```
#bold
#underline
#inverse
```* Original color scheme (currently it's only available as foreground color)
foreground only
rainbow
seven_eleven
## Copyright
Copyright (c) 2012 Kohei Hasegawa. See LICENSE for [details](http://banyan.mit-license.org/).