Class: VPL::Command::Reg::Add

Inherits:
VPL::Command::Reg show all
Defined in:
lib/vcpkg_pipeline/command/reg/add.rb

Overview

VPL::Command::Reg::Add

Instance Attribute Summary

Attributes inherited from VPL::Command

#argv_extension

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from VPL::Command

ensure_not_root_or_allowed!, git_version, options_extension, options_extension_hash, run, verify_minimum_git_version!, verify_xcode_license_approved!

Constructor Details

#initialize(argv) ⇒ Add

Returns a new instance of Add.



25
26
27
28
29
30
# File 'lib/vcpkg_pipeline/command/reg/add.rb', line 25

def initialize(argv)
  @name = argv.shift_argument || ''
  @url = argv.shift_argument || ''

  super
end

Class Method Details

.optionsObject



21
22
23
# File 'lib/vcpkg_pipeline/command/reg/add.rb', line 21

def self.options
  [].concat(super)
end

Instance Method Details

#runObject



32
33
34
35
36
37
# File 'lib/vcpkg_pipeline/command/reg/add.rb', line 32

def run
  VPL.error('未输入注册表名称') if @name.empty?
  VPL.error('未输入注册表地址') if @url.empty?

  Register.new.add(@name, @url)
end