Nov 25, 2015
: ~ 5 min read

I recently saw Joe's post about updating Xcode plug-ins, but since I'm really lazy, updating them one by one didn't suffice, so here's my take on it. In case you want to skip straight to the desert, here's the gist.

# For a bit of flavor
red = "\e[31m"
green = "\e[32m"
yellow = "\e[33m"
white = "\e[0m"
if updated_plugins == 0
if uptodate_plugins == 1
puts "\n#{green}You have only one pluging, and it was already up to date.#{white}"
else
puts "\n#{green}All #{uptodate_plugins} plugins were already up to date.#{white}"
end
elsif uptodate_plugins == 0
if updated_plugins == 1
puts "\n#{green}You have only one plugin, and it has been updated."
else
puts "\n#{green}All #{updated_plugins} plugins have been updated."
end
elsif updated_plugins == 1 && uptodate_plugins == 1
puts "\n#{green}#{updated_plugins} plugin has been updated, #{uptodate_plugins} plugin was already up to date.#{white}"
elsif updated_plugins == 1
puts "\n#{green}#{updated_plugins} plugin has been updated, #{uptodate_plugins} plugins were already up to date.#{white}"
elsif uptodate_plugins == 1
puts "\n#{green}#{updated_plugins} plugins have been updated, #{uptodate_plugins} plugin was already up to date.#{white}"
else
puts "\n#{green}#{updated_plugins} plugins have been updated, #{uptodate_plugins} plugins were already up to date.#{white}"
end