Class: BigKeeper::PodfileModuleDetector
- Inherits:
-
Object
- Object
- BigKeeper::PodfileModuleDetector
- Defined in:
- lib/big_keeper/util/podfile_module.rb
Instance Method Summary collapse
-
#check_version_list ⇒ Object
检查需要更新业务库列表.
- #deal_module_info ⇒ Object
- #get_module_latest_version(pod_model) ⇒ Object
- #get_pod_search_result(pod_name) ⇒ Object
-
#initialize(main_path) ⇒ PodfileModuleDetector
constructor
A new instance of PodfileModuleDetector.
Constructor Details
#initialize(main_path) ⇒ PodfileModuleDetector
Returns a new instance of PodfileModuleDetector.
11 12 13 14 15 16 |
# File 'lib/big_keeper/util/podfile_module.rb', line 11 def initialize(main_path) @module_list = BigkeeperParser.module_names @main_path = main_path @update_modules = {} # check_version_list end |
Instance Method Details
#check_version_list ⇒ Object
检查需要更新业务库列表
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/big_keeper/util/podfile_module.rb', line 19 def check_version_list if @module_list.empty? Logger.highlight('There is not any module should to be check.') return else Logger.highlight('Checking..') @module_list.each do |module_name| get_pod_search_result(module_name) end #获得pod信息后 deal_module_info end end |
#deal_module_info ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/big_keeper/util/podfile_module.rb', line 39 def deal_module_info podfile_lines = File.readlines("#{@main_path}/bigKeeperPodInfo.tmp", :encoding => 'UTF-8') Logger.highlight("Analyzing modules info...") unless podfile_lines.size.zero? podfile_lines.collect do |sentence| if sentence =~(/pod/) sentence = sentence.sub('pod', '') sentence = sentence.delete('\n\'') match_result = sentence.split(',') pod_name = match_result[0].strip latest_version = match_result[1].strip @update_modules[pod_name] = latest_version unless @update_modules.include?(pod_name) end end p @update_modules File.delete("#{@main_path}/bigKeeperPodInfo.tmp") @update_modules end |
#get_module_latest_version(pod_model) ⇒ Object
57 58 59 |
# File 'lib/big_keeper/util/podfile_module.rb', line 57 def get_module_latest_version(pod_model) end |
#get_pod_search_result(pod_name) ⇒ Object
34 35 36 37 |
# File 'lib/big_keeper/util/podfile_module.rb', line 34 def get_pod_search_result(pod_name) #输入pod Search 结果 `pod search #{pod_name} --ios --simple >> #{@main_path}/bigKeeperPodInfo.tmp` end |