diff options
| author | gitlabhq <m@gitlabhq.com> | 2011-10-14 16:40:41 +0300 |
|---|---|---|
| committer | gitlabhq <m@gitlabhq.com> | 2011-10-14 16:40:41 +0300 |
| commit | 2cd52b492a65b60723473748912110b24f05b29c (patch) | |
| tree | 46e528914f477681d7e7a9818f0b364066a1b79f /lib | |
| parent | a18924e954e79f07778da65d5978823d63f98ecf (diff) | |
| parent | 0f6ebcb694830b763f193a521c038b3d501a7abd (diff) | |
| download | gitlab-ce-2cd52b492a65b60723473748912110b24f05b29c.tar.gz | |
install & update
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/color.rb | 25 |
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 + |
