class Bytedance::BytedanceManager::Lib::Create

Public Class Methods

new(params) click to toggle source
Calls superclass method
# File lib/command/lib/create.rb, line 13
def initialize(params)
  @projectName = params.shift_argument
  @components = params.option('components','optional')
  @prefix = params.option('prefix','TT')
  @platform =  params.flag?('platform',true)
  super
end
options() click to toggle source
Calls superclass method Bytedance::BytedanceManager::options
# File lib/command/lib/create.rb, line 7
def self.options
  [['--platform', '是否引入平台基础库,默认引入,不引入使用--no-platform'],
  ['--components=[none|optional|all]', 'none 不引入任何组件,optional 选择自己想要的(default), all 引入全部组件,于平台一致'],
  ['--prefix', '可选,默认 prefix = TT']].concat(super)
end

Public Instance Methods

run() click to toggle source
Calls superclass method Bytedance::BytedanceManager::Lib#run
# File lib/command/lib/create.rb, line 33
def run
  super
  parameter = [@projectName,'--components='+ @components,'--prefix=' + @prefix, @platform ? '--platform' : '--no-platform', '--template-url=git@code.byted.org:TTIOS/pod-template.git','--createlib']
  finalParams = CLAide::ARGV.new(parameter)
  Pod::Command::Lib::Create.new(finalParams).run
end
validate!() click to toggle source
Calls superclass method
# File lib/command/lib/create.rb, line 21
def validate!
  super
  if @components && !%w(none optional all).include?(@components)
    help! "`#{@components}' 参数无效,components = none 或 optional 或 all "          
  end

  if !@projectName
    help! "参数错误,需要输入项目名称,bytedance lib create projectName"
  end
    
end