Class: EasyCI::Command::Unitydraw

Inherits:
EasyCI::Command show all
Defined in:
lib/easyci/command/unitydraw.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Unitydraw

Returns a new instance of Unitydraw.



14
15
16
17
18
# File 'lib/easyci/command/unitydraw.rb', line 14

def initialize(argv)
  @project_path = argv.option('project-path')
  @output_path = argv.option('output')
  super
end

Class Method Details

.optionsObject



7
8
9
10
11
12
# File 'lib/easyci/command/unitydraw.rb', line 7

def self.options
  [
    ['--project-path=PATH', '指定Unity项目路径'],
    ['--output=PATH', '输出图形的路径']
  ].concat(super)
end

Instance Method Details

#runObject



25
26
27
28
29
30
31
32
33
34
# File 'lib/easyci/command/unitydraw.rb', line 25

def run
  puts "分析Unity项目: #{@project_path}" if @verbose
  # 这里是实际执行Unity项目分析和绘图的代码
  puts "生成项目依赖图..."
  # 模拟工作
  sleep(1)
  
  output = @output_path || "unity_dependencies.png"
  puts "项目依赖图已生成至: #{output}"
end

#validate!Object



20
21
22
23
# File 'lib/easyci/command/unitydraw.rb', line 20

def validate!
  super
  help! '必须提供项目路径' unless @project_path
end