Class: Pod::Command::Stable::Update
- Inherits:
-
Pod::Command::Stable
- Object
- Pod::Command
- Pod::Command::Stable
- Pod::Command::Stable::Update
- Defined in:
- lib/cocoapods-bb-PodAssistant/command/stable/update.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Update
constructor
A new instance of Update.
- #run ⇒ Object
- #update_spec ⇒ Object
Constructor Details
#initialize(argv) ⇒ Update
Returns a new instance of Update.
29 30 31 32 33 34 |
# File 'lib/cocoapods-bb-PodAssistant/command/stable/update.rb', line 29 def initialize(argv) @pods = argv.arguments! @sync = argv.flag?('sync', true) @force = argv.flag?('force', true) super end |
Class Method Details
.options ⇒ Object
23 24 25 26 27 |
# File 'lib/cocoapods-bb-PodAssistant/command/stable/update.rb', line 23 def self. [ ['--force', '强制更新组件,突破stable版本限制'], ].concat(super) end |
Instance Method Details
#run ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/cocoapods-bb-PodAssistant/command/stable/update.rb', line 36 def run puts "[PodAssistant] 开始执行 $ pod stable update".yellow # system "git checkout Podfile.lock" source_manager = BB::SourceManager.new() # verify_podfile_exists! # 系统提供api验证podfile是否ok if @sync puts "[PodAssistant] 需要同步组件信息#{@pods}".green source_manager.merge_stable_data(@pods, @force) end podStartTime = Time.new update_spec if @pods.any? if !File.exist?(File.join(Dir.pwd,"Podfile.lock")) puts "工程第一次先执行pod 初始化 pod install" system "pod install" end pods_str = @pods.join(" ") system "pod update #{pods_str}" else system "pod update" end podEndTime = Time.new # 获取时间差 time = podEndTime - podStartTime puts "[PodAssistant] pod update操作总耗时【#{time.to_s.send(:red)}秒】start:#{podStartTime} end:#{podEndTime}".green source_manager.update_local_stable_from_podmodules(@pods) puts "[PodAssistant] `pod stable update` complete!".green end |
#update_spec ⇒ Object
65 66 67 68 69 |
# File 'lib/cocoapods-bb-PodAssistant/command/stable/update.rb', line 65 def update_spec system "pod repo update babybus-babybus-ios-specs-babybus-specs" system "pod repo update babybus-babybus-ios-specs-sourcev2-specs" system "pod repo update babybus-babybus-ios-specs-dylib-specs" end |