Class: Stool::Command::Repo
- Inherits:
-
Stool::Command
- Object
- CLAide::Command
- Stool::Command
- Stool::Command::Repo
- Defined in:
- lib/stool/Command/repo.rb,
lib/stool/Command/Repo/CacheClean.rb
Direct Known Subclasses
Defined Under Namespace
Classes: CacheClean
Class Method Summary collapse
- .cacheCleanAll ⇒ Object
-
.getAllRepos ⇒ Object
获取所有repo除master.
Instance Method Summary collapse
-
#initialize(argv) ⇒ Repo
constructor
self.default_subcommand = ‘list’.
- #run ⇒ Object
Methods inherited from Stool::Command
#checkConfigFile, options, #pp
Constructor Details
#initialize(argv) ⇒ Repo
self.default_subcommand = ‘list’
15 16 17 |
# File 'lib/stool/Command/repo.rb', line 15 def initialize(argv) super end |
Class Method Details
.cacheCleanAll ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/stool/Command/repo.rb', line 23 def self.cacheCleanAll puts "clean all cache" hasClean = [] path = @@config.repoCachePath Dir.entries(path).each{|file| if file['.'] || file.eql?('master') #do nothing else podCache = File.join(path,file) Dir.entries(podCache).sort.each{|podName| unless hasClean.include?(podName) || podName['.'] puts "清理缓存#{podName} " puts `pod cache clean #{podName} --all` hasClean.push(podName) end } end } end |
.getAllRepos ⇒ Object
获取所有repo除master
44 45 46 47 48 49 50 51 |
# File 'lib/stool/Command/repo.rb', line 44 def self.getAllRepos path = @@config.repoCachePath arr = Dir.entries(path).delete_if{|file| if file['.'] || file.eql?('master') 1 end } end |
Instance Method Details
#run ⇒ Object
19 20 21 |
# File 'lib/stool/Command/repo.rb', line 19 def run end |