Class: YJCocoa::PodLib

Inherits:
Pod
  • Object
show all
Defined in:
lib/yjcocoa/pod/pod_lib.rb

Overview

Usage

Constant Summary

Constants inherited from Command

Command::DEFAULT_OPTIONS

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

#askWithAnswers

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

#createObject

create pod



25
26
27
# File 'lib/yjcocoa/pod/pod_lib.rb', line 25

def create
  @create
end

Class Method Details

.optionsObject



21
22
23
# File 'lib/yjcocoa/pod/pod_lib.rb', line 21

def self.options
    [['--create', 'Creates a new Pod'],] + super
end

Instance Method Details

#runObject



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.banner!
    end
end