Class: BB::StableManager

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-bb-PodAssistant/helpers/stable_manager_helper.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env = nil) ⇒ StableManager

Returns a new instance of StableManager.



7
8
9
# File 'lib/cocoapods-bb-PodAssistant/helpers/stable_manager_helper.rb', line 7

def initialize(env = nil)
    @env = env
end

Class Method Details

.pod_assistant_pathObject

pod助手ruby文件路径



88
89
90
91
# File 'lib/cocoapods-bb-PodAssistant/helpers/stable_manager_helper.rb', line 88

def self.pod_assistant_path()
    stableMgr = StableManager.new()
    return File.join(stableMgr.cachePath, "PodAssistant/PodAssistant.rb") #名称固定
end

.pod_assistant_robot_pathObject

pod助手机器人ruby文件路径



93
94
95
96
# File 'lib/cocoapods-bb-PodAssistant/helpers/stable_manager_helper.rb', line 93

def self.pod_assistant_robot_path()
    stableMgr = StableManager.new()
    return File.join(stableMgr.cachePath, "PodAssistant/robot.rb") #名称固定
end

.updateBusinessStableLock(pod_targets) ⇒ Object

podfile 更新配置文件使用(业务线)



78
79
80
81
# File 'lib/cocoapods-bb-PodAssistant/helpers/stable_manager_helper.rb', line 78

def self.updateBusinessStableLock(pod_targets)
    stableMgr = StableManager.new()
    stableMgr.update_business_stable_lock(pod_targets)
end

.updateCommonStableLock(pod_targets) ⇒ Object

更新通用lock



73
74
75
76
# File 'lib/cocoapods-bb-PodAssistant/helpers/stable_manager_helper.rb', line 73

def self.updateCommonStableLock(pod_targets)
    stableMgr = StableManager.new()
    stableMgr.update_common_stable_lock(pod_targets)
end

.updateProductStableLock(pod_targets) ⇒ Object

更新产品lock



83
84
85
86
# File 'lib/cocoapods-bb-PodAssistant/helpers/stable_manager_helper.rb', line 83

def self.updateProductStableLock(pod_targets)
    stableMgr = StableManager.new()
    stableMgr.update_product_stable_lock(pod_targets)
end

Instance Method Details

#business_stable_yaml(businessSpecName) ⇒ Object

业务源路径(远端)



46
47
48
49
50
51
# File 'lib/cocoapods-bb-PodAssistant/helpers/stable_manager_helper.rb', line 46

def business_stable_yaml(businessSpecName)
    if businessSpecName
        return File.join(cachePath, "#{businessSpecName}.yml") #名称由各自业务线约定
    end
    return nil
end

#cachePathObject

仓库缓存目录



33
34
35
36
37
38
# File 'lib/cocoapods-bb-PodAssistant/helpers/stable_manager_helper.rb', line 33

def cachePath
    if @cache.nil? 
        @cache = BB::Cache.new()
    end
    return @cache.cachePath
end

#local_stable_yamlObject

本地源路径



54
55
56
# File 'lib/cocoapods-bb-PodAssistant/helpers/stable_manager_helper.rb', line 54

def local_stable_yaml
    return File.join(Pathname.pwd, "stable_specs_lock.yml") #名称固定
end

#public_stable_yamlObject

公共源路径(远端)



41
42
43
# File 'lib/cocoapods-bb-PodAssistant/helpers/stable_manager_helper.rb', line 41

def public_stable_yaml
    return File.join(cachePath, "stable_specs.yml") #名称固定
end

#update_business_stable_lock(pod_targets) ⇒ Object

podfile 更新配置文件使用(业务线)



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/cocoapods-bb-PodAssistant/helpers/stable_manager_helper.rb', line 16

def update_business_stable_lock(pod_targets)
    if @env.nil?
        @env = BB::StableEnv.new()
    end
    businessSpecName = @env.business_stable
    if !businessSpecName.nil?
        update_stable_lock(business_stable_yaml(businessSpecName), pod_targets)
    else
        puts "没有配置业务线公共源,请确认!!!".yellow
    end
end

#update_common_stable_lock(pod_targets) ⇒ Object

podfile 更新配置文件使用(通用)



12
13
14
# File 'lib/cocoapods-bb-PodAssistant/helpers/stable_manager_helper.rb', line 12

def update_common_stable_lock(pod_targets)
    update_stable_lock(public_stable_yaml, pod_targets)
end

#update_product_stable_lock(pod_targets) ⇒ Object

podfile 更新配置文件使用(项目)



28
29
30
# File 'lib/cocoapods-bb-PodAssistant/helpers/stable_manager_helper.rb', line 28

def update_product_stable_lock(pod_targets)
    update_local_stable_lock(local_stable_yaml, pod_targets)
end