class Escalator::Command::Combine

Attributes

commands[R]
config_path[R]
input_path[R]
work_path[R]

Public Class Methods

new(argv) click to toggle source
Calls superclass method
# File lib/escalator/command/combine.rb, line 76
def initialize argv
  @commands = argv.arguments!
  @config_path = argv.option "config-path", ""
  @input_path = argv.option "input-path", ""
  @work_path = argv.option "work-path", ""
  super
end
options() click to toggle source
Calls superclass method Escalator::Command::options
# File lib/escalator/command/combine.rb, line 68
def self.options
  [
    ["--config-path=path", "path 为任务流需要的配置参数 ConfigInfo.plist 文件路径, 执行 #{"escalator setup".ansi.green} 获取配置模版"],
    ["--input-path=path", "path 为初始命令需要的输入根目录, 会自动检测需要的输入文件"],
    ["--work-path=path", "path 为脚本工作的根目录"]
  ].concat super
end

Public Instance Methods

help!(error_message = nil) click to toggle source
# File lib/escalator/command/combine.rb, line 104
def help!(error_message = nil)
  invoked_command_class.help!(error_message, Help)
end
run() click to toggle source
# File lib/escalator/command/combine.rb, line 108
def run
  Escalator::Combine.run self
end
validate!() click to toggle source
Calls superclass method
# File lib/escalator/command/combine.rb, line 84
def validate!
  super
  if commands.empty?
    help! "未检测到 COMMAND 参数"
  end
  cmds = (commands - (%w(confuse archive resign upload) & commands))
  if !cmds.empty?
    help! "检测到 非法参数: #{cmds.join ", "}"
  end
  if config_path.empty?
    help! "未检测到 --config-path 参数"
  end
  if input_path.empty?
    help! "未检测到 --input-path 参数"
  end
  if work_path.empty?
    help! "未检测到 --work-path 参数"
  end
end