Class: Stool::Command::Repo

Inherits:
Stool::Command show all
Defined in:
lib/stool/Command/repo.rb,
lib/stool/Command/Repo/CacheClean.rb

Direct Known Subclasses

CacheClean

Defined Under Namespace

Classes: CacheClean

Class Method Summary collapse

Instance Method Summary collapse

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

.cacheCleanAllObject



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

.getAllReposObject

获取所有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

#runObject



19
20
21
# File 'lib/stool/Command/repo.rb', line 19

def run

end