Class: TYCiCore::Command::Lib::Create

Inherits:
TYCiCore::Command::Lib show all
Defined in:
lib/tuya/ci/core/command/lib/create_branch.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Create

Returns a new instance of Create.



25
26
27
28
29
30
31
# File 'lib/tuya/ci/core/command/lib/create_branch.rb', line 25

def initialize(argv)
	super
	@path = argv.option('path')
	@tag = argv.option('tag')
	@branch = argv.option('branch')
	@temp = argv.option('temp')
end

Class Method Details

.optionsObject



9
10
11
12
13
14
15
16
# File 'lib/tuya/ci/core/command/lib/create_branch.rb', line 9

def self.options
	[
		['--path=target_path', '--path target path a ci local module'],
		['--tag=0.0.1', '--tag tag'],
		['--branch=new_branch', '--branch new branch'],
		['--temp=temp_path', '--temp a temp path']
	].concat(super)
end

Instance Method Details

#runObject



33
34
35
36
# File 'lib/tuya/ci/core/command/lib/create_branch.rb', line 33

def run
	require 'tuya/ci/core'
	TYGit.checkout_custom_branch(@path, @tag, @branch, @temp)
end

#validate!Object



18
19
20
21
22
23
# File 'lib/tuya/ci/core/command/lib/create_branch.rb', line 18

def validate!
	help! "path need" unless @path
	help! "tag need" unless @tag
	help! "branch need" unless @branch
	help! "temp need" unless @temp
end