Class: Stool::Command::WorkSpace

Inherits:
Stool::Command show all
Defined in:
lib/stool/Command/WorkSpace.rb,
lib/stool/Command/WorkSpace/list.rb,
lib/stool/Command/WorkSpace/update.rb

Direct Known Subclasses

List, Update

Defined Under Namespace

Classes: List, Update

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Stool::Command

#checkConfigFile, options, #pp, #run

Constructor Details

#initialize(argv) ⇒ WorkSpace

Returns a new instance of WorkSpace.



22
23
24
# File 'lib/stool/Command/WorkSpace.rb', line 22

def initialize(argv)
  super
end

Instance Attribute Details

#infoObject

查询结果workspace信息



20
21
22
# File 'lib/stool/Command/WorkSpace.rb', line 20

def info
  @info
end

#tagObject

要查询的workspace的唯一标识



18
19
20
# File 'lib/stool/Command/WorkSpace.rb', line 18

def tag
  @tag
end

Instance Method Details

#cleanAllCacheObject

清理所有pod缓存(除master repo的pod)



71
72
73
# File 'lib/stool/Command/WorkSpace.rb', line 71

def cleanAllCache
  Repo::cacheCleanAll
end

#existAtConfig?Boolean

Returns:

  • (Boolean)


41
42
43
44
45
46
47
48
49
50
# File 'lib/stool/Command/WorkSpace.rb', line 41

def existAtConfig?
  #在本地配置中中查找workspace
  arrayTasks = WorkSpace::List::tasks_from_config
  arrayTasks.each {|task|
    if @tag.eql?(task.tag)
      @info = task
    end
  }
  @info
end

#getAllReposObject

获取task用的所有repos



53
54
55
56
57
58
59
60
61
# File 'lib/stool/Command/WorkSpace.rb', line 53

def getAllRepos
  arr = []
  if @info.repos.count == 0
    arr = Repo::getAllRepos
  else
    arr = @info.repos
  end
  arr
end

#hasPodfile?(path) ⇒ Boolean

def run

end

Returns:

  • (Boolean)


36
37
38
39
# File 'lib/stool/Command/WorkSpace.rb', line 36

def hasPodfile?(path)
  arr = Dir.glob(File.join(path,'Podfile'))
  arr[0]
end

#pathForTaskInfo_last_pod_updateObject



63
64
65
66
67
68
# File 'lib/stool/Command/WorkSpace.rb', line 63

def pathForTaskInfo_last_pod_update
  unless Dir.exist?(Config::logsDirPath)
    Dir.mkdir(Config::logsDirPath)
  end
  File.join(Config::logsDirPath, 'TaskInfo_lastUpdate.yaml')
end

#validate!Object



28
29
30
# File 'lib/stool/Command/WorkSpace.rb', line 28

def validate!
  super
end