puts_color 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.
- data/Rakefile +8 -0
- data/bin/puts_color +11 -0
- data/lib/puts_color.rb +43 -0
- data/test/test_puts_color.rb +36 -0
- metadata +49 -0
data/Rakefile
ADDED
data/bin/puts_color
ADDED
data/lib/puts_color.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
def puts_red(*strings)
|
4
|
+
strings.each do |string|
|
5
|
+
puts "\033[0;31m" + string + "\033[0m"
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
def puts_green(*strings)
|
10
|
+
strings.each do |string|
|
11
|
+
puts "\033[0;32m" + string + "\033[0m"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def puts_yellow(*strings)
|
16
|
+
strings.each do |string|
|
17
|
+
puts "\033[0;33m" + string + "\033[0m"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def puts_blue(*strings)
|
22
|
+
strings.each do |string|
|
23
|
+
puts "\033[0;34m" + string + "\033[0m"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def puts_purple(*strings)
|
28
|
+
strings.each do |string|
|
29
|
+
puts "\033[0;35m" + string + "\033[0m"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def puts_cyan(*strings)
|
34
|
+
strings.each do |string|
|
35
|
+
puts "\033[0;36m" + string + "\033[0m"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def puts_grey(*strings)
|
40
|
+
strings.each do |string|
|
41
|
+
puts "\033[0;37m" + string + "\033[0m"
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "test/unit"
|
4
|
+
require "puts_color"
|
5
|
+
|
6
|
+
class TestPutsColor < Test::Unit::TestCase
|
7
|
+
|
8
|
+
def test_puts_red
|
9
|
+
puts_red "I'm crazy red."
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_puts_green
|
13
|
+
puts_green "I'm green.", "I'm green, too."
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_puts_yellow
|
17
|
+
puts_yellow "How can you Chinese treat yellow?"
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_puts_blue
|
21
|
+
puts_blue "Sorry man, it's blue."
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_puts_purple
|
25
|
+
puts_purple "What a purple!"
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_puts_cyan
|
29
|
+
puts_cyan "Oops, hard to spell cyan."
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_puts_grey
|
33
|
+
puts_grey "Hard to see grey, yep"
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: puts_color
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Toby Chan
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-11-28 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: ! 'The productive gem to put colorful string in Linux '
|
15
|
+
email: tobeg3oogle@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- Rakefile
|
21
|
+
- lib/puts_color.rb
|
22
|
+
- bin/puts_color
|
23
|
+
- test/test_puts_color.rb
|
24
|
+
homepage: https://github.com/tobegit3hub/puts_color
|
25
|
+
licenses: []
|
26
|
+
post_install_message:
|
27
|
+
rdoc_options: []
|
28
|
+
require_paths:
|
29
|
+
- lib
|
30
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
32
|
+
requirements:
|
33
|
+
- - ! '>='
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
36
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
38
|
+
requirements:
|
39
|
+
- - ! '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
requirements: []
|
43
|
+
rubyforge_project:
|
44
|
+
rubygems_version: 1.8.23
|
45
|
+
signing_key:
|
46
|
+
specification_version: 3
|
47
|
+
summary: puts_color
|
48
|
+
test_files:
|
49
|
+
- test/test_puts_color.rb
|