Class: Swagify

Inherits:
Object
  • Object
show all
Defined in:
lib/swagify.rb

Overview

#Swagify

Swagify is a tiny tool to add swag to your Ruby scripts: symbol and colors, right out of the box.

Let’s go!

Class Method Summary collapse

Class Method Details

.alertObject

‘Swagify::alert` returns ⚠



28
29
30
# File 'lib/swagify.rb', line 28

def self.alert
	return "\u26A0"
end

.crossObject

##Symbols

‘Swagify::cross` returns ✘



13
14
15
# File 'lib/swagify.rb', line 13

def self.cross
	return "\u2718"
end

.failObject

‘Swagify::fail` returns a red ✘



47
48
49
# File 'lib/swagify.rb', line 47

def self.fail
	return self.cross.red
end

.gandalf_test_failedObject

‘Swagify::gandalf_test_failed` returns an angry red Gandalf when your tests fail courtesy of Mr. [Tancredi](github.com/tancredi)



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/swagify.rb', line 62

def self.gandalf_test_failed
	gandalf = <<EOF
 _   _        |          .
 \\ . /    \\      /      / \\
  | |         .         | |
  | |   \\    / \\    /   | |
  | | --    /   \\    -- | |
  | |    __/_____\\__    | |
  |_|      | o o |    (==_==)
  (_)______\\( 0 )/______(_)
  | |       (   )       | |
  | | _/-.   \\ /  .-\\_   '
.__|_|/___/_________\\__\\_______.
|     '                 '      |
|  YOU   SHALL   NOT   PASS!!  |
|______________________________|
       /__---____---__\\
         '---'  '---'
EOF
	return gandalf.red
end

.loveObject

‘Swagify::love` returns ♥



18
19
20
# File 'lib/swagify.rb', line 18

def self.love
	return "\u2665"
end

.successObject

‘Swagify::success` returns a green ✔



42
43
44
# File 'lib/swagify.rb', line 42

def self.success
	return self.tick.green
end

.tickObject

‘Swagify::tick` returns ✔



23
24
25
# File 'lib/swagify.rb', line 23

def self.tick
	return "\u2714"
end

.warningObject

‘Swagify::warning` returns a yellow ⚠



52
53
54
# File 'lib/swagify.rb', line 52

def self.warning
	return self.alert.yellow
end