Class: Stool::Command::Lib
- Inherits:
-
Stool::Command
- Object
- CLAide::Command
- Stool::Command
- Stool::Command::Lib
- Defined in:
- lib/stool/Command/Lib.rb,
lib/stool/Command/Lib/VersionAdd.rb
Direct Known Subclasses
Defined Under Namespace
Classes: VersionAdd
Instance Attribute Summary collapse
-
#info ⇒ Object
查询结果lib信息.
-
#name ⇒ Object
要查询的lib名字.
Instance Method Summary collapse
- #existAtPools? ⇒ Boolean
-
#initialize(argv) ⇒ Lib
constructor
A new instance of Lib.
- #run ⇒ Object
- #validate! ⇒ Object
Methods inherited from Stool::Command
#checkConfigFile, options, #pp
Constructor Details
#initialize(argv) ⇒ Lib
Returns a new instance of Lib.
23 24 25 26 27 28 |
# File 'lib/stool/Command/Lib.rb', line 23 def initialize(argv) # @info = LibInfo.new() @name = argv.shift_argument # @progress = argv.flag?('progress') super end |
Instance Attribute Details
#info ⇒ Object
查询结果lib信息
21 22 23 |
# File 'lib/stool/Command/Lib.rb', line 21 def info @info end |
#name ⇒ Object
要查询的lib名字
19 20 21 |
# File 'lib/stool/Command/Lib.rb', line 19 def name @name end |
Instance Method Details
#existAtPools? ⇒ Boolean
47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/stool/Command/Lib.rb', line 47 def existAtPools? #在libPool中查找lib arrayPools = LibPool::List::pools_from_config arrayPools.each {|pool| Dir.new(pool.path).each{|file| if @name.eql?(file) path = pool.path + "/#{file}" @info = LibInfo::loadFromPath(path) end } } @info end |
#run ⇒ Object
41 42 43 44 45 |
# File 'lib/stool/Command/Lib.rb', line 41 def run if @info @info.info_tos end end |
#validate! ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/stool/Command/Lib.rb', line 30 def validate! super unless @name help! 'need the lib `NAME`.' end unless existAtPools? help! "the lib named #{@name} did not find." end end |