Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorgitlabhq <m@gitlabhq.com>2011-10-14 17:40:41 +0400
committergitlabhq <m@gitlabhq.com>2011-10-14 17:40:41 +0400
commit2cd52b492a65b60723473748912110b24f05b29c (patch)
tree46e528914f477681d7e7a9818f0b364066a1b79f /lib
parenta18924e954e79f07778da65d5978823d63f98ecf (diff)
parent0f6ebcb694830b763f193a521c038b3d501a7abd (diff)
install & update
Diffstat (limited to 'lib')
-rw-r--r--lib/color.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/color.rb b/lib/color.rb
new file mode 100644
index 00000000000..d5500aca8e2
--- /dev/null
+++ b/lib/color.rb
@@ -0,0 +1,25 @@
+module Color
+ def colorize(text, color_code)
+ "\033[#{color_code}#{text}\033[0m"
+ end
+
+ def red(text)
+ colorize(text, "31m")
+ end
+
+ def green(text)
+ colorize(text, "32m")
+ end
+
+ def command(string)
+ `#{string}`
+ if $?.to_i > 0
+ puts red " == #{string} - FAIL"
+ puts red " == Error during configure"
+ exit
+ else
+ puts green " == #{string} - OK"
+ end
+ end
+end
+