Class: Pod::Command::OemConfig
- Inherits:
-
Pod::Command
- Object
- Pod::Command
- Pod::Command::OemConfig
- Defined in:
- lib/cocoapods-hooks/command/oem_config.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ OemConfig
constructor
A new instance of OemConfig.
- #run ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(argv) ⇒ OemConfig
Returns a new instance of OemConfig.
15 16 17 18 19 |
# File 'lib/cocoapods-hooks/command/oem_config.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/oem_config.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 35 36 37 38 39 |
# File 'lib/cocoapods-hooks/command/oem_config.rb', line 26 def run UI.puts "Downloading OEM configuration for tenant #{@tenantid}" # 执行你的业务逻辑 if @branch == nil UI.puts "没有传入指定分支,默认使用 main_develop" @branch = 'main_develop' end # 1. 根据 tenant_id 下载相关的配置文件 system("pod git-clone --tenantid=#{@tenantid} --branch=#{@branch}") # 2. 修改图片的主题色 system("pod change-color") # 3. 修改工程配置, 进行签名 system("pod fastlane-sign") end |
#validate! ⇒ Object
21 22 23 24 |
# File 'lib/cocoapods-hooks/command/oem_config.rb', line 21 def validate! super help! 'A tenant ID is required.' unless @tenantid end |