Skip to content

Commit 14799a9

Browse files
committed
Fixing Rakefile exception cases
1 parent 5887348 commit 14799a9

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

Rakefile

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ task :bootstrap do
66
if system('which bundle')
77
sh "bundle install"
88
else
9-
$stderr.puts red("[!] Please install the bundler gem manually:\n" \
10-
' $ [sudo] gem install bundler')
9+
$stderr.puts "\033[0;31m" \
10+
"[!] Please install the bundler gem manually:\n" \
11+
' $ [sudo] gem install bundler' \
12+
"\e[0m"
1113
exit 1
1214
end
1315
end
@@ -115,8 +117,10 @@ begin
115117
task :default => :spec
116118

117119
rescue LoadError
118-
$stderr.puts red('[!] Some Rake tasks haven been disabled because the ' \
119-
'environment couldn’t be loaded. Be sure to run `rake bootstrap` first.')
120+
$stderr.puts "\033[0;31m" \
121+
'[!] Some Rake tasks haven been disabled because the environment' \
122+
' couldn’t be loaded. Be sure to run `rake bootstrap` first.' \
123+
"\e[0m"
120124
end
121125

122126
# UI Helpers
@@ -147,9 +151,3 @@ end
147151
def cyan(string)
148152
"\n\033[0;36m#{string}\033[0m"
149153
end
150-
151-
# Colorizes a string to red.
152-
#
153-
def red(string)
154-
"\033[0;31m#{string}\e[0m"
155-
end

0 commit comments

Comments
 (0)