Class: Stool::PoolInfo

Inherits:
BaseObj show all
Defined in:
lib/stool/Core/PoolInfo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseObj

#doCacheByYAML, fromFile, fromYAML

Constructor Details

#initializePoolInfo

Returns a new instance of PoolInfo.



12
13
14
15
# File 'lib/stool/Core/PoolInfo.rb', line 12

def initialize
  @lib_gitCloneUrl = ''
  super
end

Instance Attribute Details

#lib_gitCloneUrlObject

Returns the value of attribute lib_gitCloneUrl.



10
11
12
# File 'lib/stool/Core/PoolInfo.rb', line 10

def lib_gitCloneUrl
  @lib_gitCloneUrl
end

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/stool/Core/PoolInfo.rb', line 8

def name
  @name
end

#pathObject

Returns the value of attribute path.



9
10
11
# File 'lib/stool/Core/PoolInfo.rb', line 9

def path
  @path
end

Instance Method Details

#info_tosObject



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/stool/Core/PoolInfo.rb', line 17

def info_tos
  puts('--' + 'name:'+ self.name)
  puts('--' + 'path:'+ self.path)
  puts('--' + 'path:'+ self.lib_gitCloneUrl.to_s)
  puts('--' + 'libs:')
  subDirs.sort.each do |f|
    unless f['.']
      puts '  ' + f.to_s
    end
  end
  puts('')
end

#searchLib(name) ⇒ Object

本地搜索一个lib



31
32
33
34
35
36
37
# File 'lib/stool/Core/PoolInfo.rb', line 31

def searchLib(name)
  libInfo = nil
  if subDirs.include?(name)
    libInfo = LibInfo::loadFromPath(File.join(@path,name))
  end
  libInfo
end

#subDirsObject



39
40
41
42
43
44
45
# File 'lib/stool/Core/PoolInfo.rb', line 39

def subDirs
  arr = []
  if @path
    arr = Dir.entries(@path)
  end
  arr
end