Class: KCommercial::KCPipeline::Command::CheckReleaseCMD

Inherits:
KCommercial::KCPipeline::Command show all
Defined in:
lib/KCommercialPipeline/command/check_release_cmd.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from KCommercial::KCPipeline::Command

#validate!

Constructor Details

#initialize(argv) ⇒ CheckReleaseCMD

Returns a new instance of CheckReleaseCMD.



18
19
20
21
# File 'lib/KCommercialPipeline/command/check_release_cmd.rb', line 18

def initialize(argv)
  @branch_name =  argv.option('branch_name') || ""
  super
end

Instance Attribute Details

#branch_nameObject (readonly)

Returns the value of attribute branch_name.



8
9
10
# File 'lib/KCommercialPipeline/command/check_release_cmd.rb', line 8

def branch_name
  @branch_name
end

Class Method Details

.optionsObject



12
13
14
15
16
# File 'lib/KCommercialPipeline/command/check_release_cmd.rb', line 12

def self.options
  [
    %w[--branch_name 需要校验的release分支,选填],
  ].concat(super )
end

Instance Method Details

#runObject



23
24
25
26
27
28
29
30
# File 'lib/KCommercialPipeline/command/check_release_cmd.rb', line 23

def run
  if @branch_name.nil? || @branch_name.empty?
    ReleaseCheck.new().check_all
  else
    ReleaseChecker.new(@branch_name).run!
  end

end