concolor 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d9e9fd05bfc0ea172b309e228d210cf66f0e65fb
4
+ data.tar.gz: 8d9c36c5e198bcc9520d697441139c87b954026f
5
+ SHA512:
6
+ metadata.gz: 0c5ef66dcb2e3c645ecadfa16b711b375f32620912534d62db377206b3c9cc10ed148584e6484773a8bea613c0d510cc2ac44b29e3d56bbb53d153c3ab929854
7
+ data.tar.gz: f390b29a7b64b9225af2d036d5de046e8cc054327165df67884a55644735944b3461db75567bf858e3c6f4fe4c97ac33eadcbc74bc80c0401b53e241524028be
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 RubyBeast
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,23 @@
1
+ # Concolor
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'concolor'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install concolor
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,47 @@
1
+ # coding: utf-8
2
+ require 'concolor/version'
3
+
4
+ module Concolor
5
+
6
+ def style(*args)
7
+ style_map = {
8
+ # Text color
9
+ black: 30,
10
+ red: 31,
11
+ green: 32,
12
+ yellow: 33,
13
+ blue: 34,
14
+ magenta: 35,
15
+ cyan: 36,
16
+ white: 37,
17
+
18
+ # Background color
19
+ black_bg: 40,
20
+ red_bg: 41,
21
+ green_bg: 42,
22
+ yellow_bg: 43,
23
+ blue_bg: 44,
24
+ magenta_bg: 45,
25
+ cyan_bg: 46,
26
+ white_bg: 47,
27
+
28
+ # Text Style
29
+ bold: 1,
30
+ underline: 4
31
+ }
32
+
33
+ colorize_string = self.to_s
34
+
35
+ args.each do |arg|
36
+ if style_map.key?(arg)
37
+ colorize_string = "\033[#{style_map[arg]}m" + colorize_string + "\033[0m"
38
+ end
39
+ end
40
+
41
+ colorize_string
42
+ end
43
+ end
44
+
45
+ class String
46
+ include Concolor
47
+ end
@@ -0,0 +1,4 @@
1
+ # coding: utf-8
2
+ module Concolor
3
+ VERSION = '0.0.1'
4
+ end
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: concolor
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - alexmercury
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: Colorize console text
42
+ email:
43
+ - rubybeastua@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - LICENSE.txt
49
+ - README.md
50
+ - Rakefile
51
+ - lib/concolor.rb
52
+ - lib/concolor/version.rb
53
+ homepage: https://github.com/rubybeast/concolor
54
+ licenses:
55
+ - MIT
56
+ metadata: {}
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubyforge_project:
73
+ rubygems_version: 2.4.5
74
+ signing_key:
75
+ specification_version: 4
76
+ summary: Console color
77
+ test_files: []