Class: Pod::Command::Spm::Clean
- Inherits:
-
Pod::Command::Spm
- Object
- Pod::Command
- Pod::Command::Spm
- Pod::Command::Spm::Clean
- Defined in:
- lib/cocoapods-spm/command/clean.rb
Constant Summary
Constants inherited from Pod::Command::Spm
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Clean
constructor
A new instance of Clean.
- #run ⇒ Object
Methods inherited from Pod::Command::Spm
bind_command, #update_cli_config
Methods included from SPM::Config::SPMConfigMixin
Methods included from SPM::Config::PodConfigMixin
Methods included from SPM::Config::ProjectConfigMixin
Constructor Details
#initialize(argv) ⇒ Clean
Returns a new instance of Clean.
14 15 16 17 18 19 |
# File 'lib/cocoapods-spm/command/clean.rb', line 14 def initialize(argv) super @clean_all = argv.flag?("all") @clean_macros = argv.flag?("macros") @clean_pkgs = argv.flag?("packages") end |
Class Method Details
.options ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/cocoapods-spm/command/clean.rb', line 6 def self. [ ["--all", "Clean all"], ["--macros", "Clean macros"], ["--packages", "Clean packages"], ].concat(super) end |
Instance Method Details
#run ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/cocoapods-spm/command/clean.rb', line 21 def run to_clean = [] to_clean << spm_config.pkg_root_dir if @clean_pkgs to_clean << spm_config.macro_root_dir if @clean_macros to_clean << spm_config.root_dir if @clean_all to_clean.each { |dir| dir.rmtree if dir.exist? } end |