Class: Pod::Command::Stable

Inherits:
Pod::Command show all
Extended by:
Executable
Defined in:
lib/cocoapods-bb-PodAssistant/command/stable/stable.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Stable

Returns a new instance of Stable.



39
40
41
42
43
44
# File 'lib/cocoapods-bb-PodAssistant/command/stable/stable.rb', line 39

def initialize(argv)
  @names = argv.arguments! unless argv.arguments.empty?
  @help = argv.flag?('help')
  @init = argv.flag?('init')
  super
end

Class Method Details

.optionsObject



33
34
35
36
37
# File 'lib/cocoapods-bb-PodAssistant/command/stable/stable.rb', line 33

def self.options
  [
    ['--init', '初始化项目yml配置,根据当前项目Podfile.lock生成']
  ].concat(super)
end

Instance Method Details

#runObject

Main ########################################



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/cocoapods-bb-PodAssistant/command/stable/stable.rb', line 65

def run
  # begin
    source_manager = BB::SourceManager.new(@businessSpec)
    if @init
      Pod::UI.puts "开始配置生成当前项目yml文件".yellow
      # 生成本地yml配置
      source_manager.generate_localStable
    else
      Pod::UI.puts "开始合并远端lock数据".yellow
      ll_load_stable
      #2、clone origin lock spec to cache dir 
      ll_cloneStable
      #3、fetch newest code
      ll_fetch_stale_git
      # 数据合并
      source_manager.merge_stable_data
    end
  # rescue => exception
  #   puts "[pod stable] error(已捕获): #{exception}".red
  # end
  
end

#stable!(source, options = {}) ⇒ Object

help load podfile option



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/cocoapods-bb-PodAssistant/command/stable/stable.rb', line 51

def stable!(source, options = {})
  @ll_stable_source = source
  if options.has_key?(:specs) 
    @businessSpec = options[:specs]
    puts "当前业务使用源=>#{@businessSpec}"
  end
  @ll_stable_tag = options[:tag] if options.has_key?(:tag) 
  @ll_stable_branch = options[:branch] if options.has_key?(:branch)
  @cache = BB::Cache.new()
  configGitPath(@cache.cachePath)
end

#validate!Object



45
46
47
48
# File 'lib/cocoapods-bb-PodAssistant/command/stable/stable.rb', line 45

def validate!
  super
  banner! if @help
end