Class: YJCocoa::PodLib
- Defined in:
- lib/yjcocoa/pod/pod_lib.rb
Overview
Usage
Constant Summary
Constants inherited from Command
Instance Attribute Summary collapse
-
#create ⇒ Object
create pod.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ PodLib
constructor
A new instance of PodLib.
- #run ⇒ Object
- #validate! ⇒ Object
Methods inherited from Command
Constructor Details
#initialize(argv) ⇒ PodLib
Returns a new instance of PodLib.
27 28 29 30 |
# File 'lib/yjcocoa/pod/pod_lib.rb', line 27 def initialize(argv) super self.create = argv.option('create') end |
Instance Attribute Details
#create ⇒ Object
create pod
25 26 27 |
# File 'lib/yjcocoa/pod/pod_lib.rb', line 25 def create @create end |
Class Method Details
.options ⇒ Object
21 22 23 |
# File 'lib/yjcocoa/pod/pod_lib.rb', line 21 def self. [['--create', 'Creates a new Pod'],] + super end |
Instance Method Details
#run ⇒ Object
40 41 42 43 |
# File 'lib/yjcocoa/pod/pod_lib.rb', line 40 def run puts "YJCocoa create pod lib #{self.create}".green system("pod lib create [email protected]:937447974/pod-template.git #{self.create}") end |
#validate! ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/yjcocoa/pod/pod_lib.rb', line 32 def validate! super unless self.create && !self.create.empty? puts "库名为空".red self. end end |