Class: KCommercial::KCPipeline::Command::GitHookInstall

Inherits:
KCommercial::KCPipeline::Command show all
Defined in:
lib/KCommercialPipeline/command/git_hook_install_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) ⇒ GitHookInstall

Returns a new instance of GitHookInstall.



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

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

Instance Attribute Details

#platformObject (readonly)

Returns the value of attribute platform.



7
8
9
# File 'lib/KCommercialPipeline/command/git_hook_install_cmd.rb', line 7

def platform
  @platform
end

Class Method Details

.optionsObject



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

def self.options
  [
    ['--platform', "填iOS or Android,根据平台安装两端githook"]
  ].concat(super )
end

Instance Method Details

#runObject



23
24
25
# File 'lib/KCommercialPipeline/command/git_hook_install_cmd.rb', line 23

def run
  InstallGitHook.new(@platform).install!
end