Method: Xccleanup.run_steps
- Defined in:
- lib/xccleanup.rb
.run_steps(steps, manually) ⇒ Object
Execution and Menu
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
# File 'lib/xccleanup.rb', line 380 def self.run_steps(steps, manually) total_saved_bytes = 0 steps.each do |method| puts "\n" line('-') method_name = "#{method.name}".gsub('_', ' ').capitalize center(method_name.upcase) line('-') saved_bytes = method.call(manually) line('.') center("#{method_name} completed, #{pbs(saved_bytes)} removed.") total_saved_bytes += saved_bytes end line('–') emoji = '😞' if total_saved_bytes > 0 emoji = '👍' end mb = 1024 * 1024 if total_saved_bytes > (100 * mb) emoji = '💪' end if total_saved_bytes > (5000 * mb) emoji = '🍾' end if total_saved_bytes > (10000 * mb) emoji = '💥' end center("🎉 XCODE CLEANUP completed, #{pbs(total_saved_bytes)} removed. #{emoji}") line('–') end |