colorme 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. data/LICENSE +21 -0
  2. data/README +13 -0
  3. data/init.rb +1 -0
  4. data/lib/colorme.rb +16 -0
  5. metadata +58 -0
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c)2010 Patrick Morgan (patrick@patrick-morgan.net)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,13 @@
1
+ == ColorMe 0.1.0
2
+
3
+ A VERY SIMPLE wrapper for outputting strings in color using ANSI color codes
4
+
5
+ == Usage
6
+ require 'rubygems'
7
+ require 'colorme'
8
+ include Colorme
9
+ puts "Hello World!".color(:red)
10
+
11
+
12
+ (c)2010 Patrick Morgan
13
+ www.patrick-morgan.net
data/init.rb ADDED
@@ -0,0 +1 @@
1
+ require 'colorme.rb'
data/lib/colorme.rb ADDED
@@ -0,0 +1,16 @@
1
+ module Colorme
2
+ String.class_eval do
3
+ def color(the_color=:red)
4
+ _colors = {
5
+ :black => "30",
6
+ :red => "31",
7
+ :green => "32",
8
+ :yellow => "33",
9
+ :blue => "34",
10
+ :magenta => "35",
11
+ :cyan => "36",
12
+ :white => "37"}
13
+ return "\033[1;#{_colors[the_color]}m"+ self +"\033[0m"
14
+ end
15
+ end
16
+ end
metadata ADDED
@@ -0,0 +1,58 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: colorme
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Patrick Morgan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-03-04 00:00:00 -06:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: A very simple helper for outputting strings in color
17
+ email: patrick@patrick-morgan.net
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - lib/colorme.rb
26
+ - init.rb
27
+ - LICENSE
28
+ - README
29
+ has_rdoc: true
30
+ homepage: http://www.patrick-morgan.net
31
+ licenses: []
32
+
33
+ post_install_message:
34
+ rdoc_options: []
35
+
36
+ require_paths:
37
+ - lib
38
+ required_ruby_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: "0"
43
+ version:
44
+ required_rubygems_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: "0"
49
+ version:
50
+ requirements: []
51
+
52
+ rubyforge_project:
53
+ rubygems_version: 1.3.5
54
+ signing_key:
55
+ specification_version: 3
56
+ summary: A VERY SIMPLE helper for outputting strings in color
57
+ test_files: []
58
+