Class: Pod::Command::X::XC::Clean
- Inherits:
-
Pod::Command::X::XC
- Object
- Pod::Command
- Pod::Command::X
- Pod::Command::X::XC
- Pod::Command::X::XC::Clean
- Extended by:
- Executable
- Defined in:
- lib/cocoapods-x/command/xcode/clean.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Clean
constructor
A new instance of Clean.
- #run ⇒ Object
Constructor Details
#initialize(argv) ⇒ Clean
Returns a new instance of Clean.
24 25 26 27 28 |
# File 'lib/cocoapods-x/command/xcode/clean.rb', line 24 def initialize(argv) @cache_files = Pod::X::Sandbox::xcode_cachefiles @wipe_all = argv.flag?('all') super end |
Class Method Details
.options ⇒ Object
18 19 20 21 22 |
# File 'lib/cocoapods-x/command/xcode/clean.rb', line 18 def self. [ ['--all', 'Remove all the cached without asking'] ].concat(super) end |
Instance Method Details
#run ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/cocoapods-x/command/xcode/clean.rb', line 30 def run if @wipe_all remove_files ['Pods', 'Podfile.lock', 'DerivedData'] else begin choices = ['Pods', 'Podfile.lock', 'Pods and Podfile.lock', 'DerivedData', 'All'] index = UI.choose_from_array(choices, 'Which item do you want to remove?') case index when 0 remove_files ['Pods'] when 1 remove_files ['Podfile.lock'] when 2 remove_files ['Pods', 'Podfile.lock'] when 3 remove_files ['DerivedData'] when 4 remove_files ['Pods', 'Podfile.lock', 'DerivedData'] end rescue => exception UI.puts "[!] #{exception}".red end end end |