pcol 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pcol.rb +24 -0
- metadata +61 -0
data/lib/pcol.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require "colorize"
|
2
|
+
|
3
|
+
module ColorRotator
|
4
|
+
|
5
|
+
PCOL_COLORS = [:red, :green, :yellow, :blue, :light_red, :light_green, :light_blue].to_enum
|
6
|
+
|
7
|
+
def self.next(color=nil)
|
8
|
+
begin
|
9
|
+
color = PCOL_COLORS.next
|
10
|
+
rescue
|
11
|
+
PCOL_COLORS.rewind
|
12
|
+
color = PCOL_COLORS.next
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
module Kernel
|
19
|
+
|
20
|
+
def pcol(obj, color=nil)
|
21
|
+
puts "#{obj.inspect}".send( color || ColorRotator.next(color) )
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pcol
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Vincent Roy
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-05-20 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: colorize
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
description: Output inspected object as a colorized string.
|
31
|
+
email: vincentroy8@gmail.com
|
32
|
+
executables: []
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
files:
|
36
|
+
- lib/pcol.rb
|
37
|
+
homepage: https://github.com/exploid/pcol
|
38
|
+
licenses: []
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options: []
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
requirements: []
|
56
|
+
rubyforge_project:
|
57
|
+
rubygems_version: 1.8.23
|
58
|
+
signing_key:
|
59
|
+
specification_version: 3
|
60
|
+
summary: Output inspected object as a colorized string.
|
61
|
+
test_files: []
|