Class: Pod::Command::GitClone
- Inherits:
-
Pod::Command
- Object
- Pod::Command
- Pod::Command::GitClone
- Defined in:
- lib/cocoapods-hooks/command/git_clone.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ GitClone
constructor
A new instance of GitClone.
- #run ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(argv) ⇒ GitClone
Returns a new instance of GitClone.
15 16 17 18 19 |
# File 'lib/cocoapods-hooks/command/git_clone.rb', line 15 def initialize(argv) @tenantid = argv.option('tenantid') @branch = argv.option('branch') super end |
Class Method Details
.options ⇒ Object
8 9 10 11 12 13 |
# File 'lib/cocoapods-hooks/command/git_clone.rb', line 8 def self. [ ['--tenantid=TENANTID', 'Specify the tenant ID'], ['--branch=Branch', 'Specify the branch for git clone'] ].concat(super) end |
Instance Method Details
#run ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/cocoapods-hooks/command/git_clone.rb', line 26 def run UI.puts "Downloading OEM configuration for tenant #{@tenantid}" # 执行你的业务逻辑 if @branch == nil UI.puts "没有传入指定分支,默认使用 main_develop" @branch = 'main_develop' end self.class.git_clone_project_config(@tenantid, @branch) end |
#validate! ⇒ Object
21 22 23 24 |
# File 'lib/cocoapods-hooks/command/git_clone.rb', line 21 def validate! super help! 'A tenant ID is required.' unless @tenantid end |